roscal_lib/implementation/
component_definition.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 ComponentDefinition {
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 component_definition: ComponentDefinitionClass,
19}
20
21/// A collection of component descriptions, which may optionally be grouped by capability.
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 ComponentDefinitionClass {
29    #[builder(setter(into, strip_option), default)]
30    #[serde(default, skip_serializing_if = "Option::is_none")]
31    pub back_matter: Option<BackMatter>,
32    #[builder(setter(into, strip_option), default)]
33    #[serde(default, skip_serializing_if = "Option::is_none")]
34    pub capabilities: Option<Vec<Capability>>,
35    #[builder(setter(into, strip_option), default)]
36    #[serde(default, skip_serializing_if = "Option::is_none")]
37    pub components: Option<Vec<Component>>,
38    #[builder(setter(into, strip_option), default)]
39    #[serde(default, skip_serializing_if = "Option::is_none")]
40    pub import_component_definitions: Option<Vec<ImportComponentDefinition>>,
41    pub metadata: DocumentMetadata,
42    /// Provides a globally unique means to identify a given component definition instance.
43    #[serde(
44        serialize_with = "validation::ser_uuid",
45        deserialize_with = "validation::deser_uuid"
46    )]
47    #[derivative(PartialEq = "ignore")]
48    pub uuid: String,
49}
50
51/// A collection of resources that may be referenced from within the OSCAL document instance.
52#[derive(Debug, Clone, Serialize, Deserialize)]
53#[derive(Builder, Derivative)]
54#[builder(setter(into, strip_option))]
55#[derivative(PartialEq)]
56#[serde(deny_unknown_fields)]
57pub struct BackMatter {
58    #[builder(setter(into, strip_option), default)]
59    #[serde(default, skip_serializing_if = "Option::is_none")]
60    pub resources: Option<Vec<Resource>>,
61}
62
63/// A resource associated with content in the containing document instance. A resource may be
64/// directly included in the document using base64 encoding or may point to one or more
65/// equivalent internet resources.
66#[derive(Debug, Clone, Serialize, Deserialize)]
67#[serde(rename_all = "kebab-case")]
68#[derive(Builder, Derivative)]
69#[builder(setter(into, strip_option))]
70#[derivative(PartialEq)]
71#[serde(deny_unknown_fields)]
72pub struct Resource {
73    /// A resource encoded using the Base64 alphabet defined by RFC 2045.
74    #[builder(setter(into, strip_option), default)]
75    #[serde(default, skip_serializing_if = "Option::is_none")]
76    pub base64: Option<Base64>,
77    /// An optional citation consisting of end note text using structured markup.
78    #[builder(setter(into, strip_option), default)]
79    #[serde(default, skip_serializing_if = "Option::is_none")]
80    pub citation: Option<Citation>,
81    /// An optional short summary of the resource used to indicate the purpose of the resource.
82    #[builder(setter(into, strip_option), default)]
83    #[serde(default, skip_serializing_if = "Option::is_none")]
84    #[serde(deserialize_with = "validation::deser_markup_opt")]
85    pub description: Option<String>,
86    #[builder(setter(into, strip_option), default)]
87    #[serde(default, skip_serializing_if = "Option::is_none")]
88    pub document_ids: Option<Vec<DocumentIdentifier>>,
89    #[builder(setter(into, strip_option), default)]
90    #[serde(default, skip_serializing_if = "Option::is_none")]
91    pub props: Option<Vec<Property>>,
92    #[builder(setter(into, strip_option), default)]
93    #[serde(default, skip_serializing_if = "Option::is_none")]
94    #[serde(deserialize_with = "validation::deser_markup_opt")]
95    pub remarks: Option<String>,
96    #[builder(setter(into, strip_option), default)]
97    #[serde(default, skip_serializing_if = "Option::is_none")]
98    pub rlinks: Option<Vec<ResourceLink>>,
99    /// An optional name given to the resource, which may be used by a tool for display and
100    /// navigation.
101    #[builder(setter(into, strip_option), default)]
102    #[serde(default, skip_serializing_if = "Option::is_none")]
103    #[serde(deserialize_with = "validation::deser_markup_opt")]
104    pub title: Option<String>,
105    /// A unique identifier for a resource.
106    #[serde(
107        serialize_with = "validation::ser_uuid",
108        deserialize_with = "validation::deser_uuid"
109    )]
110    #[derivative(PartialEq = "ignore")]
111    pub uuid: String,
112}
113
114/// A resource encoded using the Base64 alphabet defined by RFC 2045.
115#[derive(Debug, Clone, Serialize, Deserialize)]
116#[serde(rename_all = "kebab-case")]
117#[derive(Builder, Derivative)]
118#[builder(setter(into, strip_option))]
119#[derivative(PartialEq)]
120#[serde(deny_unknown_fields)]
121pub struct Base64 {
122    /// Name of the file before it was encoded as Base64 to be embedded in a resource. This is
123    /// the name that will be assigned to the file when the file is decoded.
124    #[builder(setter(into, strip_option), default)]
125    #[serde(default, skip_serializing_if = "Option::is_none")]
126    #[serde(
127        serialize_with = "validation::ser_token_opt",
128        deserialize_with = "validation::deser_token_opt"
129    )]
130    pub filename: Option<String>,
131    /// A label that indicates the nature of a resource, as a data serialization or format.
132    #[builder(setter(into, strip_option), default)]
133    #[serde(default, skip_serializing_if = "Option::is_none")]
134    pub media_type: Option<String>,
135    #[serde(
136        serialize_with = "validation::ser_base64",
137        deserialize_with = "validation::deser_base64"
138    )]
139    pub value: String,
140}
141
142/// An optional citation consisting of end note text using structured markup.
143#[derive(Debug, Clone, Serialize, Deserialize)]
144#[derive(Builder, Derivative)]
145#[builder(setter(into, strip_option))]
146#[derivative(PartialEq)]
147#[serde(deny_unknown_fields)]
148pub struct Citation {
149    #[builder(setter(into, strip_option), default)]
150    #[serde(default, skip_serializing_if = "Option::is_none")]
151    pub links: Option<Vec<Link>>,
152    #[builder(setter(into, strip_option), default)]
153    #[serde(default, skip_serializing_if = "Option::is_none")]
154    pub props: Option<Vec<Property>>,
155    /// A line of citation text.
156    #[serde(deserialize_with = "validation::deser_markup")]
157    pub text: String,
158}
159
160/// A reference to a local or remote resource, that has a specific relation to the containing
161/// object.
162#[derive(Debug, Clone, Serialize, Deserialize)]
163#[serde(rename_all = "kebab-case")]
164#[derive(Builder, Derivative)]
165#[builder(setter(into, strip_option))]
166#[derivative(PartialEq)]
167#[serde(deny_unknown_fields)]
168pub struct Link {
169    /// A resolvable URL reference to a resource.
170    #[serde(
171        serialize_with = "validation::ser_uri_ref",
172        deserialize_with = "validation::deser_uri_ref"
173    )]
174    pub href: String,
175    /// A label that indicates the nature of a resource, as a data serialization or format.
176    #[builder(setter(into, strip_option), default)]
177    #[serde(default, skip_serializing_if = "Option::is_none")]
178    pub media_type: Option<String>,
179    /// Describes the type of relationship provided by the link's hypertext reference. This can
180    /// be an indicator of the link's purpose.
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 rel: Option<String>,
188    /// In case where the href points to a back-matter/resource, this value will indicate the URI
189    /// fragment to append to any rlink associated with the resource. This value MUST be URI
190    /// encoded.
191    #[builder(setter(into, strip_option), default)]
192    #[serde(default, skip_serializing_if = "Option::is_none")]
193    pub resource_fragment: Option<String>,
194    /// A textual label to associate with the link, which may be used for presentation in a tool.
195    #[builder(setter(into, strip_option), default)]
196    #[serde(default, skip_serializing_if = "Option::is_none")]
197    #[serde(deserialize_with = "validation::deser_markup_opt")]
198    pub text: Option<String>,
199}
200
201/// An attribute, characteristic, or quality of the containing object expressed as a
202/// namespace qualified name/value pair.
203#[derive(Debug, Clone, Serialize, Deserialize)]
204#[derive(Builder, Derivative)]
205#[builder(setter(into, strip_option))]
206#[derivative(PartialEq)]
207#[serde(deny_unknown_fields)]
208pub struct Property {
209    /// A textual label that provides a sub-type or characterization of the property's name.
210    #[builder(setter(into, strip_option), default)]
211    #[serde(default, skip_serializing_if = "Option::is_none")]
212    #[serde(
213        serialize_with = "validation::ser_token_opt",
214        deserialize_with = "validation::deser_token_opt"
215    )]
216    pub class: Option<String>,
217    /// An identifier for relating distinct sets of properties.
218    #[builder(setter(into, strip_option), default)]
219    #[serde(default, skip_serializing_if = "Option::is_none")]
220    #[serde(
221        serialize_with = "validation::ser_token_opt",
222        deserialize_with = "validation::deser_token_opt"
223    )]
224    pub group: Option<String>,
225    /// A textual label, within a namespace, that uniquely identifies a specific attribute,
226    /// characteristic, or quality of the property's containing object.
227    #[serde(
228        serialize_with = "validation::ser_token",
229        deserialize_with = "validation::deser_token"
230    )]
231    pub name: String,
232    /// A namespace qualifying the property's name. This allows different organizations to
233    /// associate distinct semantics with the same name.
234    #[builder(setter(into, strip_option), default)]
235    #[serde(default, skip_serializing_if = "Option::is_none")]
236    #[serde(
237        serialize_with = "validation::ser_uri_opt",
238        deserialize_with = "validation::deser_uri_opt"
239    )]
240    pub ns: Option<String>,
241    #[builder(setter(into, strip_option), default)]
242    #[serde(default, skip_serializing_if = "Option::is_none")]
243    #[serde(deserialize_with = "validation::deser_markup_opt")]
244    pub remarks: Option<String>,
245    /// A unique identifier for a property.
246    #[builder(setter(into, strip_option), default)]
247    #[serde(default, skip_serializing_if = "Option::is_none")]
248    #[serde(
249        serialize_with = "validation::ser_uuid_opt",
250        deserialize_with = "validation::deser_uuid_opt"
251    )]
252    #[derivative(PartialEq = "ignore")]
253    pub uuid: Option<String>,
254    /// Indicates the value of the attribute, characteristic, or quality.
255    pub value: String,
256}
257
258/// A document identifier qualified by an identifier scheme.
259#[derive(Debug, Clone, Serialize, Deserialize)]
260#[derive(Builder, Derivative)]
261#[builder(setter(into, strip_option))]
262#[derivative(PartialEq)]
263#[serde(deny_unknown_fields)]
264pub struct DocumentIdentifier {
265    pub identifier: String,
266    /// Qualifies the kind of document identifier using a URI. If the scheme is not provided the
267    /// value of the element will be interpreted as a string of characters.
268    #[builder(setter(into, strip_option), default)]
269    #[serde(default, skip_serializing_if = "Option::is_none")]
270    #[serde(
271        serialize_with = "validation::ser_uri_opt",
272        deserialize_with = "validation::deser_uri_opt"
273    )]
274    pub scheme: Option<String>,
275}
276
277/// A URL-based pointer to an external resource with an optional hash for verification and
278/// change detection.
279#[derive(Debug, Clone, Serialize, Deserialize)]
280#[serde(rename_all = "kebab-case")]
281#[derive(Builder, Derivative)]
282#[builder(setter(into, strip_option))]
283#[derivative(PartialEq)]
284#[serde(deny_unknown_fields)]
285pub struct ResourceLink {
286    #[builder(setter(into, strip_option), default)]
287    #[serde(default, skip_serializing_if = "Option::is_none")]
288    pub hashes: Option<Vec<Hash>>,
289    /// A resolvable URL pointing to the referenced resource.
290    #[serde(
291        serialize_with = "validation::ser_uri_ref",
292        deserialize_with = "validation::deser_uri_ref"
293    )]
294    pub href: String,
295    /// A label that indicates the nature of a resource, as a data serialization or format.
296    #[builder(setter(into, strip_option), default)]
297    #[serde(default, skip_serializing_if = "Option::is_none")]
298    pub media_type: Option<String>,
299}
300
301/// A representation of a cryptographic digest generated over a resource using a specified
302/// hash algorithm.
303#[derive(Debug, Clone, Serialize, Deserialize)]
304#[derive(Builder, Derivative)]
305#[builder(setter(into, strip_option))]
306#[derivative(PartialEq)]
307#[serde(deny_unknown_fields)]
308pub struct Hash {
309    /// The digest method by which a hash is derived.
310    pub algorithm: String,
311    #[serde(
312        serialize_with = "validation::ser_hash",
313        deserialize_with = "validation::deser_hash"
314    )]
315    pub value: String,
316}
317
318/// A grouping of other components and/or capabilities.
319#[derive(Debug, Clone, Serialize, Deserialize)]
320#[serde(rename_all = "kebab-case")]
321#[derive(Builder, Derivative)]
322#[builder(setter(into, strip_option))]
323#[derivative(PartialEq)]
324#[serde(deny_unknown_fields)]
325pub struct Capability {
326    #[builder(setter(into, strip_option), default)]
327    #[serde(default, skip_serializing_if = "Option::is_none")]
328    pub control_implementations: Option<Vec<ControlImplementationSet>>,
329    /// A summary of the capability.
330    #[serde(deserialize_with = "validation::deser_markup")]
331    pub description: String,
332    #[builder(setter(into, strip_option), default)]
333    #[serde(default, skip_serializing_if = "Option::is_none")]
334    pub incorporates_components: Option<Vec<IncorporatesComponent>>,
335    #[builder(setter(into, strip_option), default)]
336    #[serde(default, skip_serializing_if = "Option::is_none")]
337    pub links: Option<Vec<Link>>,
338    /// The capability's human-readable name.
339    pub name: String,
340    #[builder(setter(into, strip_option), default)]
341    #[serde(default, skip_serializing_if = "Option::is_none")]
342    pub props: Option<Vec<Property>>,
343    #[builder(setter(into, strip_option), default)]
344    #[serde(default, skip_serializing_if = "Option::is_none")]
345    #[serde(deserialize_with = "validation::deser_markup_opt")]
346    pub remarks: Option<String>,
347    /// Provides a globally unique means to identify a given capability.
348    #[serde(
349        serialize_with = "validation::ser_uuid",
350        deserialize_with = "validation::deser_uuid"
351    )]
352    #[derivative(PartialEq = "ignore")]
353    pub uuid: String,
354}
355
356/// Defines how the component or capability supports a set of controls.
357#[derive(Debug, Clone, Serialize, Deserialize)]
358#[serde(rename_all = "kebab-case")]
359#[derive(Builder, Derivative)]
360#[builder(setter(into, strip_option))]
361#[derivative(PartialEq)]
362#[serde(deny_unknown_fields)]
363pub struct ControlImplementationSet {
364    /// A description of how the specified set of controls are implemented for the containing
365    /// component or capability.
366    #[serde(deserialize_with = "validation::deser_markup")]
367    pub description: String,
368    pub implemented_requirements: Vec<ControlImplementation>,
369    #[builder(setter(into, strip_option), default)]
370    #[serde(default, skip_serializing_if = "Option::is_none")]
371    pub links: Option<Vec<Link>>,
372    #[builder(setter(into, strip_option), default)]
373    #[serde(default, skip_serializing_if = "Option::is_none")]
374    pub props: Option<Vec<Property>>,
375    #[builder(setter(into, strip_option), default)]
376    #[serde(default, skip_serializing_if = "Option::is_none")]
377    pub set_parameters: Option<Vec<SetParameterValue>>,
378    /// A reference to an OSCAL catalog or profile providing the referenced control or subcontrol
379    /// definition.
380    pub source: String,
381    /// Provides a means to identify a set of control implementations that are supported by a
382    /// given component or capability.
383    #[serde(
384        serialize_with = "validation::ser_uuid",
385        deserialize_with = "validation::deser_uuid"
386    )]
387    #[derivative(PartialEq = "ignore")]
388    pub uuid: String,
389}
390
391/// Describes how the containing component or capability implements an individual control.
392#[derive(Debug, Clone, Serialize, Deserialize)]
393#[serde(rename_all = "kebab-case")]
394#[derive(Builder, Derivative)]
395#[builder(setter(into, strip_option))]
396#[derivative(PartialEq)]
397#[serde(deny_unknown_fields)]
398pub struct ControlImplementation {
399    /// A reference to a control with a corresponding id value. When referencing an externally
400    /// defined control, the Control Identifier Reference must be used in the context of the
401    /// external / imported OSCAL instance (e.g., uri-reference).
402    #[serde(
403        serialize_with = "validation::ser_token",
404        deserialize_with = "validation::deser_token"
405    )]
406    pub control_id: String,
407    /// A suggestion from the supplier (e.g., component vendor or author) for how the specified
408    /// control may be implemented if the containing component or capability is instantiated in a
409    /// system security plan.
410    pub description: String,
411    #[builder(setter(into, strip_option), default)]
412    #[serde(default, skip_serializing_if = "Option::is_none")]
413    pub links: Option<Vec<Link>>,
414    #[builder(setter(into, strip_option), default)]
415    #[serde(default, skip_serializing_if = "Option::is_none")]
416    pub props: Option<Vec<Property>>,
417    #[builder(setter(into, strip_option), default)]
418    #[serde(default, skip_serializing_if = "Option::is_none")]
419    #[serde(deserialize_with = "validation::deser_markup_opt")]
420    pub remarks: Option<String>,
421    #[builder(setter(into, strip_option), default)]
422    #[serde(default, skip_serializing_if = "Option::is_none")]
423    pub responsible_roles: Option<Vec<ResponsibleRole>>,
424    #[builder(setter(into, strip_option), default)]
425    #[serde(default, skip_serializing_if = "Option::is_none")]
426    pub set_parameters: Option<Vec<SetParameterValue>>,
427    #[builder(setter(into, strip_option), default)]
428    #[serde(default, skip_serializing_if = "Option::is_none")]
429    pub statements: Option<Vec<ControlStatementImplementation>>,
430    /// Provides a globally unique means to identify a given control implementation by a
431    /// component.
432    #[serde(
433        serialize_with = "validation::ser_uuid",
434        deserialize_with = "validation::deser_uuid"
435    )]
436    #[derivative(PartialEq = "ignore")]
437    pub uuid: String,
438}
439
440/// A reference to a role with responsibility for performing a function relative to the
441/// containing object, optionally associated with a set of persons and/or organizations that
442/// perform that role.
443#[derive(Debug, Clone, Serialize, Deserialize)]
444#[serde(rename_all = "kebab-case")]
445#[derive(Builder, Derivative)]
446#[builder(setter(into, strip_option))]
447#[derivative(PartialEq)]
448#[serde(deny_unknown_fields)]
449pub struct ResponsibleRole {
450    #[builder(setter(into, strip_option), default)]
451    #[serde(default, skip_serializing_if = "Option::is_none")]
452    pub links: Option<Vec<Link>>,
453    #[builder(setter(into, strip_option), default)]
454    #[serde(default, skip_serializing_if = "Option::is_none")]
455    #[serde(
456        serialize_with = "validation::ser_uuid_vec_opt",
457        deserialize_with = "validation::deser_uuid_vec_opt"
458    )]
459    pub party_uuids: Option<Vec<String>>,
460    #[builder(setter(into, strip_option), default)]
461    #[serde(default, skip_serializing_if = "Option::is_none")]
462    pub props: Option<Vec<Property>>,
463    #[builder(setter(into, strip_option), default)]
464    #[serde(default, skip_serializing_if = "Option::is_none")]
465    #[serde(deserialize_with = "validation::deser_markup_opt")]
466    pub remarks: Option<String>,
467    /// A human-oriented identifier reference to a role performed.
468    #[serde(
469        serialize_with = "validation::ser_token",
470        deserialize_with = "validation::deser_token"
471    )]
472    pub role_id: String,
473}
474
475/// Identifies the parameter that will be set by the enclosed value.
476#[derive(Debug, Clone, Serialize, Deserialize)]
477#[serde(rename_all = "kebab-case")]
478#[derive(Builder, Derivative)]
479#[builder(setter(into, strip_option))]
480#[derivative(PartialEq)]
481#[serde(deny_unknown_fields)]
482pub struct SetParameterValue {
483    /// A human-oriented reference to a parameter within a control, who's catalog has been
484    /// imported into the current implementation context.
485    #[serde(
486        serialize_with = "validation::ser_token",
487        deserialize_with = "validation::deser_token"
488    )]
489    pub param_id: String,
490    #[builder(setter(into, strip_option), default)]
491    #[serde(default, skip_serializing_if = "Option::is_none")]
492    #[serde(deserialize_with = "validation::deser_markup_opt")]
493    pub remarks: Option<String>,
494    pub values: Vec<String>,
495}
496
497/// Identifies which statements within a control are addressed.
498#[derive(Debug, Clone, Serialize, Deserialize)]
499#[serde(rename_all = "kebab-case")]
500#[derive(Builder, Derivative)]
501#[builder(setter(into, strip_option))]
502#[derivative(PartialEq)]
503#[serde(deny_unknown_fields)]
504pub struct ControlStatementImplementation {
505    /// A summary of how the containing control statement is implemented by the component or
506    /// capability.
507    #[serde(deserialize_with = "validation::deser_markup")]
508    pub description: String,
509    #[builder(setter(into, strip_option), default)]
510    #[serde(default, skip_serializing_if = "Option::is_none")]
511    pub links: Option<Vec<Link>>,
512    #[builder(setter(into, strip_option), default)]
513    #[serde(default, skip_serializing_if = "Option::is_none")]
514    pub props: Option<Vec<Property>>,
515    #[builder(setter(into, strip_option), default)]
516    #[serde(default, skip_serializing_if = "Option::is_none")]
517    #[serde(deserialize_with = "validation::deser_markup_opt")]
518    pub remarks: Option<String>,
519    #[builder(setter(into, strip_option), default)]
520    #[serde(default, skip_serializing_if = "Option::is_none")]
521    pub responsible_roles: Option<Vec<ResponsibleRole>>,
522    /// A human-oriented identifier reference to a control statement.
523    #[serde(
524        serialize_with = "validation::ser_token",
525        deserialize_with = "validation::deser_token"
526    )]
527    pub statement_id: String,
528    /// A machine-oriented, globally unique identifier with cross-instance scope that can be used
529    /// to reference this control statement elsewhere in this or other OSCAL instances. The UUID
530    /// of the control statement in the source OSCAL instance is sufficient to reference the data
531    /// item locally or globally (e.g., in an imported OSCAL instance).
532    #[serde(
533        serialize_with = "validation::ser_uuid",
534        deserialize_with = "validation::deser_uuid"
535    )]
536    #[derivative(PartialEq = "ignore")]
537    pub uuid: String,
538}
539
540/// The collection of components comprising this capability.
541#[derive(Debug, Clone, Serialize, Deserialize)]
542#[serde(rename_all = "kebab-case")]
543#[derive(Builder, Derivative)]
544#[builder(setter(into, strip_option))]
545#[derivative(PartialEq)]
546#[serde(deny_unknown_fields)]
547pub struct IncorporatesComponent {
548    /// A machine-oriented identifier reference to a component.
549    #[derivative(PartialEq = "ignore")]
550    #[serde(
551        serialize_with = "validation::ser_uuid",
552        deserialize_with = "validation::deser_uuid"
553    )]
554    pub component_uuid: String,
555    /// A description of the component, including information about its function.
556    pub description: String,
557}
558
559/// A defined component that can be part of an implemented system.
560#[derive(Debug, Clone, Serialize, Deserialize)]
561#[serde(rename_all = "kebab-case")]
562#[derive(Builder, Derivative)]
563#[builder(setter(into, strip_option))]
564#[derivative(PartialEq)]
565#[serde(deny_unknown_fields)]
566pub struct Component {
567    #[builder(setter(into, strip_option), default)]
568    #[serde(default, skip_serializing_if = "Option::is_none")]
569    pub control_implementations: Option<Vec<ControlImplementationSet>>,
570    /// A description of the component, including information about its function.
571    #[serde(deserialize_with = "validation::deser_markup")]
572    pub description: String,
573    #[builder(setter(into, strip_option), default)]
574    #[serde(default, skip_serializing_if = "Option::is_none")]
575    pub links: Option<Vec<Link>>,
576    #[builder(setter(into, strip_option), default)]
577    #[serde(default, skip_serializing_if = "Option::is_none")]
578    pub props: Option<Vec<Property>>,
579    #[builder(setter(into, strip_option), default)]
580    #[serde(default, skip_serializing_if = "Option::is_none")]
581    pub protocols: Option<Vec<ServiceProtocolInformation>>,
582    /// A summary of the technological or business purpose of the component.
583    #[builder(setter(into, strip_option), default)]
584    #[serde(default, skip_serializing_if = "Option::is_none")]
585    #[serde(deserialize_with = "validation::deser_markup_opt")]
586    pub purpose: Option<String>,
587    #[builder(setter(into, strip_option), default)]
588    #[serde(default, skip_serializing_if = "Option::is_none")]
589    #[serde(deserialize_with = "validation::deser_markup_opt")]
590    pub remarks: Option<String>,
591    #[builder(setter(into, strip_option), default)]
592    #[serde(default, skip_serializing_if = "Option::is_none")]
593    pub responsible_roles: Option<Vec<ResponsibleRole>>,
594    /// A human readable name for the component.
595    #[serde(deserialize_with = "validation::deser_markup")]
596    pub title: String,
597    /// A category describing the purpose of the component.
598    #[serde(rename = "type")]
599    #[serde(
600        serialize_with = "validation::ser_token",
601        deserialize_with = "validation::deser_token"
602    )]
603    pub component_type: String,
604    /// Provides a globally unique means to identify a given component.
605    #[serde(
606        serialize_with = "validation::ser_uuid",
607        deserialize_with = "validation::deser_uuid"
608    )]
609    #[derivative(PartialEq = "ignore")]
610    pub uuid: String,
611}
612
613/// Information about the protocol used to provide a service.
614#[derive(Debug, Clone, Serialize, Deserialize)]
615#[serde(rename_all = "kebab-case")]
616#[derive(Builder, Derivative)]
617#[builder(setter(into, strip_option))]
618#[derivative(PartialEq)]
619#[serde(deny_unknown_fields)]
620pub struct ServiceProtocolInformation {
621    /// The common name of the protocol, which should be the appropriate "service name" from the
622    /// IANA Service Name and Transport Protocol Port Number Registry.
623    pub name: String,
624    #[builder(setter(into, strip_option), default)]
625    #[serde(default, skip_serializing_if = "Option::is_none")]
626    pub port_ranges: Option<Vec<PortRange>>,
627    /// A human readable name for the protocol (e.g., Transport Layer Security).
628    #[builder(setter(into, strip_option), default)]
629    #[serde(default, skip_serializing_if = "Option::is_none")]
630    #[serde(deserialize_with = "validation::deser_markup_opt")]
631    pub title: Option<String>,
632    /// A machine-oriented, globally unique identifier with cross-instance scope that can be used
633    /// to reference this service protocol information elsewhere in this or other OSCAL
634    /// instances. The locally defined UUID of the service protocol can be used to reference the
635    /// data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be
636    /// assigned per-subject, which means it should be consistently used to identify the same
637    /// subject across revisions of the document.
638    #[builder(setter(into, strip_option), default)]
639    #[serde(default, skip_serializing_if = "Option::is_none")]
640    #[serde(
641        serialize_with = "validation::ser_uuid_opt",
642        deserialize_with = "validation::deser_uuid_opt"
643    )]
644    #[derivative(PartialEq = "ignore")]
645    pub uuid: Option<String>,
646}
647
648/// Where applicable this is the IPv4 port range on which the service operates.
649#[derive(Debug, Clone, Serialize, Deserialize)]
650#[derive(Builder, Derivative)]
651#[builder(setter(into, strip_option))]
652#[derivative(PartialEq)]
653#[serde(deny_unknown_fields)]
654pub struct PortRange {
655    /// Indicates the ending port number in a port range
656    #[builder(setter(into, strip_option), default)]
657    #[serde(default, skip_serializing_if = "Option::is_none")]
658    #[serde(
659        serialize_with = "validation::ser_non_neg_int_opt",
660        deserialize_with = "validation::deser_non_neg_int_opt"
661    )]
662    pub end: Option<i64>,
663    /// Indicates the starting port number in a port range
664    #[builder(setter(into, strip_option), default)]
665    #[serde(default, skip_serializing_if = "Option::is_none")]
666    #[serde(
667        serialize_with = "validation::ser_non_neg_int_opt",
668        deserialize_with = "validation::deser_non_neg_int_opt"
669    )]
670    pub start: Option<i64>,
671    /// Indicates the transport type.
672    #[builder(setter(into, strip_option), default)]
673    #[serde(default, skip_serializing_if = "Option::is_none")]
674    pub transport: Option<Transport>,
675}
676/// Indicates the transport type.
677///
678/// Name of the file before it was encoded as Base64 to be embedded in a resource. This is
679/// the name that will be assigned to the file when the file is decoded.
680///
681/// A non-colonized name as defined by XML Schema Part 2: Datatypes Second Edition.
682/// https://www.w3.org/TR/xmlschema11-2/#NCName.
683///
684/// A textual label that provides a sub-type or characterization of the property's name.
685///
686/// An identifier for relating distinct sets of properties.
687///
688/// A textual label, within a namespace, that uniquely identifies a specific attribute,
689/// characteristic, or quality of the property's containing object.
690///
691/// A reference to a control with a corresponding id value. When referencing an externally
692/// defined control, the Control Identifier Reference must be used in the context of the
693/// external / imported OSCAL instance (e.g., uri-reference).
694///
695/// A human-oriented identifier reference to a role performed.
696///
697/// A human-oriented reference to a parameter within a control, who's catalog has been
698/// imported into the current implementation context.
699///
700/// A human-oriented identifier reference to a control statement.
701///
702/// A reference to a role performed by a party.
703///
704/// The type of action documented by the assembly, such as an approval.
705///
706/// A unique identifier for the role.
707///
708/// Describes the type of relationship provided by the link's hypertext reference. This can
709/// be an indicator of the link's purpose.
710///
711/// Indicates the type of address.
712#[derive(Debug, Clone, Serialize, Deserialize)]
713#[non_exhaustive]
714#[derive(EnumString, Derivative)]
715#[derivative(PartialEq)]
716pub enum Transport {
717    #[serde(rename = "TCP")]
718    Tcp,
719    #[serde(rename = "UDP")]
720    Udp,
721}
722
723/// Loads a component definition from another resource.
724#[derive(Debug, Clone, Serialize, Deserialize)]
725#[derive(Builder, Derivative)]
726#[builder(setter(into, strip_option))]
727#[derivative(PartialEq)]
728#[serde(deny_unknown_fields)]
729pub struct ImportComponentDefinition {
730    /// A link to a resource that defines a set of components and/or capabilities to import into
731    /// this collection.
732    #[serde(
733        serialize_with = "validation::ser_uri_ref",
734        deserialize_with = "validation::deser_uri_ref"
735    )]
736    pub href: String,
737}
738
739/// Provides information about the containing document, and defines concepts that are shared
740/// across the document.
741#[derive(Debug, Clone, Serialize, Deserialize)]
742#[serde(rename_all = "kebab-case")]
743#[derive(Builder, Derivative)]
744#[builder(setter(into, strip_option))]
745#[derivative(PartialEq)]
746#[serde(deny_unknown_fields)]
747pub struct DocumentMetadata {
748    #[builder(setter(into, strip_option), default)]
749    #[serde(default, skip_serializing_if = "Option::is_none")]
750    pub actions: Option<Vec<Action>>,
751    #[builder(setter(into, strip_option), default)]
752    #[serde(default, skip_serializing_if = "Option::is_none")]
753    pub document_ids: Option<Vec<DocumentIdentifier>>,
754    #[serde(
755        serialize_with = "validation::ser_dttz",
756        deserialize_with = "validation::deser_dttz"
757    )]
758    pub last_modified: String,
759    #[builder(setter(into, strip_option), default)]
760    #[serde(default, skip_serializing_if = "Option::is_none")]
761    pub links: Option<Vec<Link>>,
762    #[builder(setter(into, strip_option), default)]
763    #[serde(default, skip_serializing_if = "Option::is_none")]
764    pub locations: Option<Vec<Location>>,
765    pub oscal_version: String,
766    #[builder(setter(into, strip_option), default)]
767    #[serde(default, skip_serializing_if = "Option::is_none")]
768    pub parties: Option<Vec<Party>>,
769    #[builder(setter(into, strip_option), default)]
770    #[serde(default, skip_serializing_if = "Option::is_none")]
771    pub props: Option<Vec<Property>>,
772    #[builder(setter(into, strip_option), default)]
773    #[serde(default, skip_serializing_if = "Option::is_none")]
774    pub published: Option<String>,
775    #[builder(setter(into, strip_option), default)]
776    #[serde(default, skip_serializing_if = "Option::is_none")]
777    #[serde(deserialize_with = "validation::deser_markup_opt")]
778    pub remarks: Option<String>,
779    #[builder(setter(into, strip_option), default)]
780    #[serde(default, skip_serializing_if = "Option::is_none")]
781    pub responsible_parties: Option<Vec<ResponsibleParty>>,
782    #[builder(setter(into, strip_option), default)]
783    #[serde(default, skip_serializing_if = "Option::is_none")]
784    pub revisions: Option<Vec<RevisionHistoryEntry>>,
785    #[builder(setter(into, strip_option), default)]
786    #[serde(default, skip_serializing_if = "Option::is_none")]
787    pub roles: Option<Vec<Role>>,
788    /// A name given to the document, which may be used by a tool for display and navigation.
789    #[serde(deserialize_with = "validation::deser_markup")]
790    pub title: String,
791    pub version: String,
792}
793
794/// An action applied by a role within a given party to the content.
795#[derive(Debug, Clone, Serialize, Deserialize)]
796#[serde(rename_all = "kebab-case")]
797#[derive(Builder, Derivative)]
798#[builder(setter(into, strip_option))]
799#[derivative(PartialEq)]
800#[serde(deny_unknown_fields)]
801pub struct Action {
802    /// The date and time when the action occurred.
803    #[builder(setter(into, strip_option), default)]
804    #[serde(default, skip_serializing_if = "Option::is_none")]
805    #[serde(
806        serialize_with = "validation::ser_dttz_opt",
807        deserialize_with = "validation::deser_dttz_opt"
808    )]
809    pub date: Option<String>,
810    #[builder(setter(into, strip_option), default)]
811    #[serde(default, skip_serializing_if = "Option::is_none")]
812    pub links: Option<Vec<Link>>,
813    #[builder(setter(into, strip_option), default)]
814    #[serde(default, skip_serializing_if = "Option::is_none")]
815    pub props: Option<Vec<Property>>,
816    #[builder(setter(into, strip_option), default)]
817    #[serde(default, skip_serializing_if = "Option::is_none")]
818    #[serde(deserialize_with = "validation::deser_markup_opt")]
819    pub remarks: Option<String>,
820    #[builder(setter(into, strip_option), default)]
821    #[serde(default, skip_serializing_if = "Option::is_none")]
822    pub responsible_parties: Option<Vec<ResponsibleParty>>,
823    /// Specifies the action type system used.
824    pub system: String,
825    /// The type of action documented by the assembly, such as an approval.
826    #[serde(rename = "type")]
827    #[serde(
828        serialize_with = "validation::ser_token",
829        deserialize_with = "validation::deser_token"
830    )]
831    pub action_type: String,
832    /// A unique identifier that can be used to reference this defined action elsewhere in an
833    /// OSCAL document. A UUID should be consistently used for a given location across revisions
834    /// of the document.
835    #[serde(
836        serialize_with = "validation::ser_uuid",
837        deserialize_with = "validation::deser_uuid"
838    )]
839    #[derivative(PartialEq = "ignore")]
840    pub uuid: String,
841}
842
843/// A reference to a set of persons and/or organizations that have responsibility for
844/// performing the referenced role in the context of the containing object.
845#[derive(Debug, Clone, Serialize, Deserialize)]
846#[serde(rename_all = "kebab-case")]
847#[derive(Builder, Derivative)]
848#[builder(setter(into, strip_option))]
849#[derivative(PartialEq)]
850#[serde(deny_unknown_fields)]
851pub struct ResponsibleParty {
852    #[builder(setter(into, strip_option), default)]
853    #[serde(default, skip_serializing_if = "Option::is_none")]
854    pub links: Option<Vec<Link>>,
855    #[serde(
856        serialize_with = "validation::ser_uuid_vec",
857        deserialize_with = "validation::deser_uuid_vec"
858    )]
859    pub party_uuids: Vec<String>,
860    #[builder(setter(into, strip_option), default)]
861    #[serde(default, skip_serializing_if = "Option::is_none")]
862    pub props: Option<Vec<Property>>,
863    #[builder(setter(into, strip_option), default)]
864    #[serde(default, skip_serializing_if = "Option::is_none")]
865    #[serde(deserialize_with = "validation::deser_markup_opt")]
866    pub remarks: Option<String>,
867    /// A reference to a role performed by a party.
868    #[serde(
869        serialize_with = "validation::ser_token",
870        deserialize_with = "validation::deser_token"
871    )]
872    pub role_id: String,
873}
874
875/// A physical point of presence, which may be associated with people, organizations, or
876/// other concepts within the current or linked OSCAL document.
877#[derive(Debug, Clone, Serialize, Deserialize)]
878#[serde(rename_all = "kebab-case")]
879#[derive(Builder, Derivative)]
880#[builder(setter(into, strip_option))]
881#[derivative(PartialEq)]
882#[serde(deny_unknown_fields)]
883pub struct Location {
884    #[builder(setter(into, strip_option), default)]
885    #[serde(default, skip_serializing_if = "Option::is_none")]
886    pub address: Option<Address>,
887    #[builder(setter(into, strip_option), default)]
888    #[serde(default, skip_serializing_if = "Option::is_none")]
889    #[serde(
890        serialize_with = "validation::ser_email_vec_opt",
891        deserialize_with = "validation::deser_email_vec_opt"
892    )]
893    pub email_addresses: Option<Vec<String>>,
894    #[builder(setter(into, strip_option), default)]
895    #[serde(default, skip_serializing_if = "Option::is_none")]
896    pub links: Option<Vec<Link>>,
897    #[builder(setter(into, strip_option), default)]
898    #[serde(default, skip_serializing_if = "Option::is_none")]
899    pub props: Option<Vec<Property>>,
900    #[builder(setter(into, strip_option), default)]
901    #[serde(default, skip_serializing_if = "Option::is_none")]
902    #[serde(deserialize_with = "validation::deser_markup_opt")]
903    pub remarks: Option<String>,
904    #[builder(setter(into, strip_option), default)]
905    #[serde(default, skip_serializing_if = "Option::is_none")]
906    pub telephone_numbers: Option<Vec<TelephoneNumber>>,
907    /// A name given to the location, which may be used by a tool for display and navigation.
908    #[builder(setter(into, strip_option), default)]
909    #[serde(default, skip_serializing_if = "Option::is_none")]
910    #[serde(deserialize_with = "validation::deser_markup_opt")]
911    pub title: Option<String>,
912    #[builder(setter(into, strip_option), default)]
913    #[serde(default, skip_serializing_if = "Option::is_none")]
914    #[serde(
915        serialize_with = "validation::ser_uri_vec_opt",
916        deserialize_with = "validation::deser_uri_vec_opt"
917    )]
918    pub urls: Option<Vec<String>>,
919    /// A unique ID for the location, for reference.
920    #[serde(
921        serialize_with = "validation::ser_uuid",
922        deserialize_with = "validation::deser_uuid"
923    )]
924    #[derivative(PartialEq = "ignore")]
925    pub uuid: String,
926}
927
928/// A postal address for the location.
929#[derive(Debug, Clone, Serialize, Deserialize)]
930#[serde(rename_all = "kebab-case")]
931#[derive(Builder, Derivative)]
932#[builder(setter(into, strip_option))]
933#[derivative(PartialEq)]
934#[serde(deny_unknown_fields)]
935pub struct Address {
936    #[builder(setter(into, strip_option), default)]
937    #[serde(default, skip_serializing_if = "Option::is_none")]
938    pub addr_lines: Option<Vec<String>>,
939    /// City, town or geographical region for the mailing address.
940    #[builder(setter(into, strip_option), default)]
941    #[serde(default, skip_serializing_if = "Option::is_none")]
942    pub city: Option<String>,
943    /// The ISO 3166-1 alpha-2 country code for the mailing address.
944    #[builder(setter(into, strip_option), default)]
945    #[serde(default, skip_serializing_if = "Option::is_none")]
946    pub country: Option<String>,
947    /// Postal or ZIP code for mailing address.
948    #[builder(setter(into, strip_option), default)]
949    #[serde(default, skip_serializing_if = "Option::is_none")]
950    pub postal_code: Option<String>,
951    /// State, province or analogous geographical region for a mailing address.
952    #[builder(setter(into, strip_option), default)]
953    #[serde(default, skip_serializing_if = "Option::is_none")]
954    pub state: Option<String>,
955    /// Indicates the type of address.
956    #[serde(rename = "type")]
957    #[builder(setter(into, strip_option), default)]
958    #[serde(default, skip_serializing_if = "Option::is_none")]
959    #[serde(
960        serialize_with = "validation::ser_token_opt",
961        deserialize_with = "validation::deser_token_opt"
962    )]
963    pub address_type: Option<String>,
964}
965
966/// A telephone service number as defined by ITU-T E.164.
967#[derive(Debug, Clone, Serialize, Deserialize)]
968#[derive(Builder, Derivative)]
969#[builder(setter(into, strip_option))]
970#[derivative(PartialEq)]
971#[serde(deny_unknown_fields)]
972pub struct TelephoneNumber {
973    pub number: String,
974    /// Indicates the type of phone number.
975    #[serde(rename = "type")]
976    #[builder(setter(into, strip_option), default)]
977    #[serde(default, skip_serializing_if = "Option::is_none")]
978    pub telephone_number_type: Option<String>,
979}
980
981/// An organization or person, which may be associated with roles or other concepts within
982/// the current or linked OSCAL document.
983#[derive(Debug, Clone, Serialize, Deserialize)]
984#[serde(rename_all = "kebab-case")]
985#[derive(Builder, Derivative)]
986#[builder(setter(into, strip_option))]
987#[derivative(PartialEq)]
988#[serde(deny_unknown_fields)]
989pub struct Party {
990    #[builder(setter(into, strip_option), default)]
991    #[serde(default, skip_serializing_if = "Option::is_none")]
992    pub addresses: Option<Vec<Address>>,
993    #[builder(setter(into, strip_option), default)]
994    #[serde(default, skip_serializing_if = "Option::is_none")]
995    #[serde(
996        serialize_with = "validation::ser_email_vec_opt",
997        deserialize_with = "validation::deser_email_vec_opt"
998    )]
999    pub email_addresses: Option<Vec<String>>,
1000    #[builder(setter(into, strip_option), default)]
1001    #[serde(default, skip_serializing_if = "Option::is_none")]
1002    pub external_ids: Option<Vec<PartyExternalIdentifier>>,
1003    #[builder(setter(into, strip_option), default)]
1004    #[serde(default, skip_serializing_if = "Option::is_none")]
1005    pub links: Option<Vec<Link>>,
1006    #[builder(setter(into, strip_option), default)]
1007    #[serde(default, skip_serializing_if = "Option::is_none")]
1008    pub location_uuids: Option<Vec<String>>,
1009    #[builder(setter(into, strip_option), default)]
1010    #[serde(default, skip_serializing_if = "Option::is_none")]
1011    #[serde(
1012        serialize_with = "validation::ser_uuid_vec_opt",
1013        deserialize_with = "validation::deser_uuid_vec_opt"
1014    )]
1015    pub member_of_organizations: Option<Vec<String>>,
1016    /// The full name of the party. This is typically the legal name associated with the party.
1017    #[builder(setter(into, strip_option), default)]
1018    #[serde(default, skip_serializing_if = "Option::is_none")]
1019    pub name: Option<String>,
1020    #[builder(setter(into, strip_option), default)]
1021    #[serde(default, skip_serializing_if = "Option::is_none")]
1022    pub props: Option<Vec<Property>>,
1023    #[builder(setter(into, strip_option), default)]
1024    #[serde(default, skip_serializing_if = "Option::is_none")]
1025    #[serde(deserialize_with = "validation::deser_markup_opt")]
1026    pub remarks: Option<String>,
1027    /// A short common name, abbreviation, or acronym for the party.
1028    #[builder(setter(into, strip_option), default)]
1029    #[serde(default, skip_serializing_if = "Option::is_none")]
1030    pub short_name: Option<String>,
1031    #[builder(setter(into, strip_option), default)]
1032    #[serde(default, skip_serializing_if = "Option::is_none")]
1033    pub telephone_numbers: Option<Vec<TelephoneNumber>>,
1034    /// A category describing the kind of party the object describes.
1035    #[serde(rename = "type")]
1036    pub party_type: PartyType,
1037    /// A unique identifier for the party.
1038    #[serde(
1039        serialize_with = "validation::ser_uuid",
1040        deserialize_with = "validation::deser_uuid"
1041    )]
1042    #[derivative(PartialEq = "ignore")]
1043    pub uuid: String,
1044}
1045
1046/// An identifier for a person or organization using a designated scheme. e.g. an Open
1047/// Researcher and Contributor ID (ORCID).
1048#[derive(Debug, Clone, Serialize, Deserialize)]
1049#[derive(Builder, Derivative)]
1050#[builder(setter(into, strip_option))]
1051#[derivative(PartialEq)]
1052#[serde(deny_unknown_fields)]
1053pub struct PartyExternalIdentifier {
1054    pub id: String,
1055    /// Indicates the type of external identifier.
1056    #[serde(
1057        serialize_with = "validation::ser_uri",
1058        deserialize_with = "validation::deser_uri"
1059    )]
1060    pub scheme: String,
1061}
1062/// A category describing the kind of party the object describes.
1063///
1064/// A label that indicates the nature of a resource, as a data serialization or format.
1065///
1066/// A non-empty string with leading and trailing whitespace disallowed. Whitespace is: U+9,
1067/// U+10, U+32 or [
1068/// ]+
1069///
1070/// In case where the href points to a back-matter/resource, this value will indicate the URI
1071/// fragment to append to any rlink associated with the resource. This value MUST be URI
1072/// encoded.
1073///
1074/// Indicates the value of the attribute, characteristic, or quality.
1075///
1076/// A parameter value or set of values.
1077///
1078/// The capability's human-readable name.
1079///
1080/// The common name of the protocol, which should be the appropriate "service name" from the
1081/// IANA Service Name and Transport Protocol Port Number Registry.
1082///
1083/// A single line of an address.
1084///
1085/// City, town or geographical region for the mailing address.
1086///
1087/// The ISO 3166-1 alpha-2 country code for the mailing address.
1088///
1089/// Postal or ZIP code for mailing address.
1090///
1091/// State, province or analogous geographical region for a mailing address.
1092///
1093/// The OSCAL model version the document was authored against and will conform to as valid.
1094///
1095/// The full name of the party. This is typically the legal name associated with the party.
1096///
1097/// A short common name, abbreviation, or acronym for the party.
1098///
1099/// Used to distinguish a specific revision of an OSCAL document from other previous and
1100/// future versions.
1101///
1102/// A short common name, abbreviation, or acronym for the role.
1103///
1104/// The digest method by which a hash is derived.
1105///
1106/// A category describing the purpose of the component.
1107///
1108/// Indicates the type of phone number.
1109#[derive(Debug, Clone, Serialize, Deserialize)]
1110#[serde(rename_all = "snake_case")]
1111#[non_exhaustive]
1112#[derive(EnumString, Derivative)]
1113#[derivative(PartialEq)]
1114pub enum PartyType {
1115    Organization,
1116    Person,
1117}
1118
1119/// An entry in a sequential list of revisions to the containing document, expected to be in
1120/// reverse chronological order (i.e. latest first).
1121#[derive(Debug, Clone, Serialize, Deserialize)]
1122#[serde(rename_all = "kebab-case")]
1123#[derive(Builder, Derivative)]
1124#[builder(setter(into, strip_option))]
1125#[derivative(PartialEq)]
1126#[serde(deny_unknown_fields)]
1127pub struct RevisionHistoryEntry {
1128    #[builder(setter(into, strip_option), default)]
1129    #[serde(default, skip_serializing_if = "Option::is_none")]
1130    #[serde(
1131        serialize_with = "validation::ser_dttz_opt",
1132        deserialize_with = "validation::deser_dttz_opt"
1133    )]
1134    pub last_modified: Option<String>,
1135    #[builder(setter(into, strip_option), default)]
1136    #[serde(default, skip_serializing_if = "Option::is_none")]
1137    pub links: Option<Vec<Link>>,
1138    #[builder(setter(into, strip_option), default)]
1139    #[serde(default, skip_serializing_if = "Option::is_none")]
1140    pub oscal_version: Option<String>,
1141    #[builder(setter(into, strip_option), default)]
1142    #[serde(default, skip_serializing_if = "Option::is_none")]
1143    pub props: Option<Vec<Property>>,
1144    #[builder(setter(into, strip_option), default)]
1145    #[serde(default, skip_serializing_if = "Option::is_none")]
1146    #[serde(
1147        serialize_with = "validation::ser_dttz_opt",
1148        deserialize_with = "validation::deser_dttz_opt"
1149    )]
1150    pub published: Option<String>,
1151    #[builder(setter(into, strip_option), default)]
1152    #[serde(default, skip_serializing_if = "Option::is_none")]
1153    #[serde(deserialize_with = "validation::deser_markup_opt")]
1154    pub remarks: Option<String>,
1155    /// A name given to the document revision, which may be used by a tool for display and
1156    /// navigation.
1157    #[builder(setter(into, strip_option), default)]
1158    #[serde(default, skip_serializing_if = "Option::is_none")]
1159    #[serde(deserialize_with = "validation::deser_markup_opt")]
1160    pub title: Option<String>,
1161    pub version: String,
1162}
1163
1164/// Defines a function, which might be assigned to a party in a specific situation.
1165#[derive(Debug, Clone, Serialize, Deserialize)]
1166#[serde(rename_all = "kebab-case")]
1167#[derive(Builder, Derivative)]
1168#[builder(setter(into, strip_option))]
1169#[derivative(PartialEq)]
1170#[serde(deny_unknown_fields)]
1171pub struct Role {
1172    /// A summary of the role's purpose and associated responsibilities.
1173    #[builder(setter(into, strip_option), default)]
1174    #[serde(default, skip_serializing_if = "Option::is_none")]
1175    #[serde(deserialize_with = "validation::deser_markup_opt")]
1176    pub description: Option<String>,
1177    /// A unique identifier for the role.
1178    #[serde(
1179        serialize_with = "validation::ser_token",
1180        deserialize_with = "validation::deser_token"
1181    )]
1182    pub id: String,
1183    #[builder(setter(into, strip_option), default)]
1184    #[serde(default, skip_serializing_if = "Option::is_none")]
1185    pub links: Option<Vec<Link>>,
1186    #[builder(setter(into, strip_option), default)]
1187    #[serde(default, skip_serializing_if = "Option::is_none")]
1188    pub props: Option<Vec<Property>>,
1189    #[builder(setter(into, strip_option), default)]
1190    #[serde(default, skip_serializing_if = "Option::is_none")]
1191    #[serde(deserialize_with = "validation::deser_markup_opt")]
1192    pub remarks: Option<String>,
1193    /// A short common name, abbreviation, or acronym for the role.
1194    #[builder(setter(into, strip_option), default)]
1195    #[serde(default, skip_serializing_if = "Option::is_none")]
1196    pub short_name: Option<String>,
1197    /// A name given to the role, which may be used by a tool for display and navigation.
1198    pub title: String,
1199}