Skip to main content

aws_sdk_securityagent/operation/get_artifact/
_get_artifact_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetArtifactOutput {
6    /// <p>The unique identifier of the agent space that contains the artifact.</p>
7    pub agent_space_id: ::std::string::String,
8    /// <p>The unique identifier of the artifact.</p>
9    pub artifact_id: ::std::string::String,
10    /// <p>The artifact content and type.</p>
11    pub artifact: ::std::option::Option<crate::types::Artifact>,
12    /// <p>The file name of the artifact.</p>
13    pub file_name: ::std::string::String,
14    /// <p>The date and time the artifact was last updated, in UTC format.</p>
15    pub updated_at: ::aws_smithy_types::DateTime,
16    _request_id: Option<String>,
17}
18impl GetArtifactOutput {
19    /// <p>The unique identifier of the agent space that contains the artifact.</p>
20    pub fn agent_space_id(&self) -> &str {
21        use std::ops::Deref;
22        self.agent_space_id.deref()
23    }
24    /// <p>The unique identifier of the artifact.</p>
25    pub fn artifact_id(&self) -> &str {
26        use std::ops::Deref;
27        self.artifact_id.deref()
28    }
29    /// <p>The artifact content and type.</p>
30    pub fn artifact(&self) -> ::std::option::Option<&crate::types::Artifact> {
31        self.artifact.as_ref()
32    }
33    /// <p>The file name of the artifact.</p>
34    pub fn file_name(&self) -> &str {
35        use std::ops::Deref;
36        self.file_name.deref()
37    }
38    /// <p>The date and time the artifact was last updated, in UTC format.</p>
39    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    /// Creates a new builder-style object to manufacture [`GetArtifactOutput`](crate::operation::get_artifact::GetArtifactOutput).
50    pub fn builder() -> crate::operation::get_artifact::builders::GetArtifactOutputBuilder {
51        crate::operation::get_artifact::builders::GetArtifactOutputBuilder::default()
52    }
53}
54
55/// A builder for [`GetArtifactOutput`](crate::operation::get_artifact::GetArtifactOutput).
56#[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    /// <p>The unique identifier of the agent space that contains the artifact.</p>
68    /// This field is required.
69    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    /// <p>The unique identifier of the agent space that contains the artifact.</p>
74    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    /// <p>The unique identifier of the agent space that contains the artifact.</p>
79    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
80        &self.agent_space_id
81    }
82    /// <p>The unique identifier of the artifact.</p>
83    /// This field is required.
84    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    /// <p>The unique identifier of the artifact.</p>
89    pub fn set_artifact_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90        self.artifact_id = input;
91        self
92    }
93    /// <p>The unique identifier of the artifact.</p>
94    pub fn get_artifact_id(&self) -> &::std::option::Option<::std::string::String> {
95        &self.artifact_id
96    }
97    /// <p>The artifact content and type.</p>
98    /// This field is required.
99    pub fn artifact(mut self, input: crate::types::Artifact) -> Self {
100        self.artifact = ::std::option::Option::Some(input);
101        self
102    }
103    /// <p>The artifact content and type.</p>
104    pub fn set_artifact(mut self, input: ::std::option::Option<crate::types::Artifact>) -> Self {
105        self.artifact = input;
106        self
107    }
108    /// <p>The artifact content and type.</p>
109    pub fn get_artifact(&self) -> &::std::option::Option<crate::types::Artifact> {
110        &self.artifact
111    }
112    /// <p>The file name of the artifact.</p>
113    /// This field is required.
114    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    /// <p>The file name of the artifact.</p>
119    pub fn set_file_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.file_name = input;
121        self
122    }
123    /// <p>The file name of the artifact.</p>
124    pub fn get_file_name(&self) -> &::std::option::Option<::std::string::String> {
125        &self.file_name
126    }
127    /// <p>The date and time the artifact was last updated, in UTC format.</p>
128    /// This field is required.
129    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    /// <p>The date and time the artifact was last updated, in UTC format.</p>
134    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    /// <p>The date and time the artifact was last updated, in UTC format.</p>
139    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    /// Consumes the builder and constructs a [`GetArtifactOutput`](crate::operation::get_artifact::GetArtifactOutput).
152    /// This method will fail if any of the following fields are not set:
153    /// - [`agent_space_id`](crate::operation::get_artifact::builders::GetArtifactOutputBuilder::agent_space_id)
154    /// - [`artifact_id`](crate::operation::get_artifact::builders::GetArtifactOutputBuilder::artifact_id)
155    /// - [`file_name`](crate::operation::get_artifact::builders::GetArtifactOutputBuilder::file_name)
156    /// - [`updated_at`](crate::operation::get_artifact::builders::GetArtifactOutputBuilder::updated_at)
157    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}