aws_sdk_sagemaker/operation/create_image/
_create_image_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 CreateImageInput {
6    /// <p>The description of the image.</p>
7    pub description: ::std::option::Option<::std::string::String>,
8    /// <p>The display name of the image. If not provided, <code>ImageName</code> is displayed.</p>
9    pub display_name: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the image. Must be unique to your account.</p>
11    pub 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>
13    pub role_arn: ::std::option::Option<::std::string::String>,
14    /// <p>A list of tags to apply to the image.</p>
15    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
16}
17impl CreateImageInput {
18    /// <p>The description of the image.</p>
19    pub fn description(&self) -> ::std::option::Option<&str> {
20        self.description.as_deref()
21    }
22    /// <p>The display name of the image. If not provided, <code>ImageName</code> is displayed.</p>
23    pub fn display_name(&self) -> ::std::option::Option<&str> {
24        self.display_name.as_deref()
25    }
26    /// <p>The name of the image. Must be unique to your account.</p>
27    pub fn image_name(&self) -> ::std::option::Option<&str> {
28        self.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>
31    pub fn role_arn(&self) -> ::std::option::Option<&str> {
32        self.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()`.
37    pub fn tags(&self) -> &[crate::types::Tag] {
38        self.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).
43    pub fn builder() -> crate::operation::create_image::builders::CreateImageInputBuilder {
44        crate::operation::create_image::builders::CreateImageInputBuilder::default()
45    }
46}
47
48/// 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 {
52    pub(crate) description: ::std::option::Option<::std::string::String>,
53    pub(crate) display_name: ::std::option::Option<::std::string::String>,
54    pub(crate) image_name: ::std::option::Option<::std::string::String>,
55    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
56    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
57}
58impl CreateImageInputBuilder {
59    /// <p>The description of the image.</p>
60    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.description = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>The description of the image.</p>
65    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.description = input;
67        self
68    }
69    /// <p>The description of the image.</p>
70    pub 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>
74    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.display_name = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>The display name of the image. If not provided, <code>ImageName</code> is displayed.</p>
79    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.display_name = input;
81        self
82    }
83    /// <p>The display name of the image. If not provided, <code>ImageName</code> is displayed.</p>
84    pub 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.
89    pub fn image_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90        self.image_name = ::std::option::Option::Some(input.into());
91        self
92    }
93    /// <p>The name of the image. Must be unique to your account.</p>
94    pub fn set_image_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95        self.image_name = input;
96        self
97    }
98    /// <p>The name of the image. Must be unique to your account.</p>
99    pub 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.
104    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.role_arn = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// <p>The ARN of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf.</p>
109    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.role_arn = input;
111        self
112    }
113    /// <p>The ARN of an IAM role that enables Amazon SageMaker AI to perform tasks on your behalf.</p>
114    pub 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>
122    pub fn tags(mut self, input: crate::types::Tag) -> Self {
123        let mut v = self.tags.unwrap_or_default();
124        v.push(input);
125        self.tags = ::std::option::Option::Some(v);
126        self
127    }
128    /// <p>A list of tags to apply to the image.</p>
129    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
130        self.tags = input;
131        self
132    }
133    /// <p>A list of tags to apply to the image.</p>
134    pub 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).
138    pub 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}