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