1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// One provenance entry describing the lineage of a registry record.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Provenance {
/// The relationship between the registry record and its provenance source.
pub relation: crate::types::ProvenanceRelation,
/// <p>The identifier of the upstream source that the registry record was detected from.</p>
pub source_id: ::std::string::String,
/// <p>The type of the upstream source that the registry record was detected from.</p>
pub source_type: ::std::option::Option<crate::types::SourceType>,
/// <p>Additional details about the upstream source that the registry record was detected from, such as the AgentCore Gateway or Runtime configuration. The populated member corresponds to the source type.</p>
pub source_details: ::std::option::Option<crate::types::SourceDetails>,
}
impl Provenance {
/// The relationship between the registry record and its provenance source.
pub fn relation(&self) -> &crate::types::ProvenanceRelation {
&self.relation
}
/// <p>The identifier of the upstream source that the registry record was detected from.</p>
pub fn source_id(&self) -> &str {
use std::ops::Deref;
self.source_id.deref()
}
/// <p>The type of the upstream source that the registry record was detected from.</p>
pub fn source_type(&self) -> ::std::option::Option<&crate::types::SourceType> {
self.source_type.as_ref()
}
/// <p>Additional details about the upstream source that the registry record was detected from, such as the AgentCore Gateway or Runtime configuration. The populated member corresponds to the source type.</p>
pub fn source_details(&self) -> ::std::option::Option<&crate::types::SourceDetails> {
self.source_details.as_ref()
}
}
impl Provenance {
/// Creates a new builder-style object to manufacture [`Provenance`](crate::types::Provenance).
pub fn builder() -> crate::types::builders::ProvenanceBuilder {
crate::types::builders::ProvenanceBuilder::default()
}
}
/// A builder for [`Provenance`](crate::types::Provenance).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ProvenanceBuilder {
pub(crate) relation: ::std::option::Option<crate::types::ProvenanceRelation>,
pub(crate) source_id: ::std::option::Option<::std::string::String>,
pub(crate) source_type: ::std::option::Option<crate::types::SourceType>,
pub(crate) source_details: ::std::option::Option<crate::types::SourceDetails>,
}
impl ProvenanceBuilder {
/// The relationship between the registry record and its provenance source.
/// This field is required.
pub fn relation(mut self, input: crate::types::ProvenanceRelation) -> Self {
self.relation = ::std::option::Option::Some(input);
self
}
/// The relationship between the registry record and its provenance source.
pub fn set_relation(mut self, input: ::std::option::Option<crate::types::ProvenanceRelation>) -> Self {
self.relation = input;
self
}
/// The relationship between the registry record and its provenance source.
pub fn get_relation(&self) -> &::std::option::Option<crate::types::ProvenanceRelation> {
&self.relation
}
/// <p>The identifier of the upstream source that the registry record was detected from.</p>
/// This field is required.
pub fn source_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.source_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The identifier of the upstream source that the registry record was detected from.</p>
pub fn set_source_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.source_id = input;
self
}
/// <p>The identifier of the upstream source that the registry record was detected from.</p>
pub fn get_source_id(&self) -> &::std::option::Option<::std::string::String> {
&self.source_id
}
/// <p>The type of the upstream source that the registry record was detected from.</p>
pub fn source_type(mut self, input: crate::types::SourceType) -> Self {
self.source_type = ::std::option::Option::Some(input);
self
}
/// <p>The type of the upstream source that the registry record was detected from.</p>
pub fn set_source_type(mut self, input: ::std::option::Option<crate::types::SourceType>) -> Self {
self.source_type = input;
self
}
/// <p>The type of the upstream source that the registry record was detected from.</p>
pub fn get_source_type(&self) -> &::std::option::Option<crate::types::SourceType> {
&self.source_type
}
/// <p>Additional details about the upstream source that the registry record was detected from, such as the AgentCore Gateway or Runtime configuration. The populated member corresponds to the source type.</p>
pub fn source_details(mut self, input: crate::types::SourceDetails) -> Self {
self.source_details = ::std::option::Option::Some(input);
self
}
/// <p>Additional details about the upstream source that the registry record was detected from, such as the AgentCore Gateway or Runtime configuration. The populated member corresponds to the source type.</p>
pub fn set_source_details(mut self, input: ::std::option::Option<crate::types::SourceDetails>) -> Self {
self.source_details = input;
self
}
/// <p>Additional details about the upstream source that the registry record was detected from, such as the AgentCore Gateway or Runtime configuration. The populated member corresponds to the source type.</p>
pub fn get_source_details(&self) -> &::std::option::Option<crate::types::SourceDetails> {
&self.source_details
}
/// Consumes the builder and constructs a [`Provenance`](crate::types::Provenance).
/// This method will fail if any of the following fields are not set:
/// - [`relation`](crate::types::builders::ProvenanceBuilder::relation)
/// - [`source_id`](crate::types::builders::ProvenanceBuilder::source_id)
pub fn build(self) -> ::std::result::Result<crate::types::Provenance, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Provenance {
relation: self.relation.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"relation",
"relation was not specified but it is required when building Provenance",
)
})?,
source_id: self.source_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"source_id",
"source_id was not specified but it is required when building Provenance",
)
})?,
source_type: self.source_type,
source_details: self.source_details,
})
}
}