1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The created ontology's identity, and any derivation warnings. GetOntology returns the version's details, and ListOntologies (<code>OntologySummary</code>) returns its node and edge type counts.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateOntologyOutput {
/// <p>The ID of the ontology, assigned by AWS Context.</p>
pub id: ::std::string::String,
/// <p>The ARN of the created ontology.</p>
pub arn: ::std::string::String,
/// <p>When the ontology last changed. On create, the creation time. On a replay, the current value.</p>
pub updated_at: ::aws_smithy_types::DateTime,
/// <p>The display name as stored. On a replay, the current one.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>The description as stored. Absent when there is none. On a replay, the current one.</p>
pub description: ::std::option::Option<::std::string::String>,
/// <p>The initial version that CreateOntology created, in MAJOR.MINOR.PATCH form, for example <code>1.0.0</code>.</p>
pub version: ::std::option::Option<::std::string::String>,
/// <p>Non-fatal warnings from the derivation, such as <code>SYNTHESIZED_NODE_ID</code> or a widened datatype. AWS Context also stores them on the version, and GetOntology returns them in <code>validationIssues</code>. Absent or empty if the derivation produced no warnings.</p>
pub validation_issues: ::std::option::Option<::std::vec::Vec<crate::types::OntologyValidationIssue>>,
_request_id: Option<String>,
}
impl CreateOntologyOutput {
/// <p>The ID of the ontology, assigned by AWS Context.</p>
pub fn id(&self) -> &str {
use std::ops::Deref;
self.id.deref()
}
/// <p>The ARN of the created ontology.</p>
pub fn arn(&self) -> &str {
use std::ops::Deref;
self.arn.deref()
}
/// <p>When the ontology last changed. On create, the creation time. On a replay, the current value.</p>
pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
&self.updated_at
}
/// <p>The display name as stored. On a replay, the current one.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The description as stored. Absent when there is none. On a replay, the current one.</p>
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
/// <p>The initial version that CreateOntology created, in MAJOR.MINOR.PATCH form, for example <code>1.0.0</code>.</p>
pub fn version(&self) -> ::std::option::Option<&str> {
self.version.as_deref()
}
/// <p>Non-fatal warnings from the derivation, such as <code>SYNTHESIZED_NODE_ID</code> or a widened datatype. AWS Context also stores them on the version, and GetOntology returns them in <code>validationIssues</code>. Absent or empty if the derivation produced no warnings.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.validation_issues.is_none()`.
pub fn validation_issues(&self) -> &[crate::types::OntologyValidationIssue] {
self.validation_issues.as_deref().unwrap_or_default()
}
}
impl ::aws_types::request_id::RequestId for CreateOntologyOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl CreateOntologyOutput {
/// Creates a new builder-style object to manufacture [`CreateOntologyOutput`](crate::operation::create_ontology::CreateOntologyOutput).
pub fn builder() -> crate::operation::create_ontology::builders::CreateOntologyOutputBuilder {
crate::operation::create_ontology::builders::CreateOntologyOutputBuilder::default()
}
}
/// A builder for [`CreateOntologyOutput`](crate::operation::create_ontology::CreateOntologyOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateOntologyOutputBuilder {
pub(crate) id: ::std::option::Option<::std::string::String>,
pub(crate) arn: ::std::option::Option<::std::string::String>,
pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) version: ::std::option::Option<::std::string::String>,
pub(crate) validation_issues: ::std::option::Option<::std::vec::Vec<crate::types::OntologyValidationIssue>>,
_request_id: Option<String>,
}
impl CreateOntologyOutputBuilder {
/// <p>The ID of the ontology, assigned by AWS Context.</p>
/// This field is required.
pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the ontology, assigned by AWS Context.</p>
pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.id = input;
self
}
/// <p>The ID of the ontology, assigned by AWS Context.</p>
pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
&self.id
}
/// <p>The ARN of the created ontology.</p>
/// This field is required.
pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The ARN of the created ontology.</p>
pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.arn = input;
self
}
/// <p>The ARN of the created ontology.</p>
pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.arn
}
/// <p>When the ontology last changed. On create, the creation time. On a replay, the current value.</p>
/// This field is required.
pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.updated_at = ::std::option::Option::Some(input);
self
}
/// <p>When the ontology last changed. On create, the creation time. On a replay, the current value.</p>
pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.updated_at = input;
self
}
/// <p>When the ontology last changed. On create, the creation time. On a replay, the current value.</p>
pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.updated_at
}
/// <p>The display name as stored. On a replay, the current one.</p>
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The display name as stored. On a replay, the current one.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The display name as stored. On a replay, the current one.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>The description as stored. Absent when there is none. On a replay, the current one.</p>
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
/// <p>The description as stored. Absent when there is none. On a replay, the current one.</p>
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
/// <p>The description as stored. Absent when there is none. On a replay, the current one.</p>
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
/// <p>The initial version that CreateOntology created, in MAJOR.MINOR.PATCH form, for example <code>1.0.0</code>.</p>
pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.version = ::std::option::Option::Some(input.into());
self
}
/// <p>The initial version that CreateOntology created, in MAJOR.MINOR.PATCH form, for example <code>1.0.0</code>.</p>
pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.version = input;
self
}
/// <p>The initial version that CreateOntology created, in MAJOR.MINOR.PATCH form, for example <code>1.0.0</code>.</p>
pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
&self.version
}
/// Appends an item to `validation_issues`.
///
/// To override the contents of this collection use [`set_validation_issues`](Self::set_validation_issues).
///
/// <p>Non-fatal warnings from the derivation, such as <code>SYNTHESIZED_NODE_ID</code> or a widened datatype. AWS Context also stores them on the version, and GetOntology returns them in <code>validationIssues</code>. Absent or empty if the derivation produced no warnings.</p>
pub fn validation_issues(mut self, input: crate::types::OntologyValidationIssue) -> Self {
let mut v = self.validation_issues.unwrap_or_default();
v.push(input);
self.validation_issues = ::std::option::Option::Some(v);
self
}
/// <p>Non-fatal warnings from the derivation, such as <code>SYNTHESIZED_NODE_ID</code> or a widened datatype. AWS Context also stores them on the version, and GetOntology returns them in <code>validationIssues</code>. Absent or empty if the derivation produced no warnings.</p>
pub fn set_validation_issues(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OntologyValidationIssue>>) -> Self {
self.validation_issues = input;
self
}
/// <p>Non-fatal warnings from the derivation, such as <code>SYNTHESIZED_NODE_ID</code> or a widened datatype. AWS Context also stores them on the version, and GetOntology returns them in <code>validationIssues</code>. Absent or empty if the derivation produced no warnings.</p>
pub fn get_validation_issues(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OntologyValidationIssue>> {
&self.validation_issues
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`CreateOntologyOutput`](crate::operation::create_ontology::CreateOntologyOutput).
/// This method will fail if any of the following fields are not set:
/// - [`id`](crate::operation::create_ontology::builders::CreateOntologyOutputBuilder::id)
/// - [`arn`](crate::operation::create_ontology::builders::CreateOntologyOutputBuilder::arn)
/// - [`updated_at`](crate::operation::create_ontology::builders::CreateOntologyOutputBuilder::updated_at)
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_ontology::CreateOntologyOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_ontology::CreateOntologyOutput {
id: self.id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"id",
"id was not specified but it is required when building CreateOntologyOutput",
)
})?,
arn: self.arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"arn",
"arn was not specified but it is required when building CreateOntologyOutput",
)
})?,
updated_at: self.updated_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"updated_at",
"updated_at was not specified but it is required when building CreateOntologyOutput",
)
})?,
name: self.name,
description: self.description,
version: self.version,
validation_issues: self.validation_issues,
_request_id: self._request_id,
})
}
}