aws_sdk_imagebuilder/operation/distribute_image/
_distribute_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 DistributeImageInput {
6    /// <p>The source image Amazon Resource Name (ARN) to distribute.</p>
7    pub source_image: ::std::option::Option<::std::string::String>,
8    /// <p>The Amazon Resource Name (ARN) of the distribution configuration to use.</p>
9    pub distribution_configuration_arn: ::std::option::Option<::std::string::String>,
10    /// <p>The IAM role to use for the distribution.</p>
11    pub execution_role: ::std::option::Option<::std::string::String>,
12    /// <p>The tags to apply to the distributed image.</p>
13    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14    /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the <i>Amazon EC2 API Reference</i>.</p>
15    pub client_token: ::std::option::Option<::std::string::String>,
16    /// <p>The logging configuration for the distribution.</p>
17    pub logging_configuration: ::std::option::Option<crate::types::ImageLoggingConfiguration>,
18}
19impl DistributeImageInput {
20    /// <p>The source image Amazon Resource Name (ARN) to distribute.</p>
21    pub fn source_image(&self) -> ::std::option::Option<&str> {
22        self.source_image.as_deref()
23    }
24    /// <p>The Amazon Resource Name (ARN) of the distribution configuration to use.</p>
25    pub fn distribution_configuration_arn(&self) -> ::std::option::Option<&str> {
26        self.distribution_configuration_arn.as_deref()
27    }
28    /// <p>The IAM role to use for the distribution.</p>
29    pub fn execution_role(&self) -> ::std::option::Option<&str> {
30        self.execution_role.as_deref()
31    }
32    /// <p>The tags to apply to the distributed image.</p>
33    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
34        self.tags.as_ref()
35    }
36    /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the <i>Amazon EC2 API Reference</i>.</p>
37    pub fn client_token(&self) -> ::std::option::Option<&str> {
38        self.client_token.as_deref()
39    }
40    /// <p>The logging configuration for the distribution.</p>
41    pub fn logging_configuration(&self) -> ::std::option::Option<&crate::types::ImageLoggingConfiguration> {
42        self.logging_configuration.as_ref()
43    }
44}
45impl DistributeImageInput {
46    /// Creates a new builder-style object to manufacture [`DistributeImageInput`](crate::operation::distribute_image::DistributeImageInput).
47    pub fn builder() -> crate::operation::distribute_image::builders::DistributeImageInputBuilder {
48        crate::operation::distribute_image::builders::DistributeImageInputBuilder::default()
49    }
50}
51
52/// A builder for [`DistributeImageInput`](crate::operation::distribute_image::DistributeImageInput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct DistributeImageInputBuilder {
56    pub(crate) source_image: ::std::option::Option<::std::string::String>,
57    pub(crate) distribution_configuration_arn: ::std::option::Option<::std::string::String>,
58    pub(crate) execution_role: ::std::option::Option<::std::string::String>,
59    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
60    pub(crate) client_token: ::std::option::Option<::std::string::String>,
61    pub(crate) logging_configuration: ::std::option::Option<crate::types::ImageLoggingConfiguration>,
62}
63impl DistributeImageInputBuilder {
64    /// <p>The source image Amazon Resource Name (ARN) to distribute.</p>
65    /// This field is required.
66    pub fn source_image(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.source_image = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The source image Amazon Resource Name (ARN) to distribute.</p>
71    pub fn set_source_image(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.source_image = input;
73        self
74    }
75    /// <p>The source image Amazon Resource Name (ARN) to distribute.</p>
76    pub fn get_source_image(&self) -> &::std::option::Option<::std::string::String> {
77        &self.source_image
78    }
79    /// <p>The Amazon Resource Name (ARN) of the distribution configuration to use.</p>
80    /// This field is required.
81    pub fn distribution_configuration_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.distribution_configuration_arn = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>The Amazon Resource Name (ARN) of the distribution configuration to use.</p>
86    pub fn set_distribution_configuration_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.distribution_configuration_arn = input;
88        self
89    }
90    /// <p>The Amazon Resource Name (ARN) of the distribution configuration to use.</p>
91    pub fn get_distribution_configuration_arn(&self) -> &::std::option::Option<::std::string::String> {
92        &self.distribution_configuration_arn
93    }
94    /// <p>The IAM role to use for the distribution.</p>
95    /// This field is required.
96    pub fn execution_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.execution_role = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// <p>The IAM role to use for the distribution.</p>
101    pub fn set_execution_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.execution_role = input;
103        self
104    }
105    /// <p>The IAM role to use for the distribution.</p>
106    pub fn get_execution_role(&self) -> &::std::option::Option<::std::string::String> {
107        &self.execution_role
108    }
109    /// Adds a key-value pair to `tags`.
110    ///
111    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
112    ///
113    /// <p>The tags to apply to the distributed image.</p>
114    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
115        let mut hash_map = self.tags.unwrap_or_default();
116        hash_map.insert(k.into(), v.into());
117        self.tags = ::std::option::Option::Some(hash_map);
118        self
119    }
120    /// <p>The tags to apply to the distributed image.</p>
121    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
122        self.tags = input;
123        self
124    }
125    /// <p>The tags to apply to the distributed image.</p>
126    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
127        &self.tags
128    }
129    /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the <i>Amazon EC2 API Reference</i>.</p>
130    /// This field is required.
131    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.client_token = ::std::option::Option::Some(input.into());
133        self
134    }
135    /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the <i>Amazon EC2 API Reference</i>.</p>
136    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.client_token = input;
138        self
139    }
140    /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the <i>Amazon EC2 API Reference</i>.</p>
141    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
142        &self.client_token
143    }
144    /// <p>The logging configuration for the distribution.</p>
145    pub fn logging_configuration(mut self, input: crate::types::ImageLoggingConfiguration) -> Self {
146        self.logging_configuration = ::std::option::Option::Some(input);
147        self
148    }
149    /// <p>The logging configuration for the distribution.</p>
150    pub fn set_logging_configuration(mut self, input: ::std::option::Option<crate::types::ImageLoggingConfiguration>) -> Self {
151        self.logging_configuration = input;
152        self
153    }
154    /// <p>The logging configuration for the distribution.</p>
155    pub fn get_logging_configuration(&self) -> &::std::option::Option<crate::types::ImageLoggingConfiguration> {
156        &self.logging_configuration
157    }
158    /// Consumes the builder and constructs a [`DistributeImageInput`](crate::operation::distribute_image::DistributeImageInput).
159    pub fn build(
160        self,
161    ) -> ::std::result::Result<crate::operation::distribute_image::DistributeImageInput, ::aws_smithy_types::error::operation::BuildError> {
162        ::std::result::Result::Ok(crate::operation::distribute_image::DistributeImageInput {
163            source_image: self.source_image,
164            distribution_configuration_arn: self.distribution_configuration_arn,
165            execution_role: self.execution_role,
166            tags: self.tags,
167            client_token: self.client_token,
168            logging_configuration: self.logging_configuration,
169        })
170    }
171}