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 CreateImageInput {
6/// <p>The description of the image.</p>
7pub description: ::std::option::Option<::std::string::String>,
8/// <p>The display name of the image. If not provided, <code>ImageName</code> is displayed.</p>
9pub display_name: ::std::option::Option<::std::string::String>,
10/// <p>The name of the image. Must be unique to your account.</p>
11pub image_name: ::std::option::Option<::std::string::String>,
12/// <p>The ARN of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf.</p>
13pub role_arn: ::std::option::Option<::std::string::String>,
14/// <p>A list of tags to apply to the image.</p>
15pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
16}
17impl CreateImageInput {
18/// <p>The description of the image.</p>
19pub fn description(&self) -> ::std::option::Option<&str> {
20self.description.as_deref()
21 }
22/// <p>The display name of the image. If not provided, <code>ImageName</code> is displayed.</p>
23pub fn display_name(&self) -> ::std::option::Option<&str> {
24self.display_name.as_deref()
25 }
26/// <p>The name of the image. Must be unique to your account.</p>
27pub fn image_name(&self) -> ::std::option::Option<&str> {
28self.image_name.as_deref()
29 }
30/// <p>The ARN of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf.</p>
31pub fn role_arn(&self) -> ::std::option::Option<&str> {
32self.role_arn.as_deref()
33 }
34/// <p>A list of tags to apply to the image.</p>
35 ///
36 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
37pub fn tags(&self) -> &[crate::types::Tag] {
38self.tags.as_deref().unwrap_or_default()
39 }
40}
41impl CreateImageInput {
42/// Creates a new builder-style object to manufacture [`CreateImageInput`](crate::operation::create_image::CreateImageInput).
43pub fn builder() -> crate::operation::create_image::builders::CreateImageInputBuilder {
44crate::operation::create_image::builders::CreateImageInputBuilder::default()
45 }
46}
4748/// A builder for [`CreateImageInput`](crate::operation::create_image::CreateImageInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct CreateImageInputBuilder {
52pub(crate) description: ::std::option::Option<::std::string::String>,
53pub(crate) display_name: ::std::option::Option<::std::string::String>,
54pub(crate) image_name: ::std::option::Option<::std::string::String>,
55pub(crate) role_arn: ::std::option::Option<::std::string::String>,
56pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
57}
58impl CreateImageInputBuilder {
59/// <p>The description of the image.</p>
60pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61self.description = ::std::option::Option::Some(input.into());
62self
63}
64/// <p>The description of the image.</p>
65pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66self.description = input;
67self
68}
69/// <p>The description of the image.</p>
70pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
71&self.description
72 }
73/// <p>The display name of the image. If not provided, <code>ImageName</code> is displayed.</p>
74pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75self.display_name = ::std::option::Option::Some(input.into());
76self
77}
78/// <p>The display name of the image. If not provided, <code>ImageName</code> is displayed.</p>
79pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80self.display_name = input;
81self
82}
83/// <p>The display name of the image. If not provided, <code>ImageName</code> is displayed.</p>
84pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
85&self.display_name
86 }
87/// <p>The name of the image. Must be unique to your account.</p>
88 /// This field is required.
89pub fn image_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90self.image_name = ::std::option::Option::Some(input.into());
91self
92}
93/// <p>The name of the image. Must be unique to your account.</p>
94pub fn set_image_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95self.image_name = input;
96self
97}
98/// <p>The name of the image. Must be unique to your account.</p>
99pub fn get_image_name(&self) -> &::std::option::Option<::std::string::String> {
100&self.image_name
101 }
102/// <p>The ARN of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf.</p>
103 /// This field is required.
104pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105self.role_arn = ::std::option::Option::Some(input.into());
106self
107}
108/// <p>The ARN of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf.</p>
109pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110self.role_arn = input;
111self
112}
113/// <p>The ARN of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf.</p>
114pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
115&self.role_arn
116 }
117/// Appends an item to `tags`.
118 ///
119 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
120 ///
121 /// <p>A list of tags to apply to the image.</p>
122pub fn tags(mut self, input: crate::types::Tag) -> Self {
123let mut v = self.tags.unwrap_or_default();
124 v.push(input);
125self.tags = ::std::option::Option::Some(v);
126self
127}
128/// <p>A list of tags to apply to the image.</p>
129pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
130self.tags = input;
131self
132}
133/// <p>A list of tags to apply to the image.</p>
134pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
135&self.tags
136 }
137/// Consumes the builder and constructs a [`CreateImageInput`](crate::operation::create_image::CreateImageInput).
138pub fn build(self) -> ::std::result::Result<crate::operation::create_image::CreateImageInput, ::aws_smithy_types::error::operation::BuildError> {
139 ::std::result::Result::Ok(crate::operation::create_image::CreateImageInput {
140 description: self.description,
141 display_name: self.display_name,
142 image_name: self.image_name,
143 role_arn: self.role_arn,
144 tags: self.tags,
145 })
146 }
147}