aws_sdk_proton/operation/create_service_template_version/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_service_template_version::_create_service_template_version_output::CreateServiceTemplateVersionOutputBuilder;
3
4pub use crate::operation::create_service_template_version::_create_service_template_version_input::CreateServiceTemplateVersionInputBuilder;
5
6impl crate::operation::create_service_template_version::builders::CreateServiceTemplateVersionInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_service_template_version::CreateServiceTemplateVersionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_service_template_version::CreateServiceTemplateVersionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_service_template_version();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateServiceTemplateVersion`.
24///
25/// <p>Create a new major or minor version of a service template. A major version of a service template is a version that <i>isn't</i> backward compatible. A minor version of a service template is a version that's backward compatible within its major version.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateServiceTemplateVersionFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_service_template_version::builders::CreateServiceTemplateVersionInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_service_template_version::CreateServiceTemplateVersionOutput,
35        crate::operation::create_service_template_version::CreateServiceTemplateVersionError,
36    > for CreateServiceTemplateVersionFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::create_service_template_version::CreateServiceTemplateVersionOutput,
44            crate::operation::create_service_template_version::CreateServiceTemplateVersionError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateServiceTemplateVersionFluentBuilder {
51    /// Creates a new `CreateServiceTemplateVersionFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the CreateServiceTemplateVersion as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_service_template_version::builders::CreateServiceTemplateVersionInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::create_service_template_version::CreateServiceTemplateVersionOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_service_template_version::CreateServiceTemplateVersionError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::create_service_template_version::CreateServiceTemplateVersion::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_service_template_version::CreateServiceTemplateVersion::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::create_service_template_version::CreateServiceTemplateVersionOutput,
97        crate::operation::create_service_template_version::CreateServiceTemplateVersionError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>When included, if two identical requests are made with the same client token, Proton returns the service template version that the first request created.</p>
112    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.client_token(input.into());
114        self
115    }
116    /// <p>When included, if two identical requests are made with the same client token, Proton returns the service template version that the first request created.</p>
117    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_client_token(input);
119        self
120    }
121    /// <p>When included, if two identical requests are made with the same client token, Proton returns the service template version that the first request created.</p>
122    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_client_token()
124    }
125    /// <p>The name of the service template.</p>
126    pub fn template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.template_name(input.into());
128        self
129    }
130    /// <p>The name of the service template.</p>
131    pub fn set_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_template_name(input);
133        self
134    }
135    /// <p>The name of the service template.</p>
136    pub fn get_template_name(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_template_name()
138    }
139    /// <p>A description of the new version of a service template.</p>
140    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.description(input.into());
142        self
143    }
144    /// <p>A description of the new version of a service template.</p>
145    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_description(input);
147        self
148    }
149    /// <p>A description of the new version of a service template.</p>
150    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_description()
152    }
153    /// <p>To create a new minor version of the service template, include a <code>major Version</code>.</p>
154    /// <p>To create a new major and minor version of the service template, <i>exclude</i> <code>major Version</code>.</p>
155    pub fn major_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156        self.inner = self.inner.major_version(input.into());
157        self
158    }
159    /// <p>To create a new minor version of the service template, include a <code>major Version</code>.</p>
160    /// <p>To create a new major and minor version of the service template, <i>exclude</i> <code>major Version</code>.</p>
161    pub fn set_major_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162        self.inner = self.inner.set_major_version(input);
163        self
164    }
165    /// <p>To create a new minor version of the service template, include a <code>major Version</code>.</p>
166    /// <p>To create a new major and minor version of the service template, <i>exclude</i> <code>major Version</code>.</p>
167    pub fn get_major_version(&self) -> &::std::option::Option<::std::string::String> {
168        self.inner.get_major_version()
169    }
170    /// <p>An object that includes the template bundle S3 bucket path and name for the new version of a service template.</p>
171    pub fn source(mut self, input: crate::types::TemplateVersionSourceInput) -> Self {
172        self.inner = self.inner.source(input);
173        self
174    }
175    /// <p>An object that includes the template bundle S3 bucket path and name for the new version of a service template.</p>
176    pub fn set_source(mut self, input: ::std::option::Option<crate::types::TemplateVersionSourceInput>) -> Self {
177        self.inner = self.inner.set_source(input);
178        self
179    }
180    /// <p>An object that includes the template bundle S3 bucket path and name for the new version of a service template.</p>
181    pub fn get_source(&self) -> &::std::option::Option<crate::types::TemplateVersionSourceInput> {
182        self.inner.get_source()
183    }
184    ///
185    /// Appends an item to `compatibleEnvironmentTemplates`.
186    ///
187    /// To override the contents of this collection use [`set_compatible_environment_templates`](Self::set_compatible_environment_templates).
188    ///
189    /// <p>An array of environment template objects that are compatible with the new service template version. A service instance based on this service template version can run in environments based on compatible templates.</p>
190    pub fn compatible_environment_templates(mut self, input: crate::types::CompatibleEnvironmentTemplateInput) -> Self {
191        self.inner = self.inner.compatible_environment_templates(input);
192        self
193    }
194    /// <p>An array of environment template objects that are compatible with the new service template version. A service instance based on this service template version can run in environments based on compatible templates.</p>
195    pub fn set_compatible_environment_templates(
196        mut self,
197        input: ::std::option::Option<::std::vec::Vec<crate::types::CompatibleEnvironmentTemplateInput>>,
198    ) -> Self {
199        self.inner = self.inner.set_compatible_environment_templates(input);
200        self
201    }
202    /// <p>An array of environment template objects that are compatible with the new service template version. A service instance based on this service template version can run in environments based on compatible templates.</p>
203    pub fn get_compatible_environment_templates(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CompatibleEnvironmentTemplateInput>> {
204        self.inner.get_compatible_environment_templates()
205    }
206    ///
207    /// Appends an item to `tags`.
208    ///
209    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
210    ///
211    /// <p>An optional list of metadata items that you can associate with the Proton service template version. A tag is a key-value pair.</p>
212    /// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>
213    pub fn tags(mut self, input: crate::types::Tag) -> Self {
214        self.inner = self.inner.tags(input);
215        self
216    }
217    /// <p>An optional list of metadata items that you can associate with the Proton service template version. A tag is a key-value pair.</p>
218    /// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>
219    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
220        self.inner = self.inner.set_tags(input);
221        self
222    }
223    /// <p>An optional list of metadata items that you can associate with the Proton service template version. A tag is a key-value pair.</p>
224    /// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>
225    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
226        self.inner.get_tags()
227    }
228    ///
229    /// Appends an item to `supportedComponentSources`.
230    ///
231    /// To override the contents of this collection use [`set_supported_component_sources`](Self::set_supported_component_sources).
232    ///
233    /// <p>An array of supported component sources. Components with supported sources can be attached to service instances based on this service template version.</p>
234    /// <p>For more information about components, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-components.html">Proton components</a> in the <i>Proton User Guide</i>.</p>
235    pub fn supported_component_sources(mut self, input: crate::types::ServiceTemplateSupportedComponentSourceType) -> Self {
236        self.inner = self.inner.supported_component_sources(input);
237        self
238    }
239    /// <p>An array of supported component sources. Components with supported sources can be attached to service instances based on this service template version.</p>
240    /// <p>For more information about components, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-components.html">Proton components</a> in the <i>Proton User Guide</i>.</p>
241    pub fn set_supported_component_sources(
242        mut self,
243        input: ::std::option::Option<::std::vec::Vec<crate::types::ServiceTemplateSupportedComponentSourceType>>,
244    ) -> Self {
245        self.inner = self.inner.set_supported_component_sources(input);
246        self
247    }
248    /// <p>An array of supported component sources. Components with supported sources can be attached to service instances based on this service template version.</p>
249    /// <p>For more information about components, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-components.html">Proton components</a> in the <i>Proton User Guide</i>.</p>
250    pub fn get_supported_component_sources(
251        &self,
252    ) -> &::std::option::Option<::std::vec::Vec<crate::types::ServiceTemplateSupportedComponentSourceType>> {
253        self.inner.get_supported_component_sources()
254    }
255}