Skip to main content

aws_sdk_securityagent/operation/add_artifact/
_add_artifact_input.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 AddArtifactInput {
6    /// Unique identifier of the agent space
7    pub agent_space_id: ::std::option::Option<::std::string::String>,
8    /// Binary content of the artifact
9    pub artifact_content: ::std::option::Option<::aws_smithy_types::Blob>,
10    /// Type of the artifact file
11    pub artifact_type: ::std::option::Option<crate::types::ArtifactType>,
12    /// Name of the artifact file
13    pub file_name: ::std::option::Option<::std::string::String>,
14}
15impl AddArtifactInput {
16    /// Unique identifier of the agent space
17    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
18        self.agent_space_id.as_deref()
19    }
20    /// Binary content of the artifact
21    pub fn artifact_content(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
22        self.artifact_content.as_ref()
23    }
24    /// Type of the artifact file
25    pub fn artifact_type(&self) -> ::std::option::Option<&crate::types::ArtifactType> {
26        self.artifact_type.as_ref()
27    }
28    /// Name of the artifact file
29    pub fn file_name(&self) -> ::std::option::Option<&str> {
30        self.file_name.as_deref()
31    }
32}
33impl AddArtifactInput {
34    /// Creates a new builder-style object to manufacture [`AddArtifactInput`](crate::operation::add_artifact::AddArtifactInput).
35    pub fn builder() -> crate::operation::add_artifact::builders::AddArtifactInputBuilder {
36        crate::operation::add_artifact::builders::AddArtifactInputBuilder::default()
37    }
38}
39
40/// A builder for [`AddArtifactInput`](crate::operation::add_artifact::AddArtifactInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct AddArtifactInputBuilder {
44    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
45    pub(crate) artifact_content: ::std::option::Option<::aws_smithy_types::Blob>,
46    pub(crate) artifact_type: ::std::option::Option<crate::types::ArtifactType>,
47    pub(crate) file_name: ::std::option::Option<::std::string::String>,
48}
49impl AddArtifactInputBuilder {
50    /// Unique identifier of the agent space
51    /// This field is required.
52    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.agent_space_id = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// Unique identifier of the agent space
57    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.agent_space_id = input;
59        self
60    }
61    /// Unique identifier of the agent space
62    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
63        &self.agent_space_id
64    }
65    /// Binary content of the artifact
66    /// This field is required.
67    pub fn artifact_content(mut self, input: ::aws_smithy_types::Blob) -> Self {
68        self.artifact_content = ::std::option::Option::Some(input);
69        self
70    }
71    /// Binary content of the artifact
72    pub fn set_artifact_content(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
73        self.artifact_content = input;
74        self
75    }
76    /// Binary content of the artifact
77    pub fn get_artifact_content(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
78        &self.artifact_content
79    }
80    /// Type of the artifact file
81    /// This field is required.
82    pub fn artifact_type(mut self, input: crate::types::ArtifactType) -> Self {
83        self.artifact_type = ::std::option::Option::Some(input);
84        self
85    }
86    /// Type of the artifact file
87    pub fn set_artifact_type(mut self, input: ::std::option::Option<crate::types::ArtifactType>) -> Self {
88        self.artifact_type = input;
89        self
90    }
91    /// Type of the artifact file
92    pub fn get_artifact_type(&self) -> &::std::option::Option<crate::types::ArtifactType> {
93        &self.artifact_type
94    }
95    /// Name of the artifact file
96    /// This field is required.
97    pub fn file_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98        self.file_name = ::std::option::Option::Some(input.into());
99        self
100    }
101    /// Name of the artifact file
102    pub fn set_file_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103        self.file_name = input;
104        self
105    }
106    /// Name of the artifact file
107    pub fn get_file_name(&self) -> &::std::option::Option<::std::string::String> {
108        &self.file_name
109    }
110    /// Consumes the builder and constructs a [`AddArtifactInput`](crate::operation::add_artifact::AddArtifactInput).
111    pub fn build(self) -> ::std::result::Result<crate::operation::add_artifact::AddArtifactInput, ::aws_smithy_types::error::operation::BuildError> {
112        ::std::result::Result::Ok(crate::operation::add_artifact::AddArtifactInput {
113            agent_space_id: self.agent_space_id,
114            artifact_content: self.artifact_content,
115            artifact_type: self.artifact_type,
116            file_name: self.file_name,
117        })
118    }
119}