aws_sdk_securityagent/operation/get_artifact/
_get_artifact_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetArtifactOutput {
6 pub agent_space_id: ::std::string::String,
8 pub artifact_id: ::std::string::String,
10 pub artifact: ::std::option::Option<crate::types::Artifact>,
12 pub file_name: ::std::string::String,
14 pub updated_at: ::aws_smithy_types::DateTime,
16 _request_id: Option<String>,
17}
18impl GetArtifactOutput {
19 pub fn agent_space_id(&self) -> &str {
21 use std::ops::Deref;
22 self.agent_space_id.deref()
23 }
24 pub fn artifact_id(&self) -> &str {
26 use std::ops::Deref;
27 self.artifact_id.deref()
28 }
29 pub fn artifact(&self) -> ::std::option::Option<&crate::types::Artifact> {
31 self.artifact.as_ref()
32 }
33 pub fn file_name(&self) -> &str {
35 use std::ops::Deref;
36 self.file_name.deref()
37 }
38 pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
40 &self.updated_at
41 }
42}
43impl ::aws_types::request_id::RequestId for GetArtifactOutput {
44 fn request_id(&self) -> Option<&str> {
45 self._request_id.as_deref()
46 }
47}
48impl GetArtifactOutput {
49 pub fn builder() -> crate::operation::get_artifact::builders::GetArtifactOutputBuilder {
51 crate::operation::get_artifact::builders::GetArtifactOutputBuilder::default()
52 }
53}
54
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
57#[non_exhaustive]
58pub struct GetArtifactOutputBuilder {
59 pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
60 pub(crate) artifact_id: ::std::option::Option<::std::string::String>,
61 pub(crate) artifact: ::std::option::Option<crate::types::Artifact>,
62 pub(crate) file_name: ::std::option::Option<::std::string::String>,
63 pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
64 _request_id: Option<String>,
65}
66impl GetArtifactOutputBuilder {
67 pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70 self.agent_space_id = ::std::option::Option::Some(input.into());
71 self
72 }
73 pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75 self.agent_space_id = input;
76 self
77 }
78 pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
80 &self.agent_space_id
81 }
82 pub fn artifact_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
85 self.artifact_id = ::std::option::Option::Some(input.into());
86 self
87 }
88 pub fn set_artifact_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90 self.artifact_id = input;
91 self
92 }
93 pub fn get_artifact_id(&self) -> &::std::option::Option<::std::string::String> {
95 &self.artifact_id
96 }
97 pub fn artifact(mut self, input: crate::types::Artifact) -> Self {
100 self.artifact = ::std::option::Option::Some(input);
101 self
102 }
103 pub fn set_artifact(mut self, input: ::std::option::Option<crate::types::Artifact>) -> Self {
105 self.artifact = input;
106 self
107 }
108 pub fn get_artifact(&self) -> &::std::option::Option<crate::types::Artifact> {
110 &self.artifact
111 }
112 pub fn file_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.file_name = ::std::option::Option::Some(input.into());
116 self
117 }
118 pub fn set_file_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.file_name = input;
121 self
122 }
123 pub fn get_file_name(&self) -> &::std::option::Option<::std::string::String> {
125 &self.file_name
126 }
127 pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
130 self.updated_at = ::std::option::Option::Some(input);
131 self
132 }
133 pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
135 self.updated_at = input;
136 self
137 }
138 pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
140 &self.updated_at
141 }
142 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
143 self._request_id = Some(request_id.into());
144 self
145 }
146
147 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
148 self._request_id = request_id;
149 self
150 }
151 pub fn build(self) -> ::std::result::Result<crate::operation::get_artifact::GetArtifactOutput, ::aws_smithy_types::error::operation::BuildError> {
158 ::std::result::Result::Ok(crate::operation::get_artifact::GetArtifactOutput {
159 agent_space_id: self.agent_space_id.ok_or_else(|| {
160 ::aws_smithy_types::error::operation::BuildError::missing_field(
161 "agent_space_id",
162 "agent_space_id was not specified but it is required when building GetArtifactOutput",
163 )
164 })?,
165 artifact_id: self.artifact_id.ok_or_else(|| {
166 ::aws_smithy_types::error::operation::BuildError::missing_field(
167 "artifact_id",
168 "artifact_id was not specified but it is required when building GetArtifactOutput",
169 )
170 })?,
171 artifact: self.artifact,
172 file_name: self.file_name.ok_or_else(|| {
173 ::aws_smithy_types::error::operation::BuildError::missing_field(
174 "file_name",
175 "file_name was not specified but it is required when building GetArtifactOutput",
176 )
177 })?,
178 updated_at: self.updated_at.ok_or_else(|| {
179 ::aws_smithy_types::error::operation::BuildError::missing_field(
180 "updated_at",
181 "updated_at was not specified but it is required when building GetArtifactOutput",
182 )
183 })?,
184 _request_id: self._request_id,
185 })
186 }
187}