aws_sdk_ssm/operation/label_parameter_version/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::label_parameter_version::_label_parameter_version_output::LabelParameterVersionOutputBuilder;
3
4pub use crate::operation::label_parameter_version::_label_parameter_version_input::LabelParameterVersionInputBuilder;
5
6impl crate::operation::label_parameter_version::builders::LabelParameterVersionInputBuilder {
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::label_parameter_version::LabelParameterVersionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::label_parameter_version::LabelParameterVersionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.label_parameter_version();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `LabelParameterVersion`.
24///
25/// <p>A parameter label is a user-defined alias to help you manage different versions of a parameter. When you modify a parameter, Amazon Web Services Systems Manager automatically saves a new version and increments the version number by one. A label can help you remember the purpose of a parameter when there are multiple versions.</p>
26/// <p>Parameter labels have the following requirements and restrictions.</p>
27/// <ul>
28/// <li>
29/// <p>A version of a parameter can have a maximum of 10 labels.</p></li>
30/// <li>
31/// <p>You can't attach the same label to different versions of the same parameter. For example, if version 1 has the label Production, then you can't attach Production to version 2.</p></li>
32/// <li>
33/// <p>You can move a label from one version of a parameter to another.</p></li>
34/// <li>
35/// <p>You can't create a label when you create a new parameter. You must attach a label to a specific version of a parameter.</p></li>
36/// <li>
37/// <p>If you no longer want to use a parameter label, then you can either delete it or move it to a different version of a parameter.</p></li>
38/// <li>
39/// <p>A label can have a maximum of 100 characters.</p></li>
40/// <li>
41/// <p>Labels can contain letters (case sensitive), numbers, periods (.), hyphens (-), or underscores (_).</p></li>
42/// <li>
43/// <p>Labels can't begin with a number, "<code>aws</code>" or "<code>ssm</code>" (not case sensitive). If a label fails to meet these requirements, then the label isn't associated with a parameter and the system displays it in the list of InvalidLabels.</p></li>
44/// <li>
45/// <p>Parameter names can't contain spaces. The service removes any spaces specified for the beginning or end of a parameter name. If the specified name for a parameter contains spaces between characters, the request fails with a <code>ValidationException</code> error.</p></li>
46/// </ul>
47#[derive(::std::clone::Clone, ::std::fmt::Debug)]
48pub struct LabelParameterVersionFluentBuilder {
49    handle: ::std::sync::Arc<crate::client::Handle>,
50    inner: crate::operation::label_parameter_version::builders::LabelParameterVersionInputBuilder,
51    config_override: ::std::option::Option<crate::config::Builder>,
52}
53impl
54    crate::client::customize::internal::CustomizableSend<
55        crate::operation::label_parameter_version::LabelParameterVersionOutput,
56        crate::operation::label_parameter_version::LabelParameterVersionError,
57    > for LabelParameterVersionFluentBuilder
58{
59    fn send(
60        self,
61        config_override: crate::config::Builder,
62    ) -> crate::client::customize::internal::BoxFuture<
63        crate::client::customize::internal::SendResult<
64            crate::operation::label_parameter_version::LabelParameterVersionOutput,
65            crate::operation::label_parameter_version::LabelParameterVersionError,
66        >,
67    > {
68        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
69    }
70}
71impl LabelParameterVersionFluentBuilder {
72    /// Creates a new `LabelParameterVersionFluentBuilder`.
73    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
74        Self {
75            handle,
76            inner: ::std::default::Default::default(),
77            config_override: ::std::option::Option::None,
78        }
79    }
80    /// Access the LabelParameterVersion as a reference.
81    pub fn as_input(&self) -> &crate::operation::label_parameter_version::builders::LabelParameterVersionInputBuilder {
82        &self.inner
83    }
84    /// Sends the request and returns the response.
85    ///
86    /// If an error occurs, an `SdkError` will be returned with additional details that
87    /// can be matched against.
88    ///
89    /// By default, any retryable failures will be retried twice. Retry behavior
90    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
91    /// set when configuring the client.
92    pub async fn send(
93        self,
94    ) -> ::std::result::Result<
95        crate::operation::label_parameter_version::LabelParameterVersionOutput,
96        ::aws_smithy_runtime_api::client::result::SdkError<
97            crate::operation::label_parameter_version::LabelParameterVersionError,
98            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
99        >,
100    > {
101        let input = self
102            .inner
103            .build()
104            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
105        let runtime_plugins = crate::operation::label_parameter_version::LabelParameterVersion::operation_runtime_plugins(
106            self.handle.runtime_plugins.clone(),
107            &self.handle.conf,
108            self.config_override,
109        );
110        crate::operation::label_parameter_version::LabelParameterVersion::orchestrate(&runtime_plugins, input).await
111    }
112
113    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
114    pub fn customize(
115        self,
116    ) -> crate::client::customize::CustomizableOperation<
117        crate::operation::label_parameter_version::LabelParameterVersionOutput,
118        crate::operation::label_parameter_version::LabelParameterVersionError,
119        Self,
120    > {
121        crate::client::customize::CustomizableOperation::new(self)
122    }
123    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
124        self.set_config_override(::std::option::Option::Some(config_override.into()));
125        self
126    }
127
128    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
129        self.config_override = config_override;
130        self
131    }
132    /// <p>The parameter name on which you want to attach one or more labels.</p><note>
133    /// <p>You can't enter the Amazon Resource Name (ARN) for a parameter, only the parameter name itself.</p>
134    /// </note>
135    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.inner = self.inner.name(input.into());
137        self
138    }
139    /// <p>The parameter name on which you want to attach one or more labels.</p><note>
140    /// <p>You can't enter the Amazon Resource Name (ARN) for a parameter, only the parameter name itself.</p>
141    /// </note>
142    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.inner = self.inner.set_name(input);
144        self
145    }
146    /// <p>The parameter name on which you want to attach one or more labels.</p><note>
147    /// <p>You can't enter the Amazon Resource Name (ARN) for a parameter, only the parameter name itself.</p>
148    /// </note>
149    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
150        self.inner.get_name()
151    }
152    /// <p>The specific version of the parameter on which you want to attach one or more labels. If no version is specified, the system attaches the label to the latest version.</p>
153    pub fn parameter_version(mut self, input: i64) -> Self {
154        self.inner = self.inner.parameter_version(input);
155        self
156    }
157    /// <p>The specific version of the parameter on which you want to attach one or more labels. If no version is specified, the system attaches the label to the latest version.</p>
158    pub fn set_parameter_version(mut self, input: ::std::option::Option<i64>) -> Self {
159        self.inner = self.inner.set_parameter_version(input);
160        self
161    }
162    /// <p>The specific version of the parameter on which you want to attach one or more labels. If no version is specified, the system attaches the label to the latest version.</p>
163    pub fn get_parameter_version(&self) -> &::std::option::Option<i64> {
164        self.inner.get_parameter_version()
165    }
166    ///
167    /// Appends an item to `Labels`.
168    ///
169    /// To override the contents of this collection use [`set_labels`](Self::set_labels).
170    ///
171    /// <p>One or more labels to attach to the specified parameter version.</p>
172    pub fn labels(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.inner = self.inner.labels(input.into());
174        self
175    }
176    /// <p>One or more labels to attach to the specified parameter version.</p>
177    pub fn set_labels(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
178        self.inner = self.inner.set_labels(input);
179        self
180    }
181    /// <p>One or more labels to attach to the specified parameter version.</p>
182    pub fn get_labels(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
183        self.inner.get_labels()
184    }
185}