aws_sdk_evidently/operation/create_feature/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_feature::_create_feature_output::CreateFeatureOutputBuilder;
3
4pub use crate::operation::create_feature::_create_feature_input::CreateFeatureInputBuilder;
5
6impl crate::operation::create_feature::builders::CreateFeatureInputBuilder {
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_feature::CreateFeatureOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_feature::CreateFeatureError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_feature();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateFeature`.
24///
25/// <p>Creates an Evidently <i>feature</i> that you want to launch or test. You can define up to five variations of a feature, and use these variations in your launches and experiments. A feature must be created in a project. For information about creating a project, see <a href="https://docs.aws.amazon.com/cloudwatchevidently/latest/APIReference/API_CreateProject.html">CreateProject</a>.</p>
26/// <p>Don't use this operation to update an existing feature. Instead, use <a href="https://docs.aws.amazon.com/cloudwatchevidently/latest/APIReference/API_UpdateFeature.html">UpdateFeature</a>.</p>
27#[deprecated(note = "AWS CloudWatch Evidently has been deprecated since 11/17/2025.", since = "11/17/2025")]
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct CreateFeatureFluentBuilder {
30 handle: ::std::sync::Arc<crate::client::Handle>,
31 inner: crate::operation::create_feature::builders::CreateFeatureInputBuilder,
32 config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35 crate::client::customize::internal::CustomizableSend<
36 crate::operation::create_feature::CreateFeatureOutput,
37 crate::operation::create_feature::CreateFeatureError,
38 > for CreateFeatureFluentBuilder
39{
40 fn send(
41 self,
42 config_override: crate::config::Builder,
43 ) -> crate::client::customize::internal::BoxFuture<
44 crate::client::customize::internal::SendResult<
45 crate::operation::create_feature::CreateFeatureOutput,
46 crate::operation::create_feature::CreateFeatureError,
47 >,
48 > {
49 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50 }
51}
52impl CreateFeatureFluentBuilder {
53 /// Creates a new `CreateFeatureFluentBuilder`.
54 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55 Self {
56 handle,
57 inner: ::std::default::Default::default(),
58 config_override: ::std::option::Option::None,
59 }
60 }
61 /// Access the CreateFeature as a reference.
62 pub fn as_input(&self) -> &crate::operation::create_feature::builders::CreateFeatureInputBuilder {
63 &self.inner
64 }
65 /// Sends the request and returns the response.
66 ///
67 /// If an error occurs, an `SdkError` will be returned with additional details that
68 /// can be matched against.
69 ///
70 /// By default, any retryable failures will be retried twice. Retry behavior
71 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72 /// set when configuring the client.
73 pub async fn send(
74 self,
75 ) -> ::std::result::Result<
76 crate::operation::create_feature::CreateFeatureOutput,
77 ::aws_smithy_runtime_api::client::result::SdkError<
78 crate::operation::create_feature::CreateFeatureError,
79 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80 >,
81 > {
82 let input = self
83 .inner
84 .build()
85 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86 let runtime_plugins = crate::operation::create_feature::CreateFeature::operation_runtime_plugins(
87 self.handle.runtime_plugins.clone(),
88 &self.handle.conf,
89 self.config_override,
90 );
91 crate::operation::create_feature::CreateFeature::orchestrate(&runtime_plugins, input).await
92 }
93
94 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95 pub fn customize(
96 self,
97 ) -> crate::client::customize::CustomizableOperation<
98 crate::operation::create_feature::CreateFeatureOutput,
99 crate::operation::create_feature::CreateFeatureError,
100 Self,
101 > {
102 crate::client::customize::CustomizableOperation::new(self)
103 }
104 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105 self.set_config_override(::std::option::Option::Some(config_override.into()));
106 self
107 }
108
109 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110 self.config_override = config_override;
111 self
112 }
113 /// <p>The name or ARN of the project that is to contain the new feature.</p>
114 pub fn project(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.inner = self.inner.project(input.into());
116 self
117 }
118 /// <p>The name or ARN of the project that is to contain the new feature.</p>
119 pub fn set_project(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.inner = self.inner.set_project(input);
121 self
122 }
123 /// <p>The name or ARN of the project that is to contain the new feature.</p>
124 pub fn get_project(&self) -> &::std::option::Option<::std::string::String> {
125 self.inner.get_project()
126 }
127 /// <p>The name for the new feature.</p>
128 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129 self.inner = self.inner.name(input.into());
130 self
131 }
132 /// <p>The name for the new feature.</p>
133 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134 self.inner = self.inner.set_name(input);
135 self
136 }
137 /// <p>The name for the new feature.</p>
138 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
139 self.inner.get_name()
140 }
141 /// <p>Specify <code>ALL_RULES</code> to activate the traffic allocation specified by any ongoing launches or experiments. Specify <code>DEFAULT_VARIATION</code> to serve the default variation to all users instead.</p>
142 pub fn evaluation_strategy(mut self, input: crate::types::FeatureEvaluationStrategy) -> Self {
143 self.inner = self.inner.evaluation_strategy(input);
144 self
145 }
146 /// <p>Specify <code>ALL_RULES</code> to activate the traffic allocation specified by any ongoing launches or experiments. Specify <code>DEFAULT_VARIATION</code> to serve the default variation to all users instead.</p>
147 pub fn set_evaluation_strategy(mut self, input: ::std::option::Option<crate::types::FeatureEvaluationStrategy>) -> Self {
148 self.inner = self.inner.set_evaluation_strategy(input);
149 self
150 }
151 /// <p>Specify <code>ALL_RULES</code> to activate the traffic allocation specified by any ongoing launches or experiments. Specify <code>DEFAULT_VARIATION</code> to serve the default variation to all users instead.</p>
152 pub fn get_evaluation_strategy(&self) -> &::std::option::Option<crate::types::FeatureEvaluationStrategy> {
153 self.inner.get_evaluation_strategy()
154 }
155 /// <p>An optional description of the feature.</p>
156 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157 self.inner = self.inner.description(input.into());
158 self
159 }
160 /// <p>An optional description of the feature.</p>
161 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162 self.inner = self.inner.set_description(input);
163 self
164 }
165 /// <p>An optional description of the feature.</p>
166 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
167 self.inner.get_description()
168 }
169 ///
170 /// Appends an item to `variations`.
171 ///
172 /// To override the contents of this collection use [`set_variations`](Self::set_variations).
173 ///
174 /// <p>An array of structures that contain the configuration of the feature's different variations.</p>
175 pub fn variations(mut self, input: crate::types::VariationConfig) -> Self {
176 self.inner = self.inner.variations(input);
177 self
178 }
179 /// <p>An array of structures that contain the configuration of the feature's different variations.</p>
180 pub fn set_variations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VariationConfig>>) -> Self {
181 self.inner = self.inner.set_variations(input);
182 self
183 }
184 /// <p>An array of structures that contain the configuration of the feature's different variations.</p>
185 pub fn get_variations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VariationConfig>> {
186 self.inner.get_variations()
187 }
188 /// <p>The name of the variation to use as the default variation. The default variation is served to users who are not allocated to any ongoing launches or experiments of this feature.</p>
189 /// <p>This variation must also be listed in the <code>variations</code> structure.</p>
190 /// <p>If you omit <code>defaultVariation</code>, the first variation listed in the <code>variations</code> structure is used as the default variation.</p>
191 pub fn default_variation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
192 self.inner = self.inner.default_variation(input.into());
193 self
194 }
195 /// <p>The name of the variation to use as the default variation. The default variation is served to users who are not allocated to any ongoing launches or experiments of this feature.</p>
196 /// <p>This variation must also be listed in the <code>variations</code> structure.</p>
197 /// <p>If you omit <code>defaultVariation</code>, the first variation listed in the <code>variations</code> structure is used as the default variation.</p>
198 pub fn set_default_variation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
199 self.inner = self.inner.set_default_variation(input);
200 self
201 }
202 /// <p>The name of the variation to use as the default variation. The default variation is served to users who are not allocated to any ongoing launches or experiments of this feature.</p>
203 /// <p>This variation must also be listed in the <code>variations</code> structure.</p>
204 /// <p>If you omit <code>defaultVariation</code>, the first variation listed in the <code>variations</code> structure is used as the default variation.</p>
205 pub fn get_default_variation(&self) -> &::std::option::Option<::std::string::String> {
206 self.inner.get_default_variation()
207 }
208 ///
209 /// Adds a key-value pair to `tags`.
210 ///
211 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
212 ///
213 /// <p>Assigns one or more tags (key-value pairs) to the feature.</p>
214 /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
215 /// <p>Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.</p>
216 /// <p>You can associate as many as 50 tags with a feature.</p>
217 /// <p>For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a>.</p>
218 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
219 self.inner = self.inner.tags(k.into(), v.into());
220 self
221 }
222 /// <p>Assigns one or more tags (key-value pairs) to the feature.</p>
223 /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
224 /// <p>Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.</p>
225 /// <p>You can associate as many as 50 tags with a feature.</p>
226 /// <p>For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a>.</p>
227 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
228 self.inner = self.inner.set_tags(input);
229 self
230 }
231 /// <p>Assigns one or more tags (key-value pairs) to the feature.</p>
232 /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
233 /// <p>Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.</p>
234 /// <p>You can associate as many as 50 tags with a feature.</p>
235 /// <p>For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a>.</p>
236 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
237 self.inner.get_tags()
238 }
239 ///
240 /// Adds a key-value pair to `entityOverrides`.
241 ///
242 /// To override the contents of this collection use [`set_entity_overrides`](Self::set_entity_overrides).
243 ///
244 /// <p>Specify users that should always be served a specific variation of a feature. Each user is specified by a key-value pair . For each key, specify a user by entering their user ID, account ID, or some other identifier. For the value, specify the name of the variation that they are to be served.</p>
245 /// <p>This parameter is limited to 2500 overrides or a total of 40KB. The 40KB limit includes an overhead of 6 bytes per override.</p>
246 pub fn entity_overrides(
247 mut self,
248 k: impl ::std::convert::Into<::std::string::String>,
249 v: impl ::std::convert::Into<::std::string::String>,
250 ) -> Self {
251 self.inner = self.inner.entity_overrides(k.into(), v.into());
252 self
253 }
254 /// <p>Specify users that should always be served a specific variation of a feature. Each user is specified by a key-value pair . For each key, specify a user by entering their user ID, account ID, or some other identifier. For the value, specify the name of the variation that they are to be served.</p>
255 /// <p>This parameter is limited to 2500 overrides or a total of 40KB. The 40KB limit includes an overhead of 6 bytes per override.</p>
256 pub fn set_entity_overrides(
257 mut self,
258 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
259 ) -> Self {
260 self.inner = self.inner.set_entity_overrides(input);
261 self
262 }
263 /// <p>Specify users that should always be served a specific variation of a feature. Each user is specified by a key-value pair . For each key, specify a user by entering their user ID, account ID, or some other identifier. For the value, specify the name of the variation that they are to be served.</p>
264 /// <p>This parameter is limited to 2500 overrides or a total of 40KB. The 40KB limit includes an overhead of 6 bytes per override.</p>
265 pub fn get_entity_overrides(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
266 self.inner.get_entity_overrides()
267 }
268}