aws_sdk_evidently/operation/update_feature/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_feature::_update_feature_output::UpdateFeatureOutputBuilder;
3
4pub use crate::operation::update_feature::_update_feature_input::UpdateFeatureInputBuilder;
5
6impl crate::operation::update_feature::builders::UpdateFeatureInputBuilder {
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::update_feature::UpdateFeatureOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_feature::UpdateFeatureError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_feature();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateFeature`.
24///
25/// <p>Updates an existing feature.</p>
26/// <p>You can't use this operation to update the tags of an existing feature. Instead, use <a href="https://docs.aws.amazon.com/cloudwatchevidently/latest/APIReference/API_TagResource.html">TagResource</a>.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct UpdateFeatureFluentBuilder {
29 handle: ::std::sync::Arc<crate::client::Handle>,
30 inner: crate::operation::update_feature::builders::UpdateFeatureInputBuilder,
31 config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34 crate::client::customize::internal::CustomizableSend<
35 crate::operation::update_feature::UpdateFeatureOutput,
36 crate::operation::update_feature::UpdateFeatureError,
37 > for UpdateFeatureFluentBuilder
38{
39 fn send(
40 self,
41 config_override: crate::config::Builder,
42 ) -> crate::client::customize::internal::BoxFuture<
43 crate::client::customize::internal::SendResult<
44 crate::operation::update_feature::UpdateFeatureOutput,
45 crate::operation::update_feature::UpdateFeatureError,
46 >,
47 > {
48 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49 }
50}
51impl UpdateFeatureFluentBuilder {
52 /// Creates a new `UpdateFeatureFluentBuilder`.
53 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54 Self {
55 handle,
56 inner: ::std::default::Default::default(),
57 config_override: ::std::option::Option::None,
58 }
59 }
60 /// Access the UpdateFeature as a reference.
61 pub fn as_input(&self) -> &crate::operation::update_feature::builders::UpdateFeatureInputBuilder {
62 &self.inner
63 }
64 /// Sends the request and returns the response.
65 ///
66 /// If an error occurs, an `SdkError` will be returned with additional details that
67 /// can be matched against.
68 ///
69 /// By default, any retryable failures will be retried twice. Retry behavior
70 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71 /// set when configuring the client.
72 pub async fn send(
73 self,
74 ) -> ::std::result::Result<
75 crate::operation::update_feature::UpdateFeatureOutput,
76 ::aws_smithy_runtime_api::client::result::SdkError<
77 crate::operation::update_feature::UpdateFeatureError,
78 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79 >,
80 > {
81 let input = self
82 .inner
83 .build()
84 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85 let runtime_plugins = crate::operation::update_feature::UpdateFeature::operation_runtime_plugins(
86 self.handle.runtime_plugins.clone(),
87 &self.handle.conf,
88 self.config_override,
89 );
90 crate::operation::update_feature::UpdateFeature::orchestrate(&runtime_plugins, input).await
91 }
92
93 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94 pub fn customize(
95 self,
96 ) -> crate::client::customize::CustomizableOperation<
97 crate::operation::update_feature::UpdateFeatureOutput,
98 crate::operation::update_feature::UpdateFeatureError,
99 Self,
100 > {
101 crate::client::customize::CustomizableOperation::new(self)
102 }
103 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104 self.set_config_override(::std::option::Option::Some(config_override.into()));
105 self
106 }
107
108 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109 self.config_override = config_override;
110 self
111 }
112 /// <p>The name or ARN of the project that contains the feature to be updated.</p>
113 pub fn project(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114 self.inner = self.inner.project(input.into());
115 self
116 }
117 /// <p>The name or ARN of the project that contains the feature to be updated.</p>
118 pub fn set_project(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119 self.inner = self.inner.set_project(input);
120 self
121 }
122 /// <p>The name or ARN of the project that contains the feature to be updated.</p>
123 pub fn get_project(&self) -> &::std::option::Option<::std::string::String> {
124 self.inner.get_project()
125 }
126 /// <p>The name of the feature to be updated.</p>
127 pub fn feature(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128 self.inner = self.inner.feature(input.into());
129 self
130 }
131 /// <p>The name of the feature to be updated.</p>
132 pub fn set_feature(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133 self.inner = self.inner.set_feature(input);
134 self
135 }
136 /// <p>The name of the feature to be updated.</p>
137 pub fn get_feature(&self) -> &::std::option::Option<::std::string::String> {
138 self.inner.get_feature()
139 }
140 /// <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>
141 pub fn evaluation_strategy(mut self, input: crate::types::FeatureEvaluationStrategy) -> Self {
142 self.inner = self.inner.evaluation_strategy(input);
143 self
144 }
145 /// <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>
146 pub fn set_evaluation_strategy(mut self, input: ::std::option::Option<crate::types::FeatureEvaluationStrategy>) -> Self {
147 self.inner = self.inner.set_evaluation_strategy(input);
148 self
149 }
150 /// <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>
151 pub fn get_evaluation_strategy(&self) -> &::std::option::Option<crate::types::FeatureEvaluationStrategy> {
152 self.inner.get_evaluation_strategy()
153 }
154 /// <p>An optional description of the feature.</p>
155 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156 self.inner = self.inner.description(input.into());
157 self
158 }
159 /// <p>An optional description of the feature.</p>
160 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161 self.inner = self.inner.set_description(input);
162 self
163 }
164 /// <p>An optional description of the feature.</p>
165 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
166 self.inner.get_description()
167 }
168 ///
169 /// Appends an item to `addOrUpdateVariations`.
170 ///
171 /// To override the contents of this collection use [`set_add_or_update_variations`](Self::set_add_or_update_variations).
172 ///
173 /// <p>To update variation configurations for this feature, or add new ones, specify this structure. In this array, include any variations that you want to add or update. If the array includes a variation name that already exists for this feature, it is updated. If it includes a new variation name, it is added as a new variation.</p>
174 pub fn add_or_update_variations(mut self, input: crate::types::VariationConfig) -> Self {
175 self.inner = self.inner.add_or_update_variations(input);
176 self
177 }
178 /// <p>To update variation configurations for this feature, or add new ones, specify this structure. In this array, include any variations that you want to add or update. If the array includes a variation name that already exists for this feature, it is updated. If it includes a new variation name, it is added as a new variation.</p>
179 pub fn set_add_or_update_variations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VariationConfig>>) -> Self {
180 self.inner = self.inner.set_add_or_update_variations(input);
181 self
182 }
183 /// <p>To update variation configurations for this feature, or add new ones, specify this structure. In this array, include any variations that you want to add or update. If the array includes a variation name that already exists for this feature, it is updated. If it includes a new variation name, it is added as a new variation.</p>
184 pub fn get_add_or_update_variations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VariationConfig>> {
185 self.inner.get_add_or_update_variations()
186 }
187 ///
188 /// Appends an item to `removeVariations`.
189 ///
190 /// To override the contents of this collection use [`set_remove_variations`](Self::set_remove_variations).
191 ///
192 /// <p>Removes a variation from the feature. If the variation you specify doesn't exist, then this makes no change and does not report an error.</p>
193 /// <p>This operation fails if you try to remove a variation that is part of an ongoing launch or experiment.</p>
194 pub fn remove_variations(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
195 self.inner = self.inner.remove_variations(input.into());
196 self
197 }
198 /// <p>Removes a variation from the feature. If the variation you specify doesn't exist, then this makes no change and does not report an error.</p>
199 /// <p>This operation fails if you try to remove a variation that is part of an ongoing launch or experiment.</p>
200 pub fn set_remove_variations(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
201 self.inner = self.inner.set_remove_variations(input);
202 self
203 }
204 /// <p>Removes a variation from the feature. If the variation you specify doesn't exist, then this makes no change and does not report an error.</p>
205 /// <p>This operation fails if you try to remove a variation that is part of an ongoing launch or experiment.</p>
206 pub fn get_remove_variations(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
207 self.inner.get_remove_variations()
208 }
209 /// <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>
210 pub fn default_variation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
211 self.inner = self.inner.default_variation(input.into());
212 self
213 }
214 /// <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>
215 pub fn set_default_variation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216 self.inner = self.inner.set_default_variation(input);
217 self
218 }
219 /// <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>
220 pub fn get_default_variation(&self) -> &::std::option::Option<::std::string::String> {
221 self.inner.get_default_variation()
222 }
223 ///
224 /// Adds a key-value pair to `entityOverrides`.
225 ///
226 /// To override the contents of this collection use [`set_entity_overrides`](Self::set_entity_overrides).
227 ///
228 /// <p>Specified 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>
229 /// <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>
230 pub fn entity_overrides(
231 mut self,
232 k: impl ::std::convert::Into<::std::string::String>,
233 v: impl ::std::convert::Into<::std::string::String>,
234 ) -> Self {
235 self.inner = self.inner.entity_overrides(k.into(), v.into());
236 self
237 }
238 /// <p>Specified 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>
239 /// <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>
240 pub fn set_entity_overrides(
241 mut self,
242 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
243 ) -> Self {
244 self.inner = self.inner.set_entity_overrides(input);
245 self
246 }
247 /// <p>Specified 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>
248 /// <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>
249 pub fn get_entity_overrides(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
250 self.inner.get_entity_overrides()
251 }
252}