aws_sdk_personalize/operation/update_campaign/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_campaign::_update_campaign_output::UpdateCampaignOutputBuilder;
3
4pub use crate::operation::update_campaign::_update_campaign_input::UpdateCampaignInputBuilder;
5
6impl crate::operation::update_campaign::builders::UpdateCampaignInputBuilder {
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_campaign::UpdateCampaignOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_campaign::UpdateCampaignError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_campaign();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateCampaign`.
24///
25/// <p>Updates a campaign to deploy a retrained solution version with an existing campaign, change your campaign's <code>minProvisionedTPS</code>, or modify your campaign's configuration. For example, you can set <code>enableMetadataWithRecommendations</code> to true for an existing campaign.</p>
26/// <p>To update a campaign to start automatically using the latest solution version, specify the following:</p>
27/// <ul>
28/// <li>
29/// <p>For the <code>SolutionVersionArn</code> parameter, specify the Amazon Resource Name (ARN) of your solution in <code>SolutionArn/$LATEST</code> format.</p></li>
30/// <li>
31/// <p>In the <code>campaignConfig</code>, set <code>syncWithLatestSolutionVersion</code> to <code>true</code>.</p></li>
32/// </ul>
33/// <p>To update a campaign, the campaign status must be ACTIVE or CREATE FAILED. Check the campaign status using the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeCampaign.html">DescribeCampaign</a> operation.</p><note>
34/// <p>You can still get recommendations from a campaign while an update is in progress. The campaign will use the previous solution version and campaign configuration to generate recommendations until the latest campaign update status is <code>Active</code>.</p>
35/// </note>
36/// <p>For more information about updating a campaign, including code samples, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/update-campaigns.html">Updating a campaign</a>. For more information about campaigns, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/campaigns.html">Creating a campaign</a>.</p>
37#[derive(::std::clone::Clone, ::std::fmt::Debug)]
38pub struct UpdateCampaignFluentBuilder {
39    handle: ::std::sync::Arc<crate::client::Handle>,
40    inner: crate::operation::update_campaign::builders::UpdateCampaignInputBuilder,
41    config_override: ::std::option::Option<crate::config::Builder>,
42}
43impl
44    crate::client::customize::internal::CustomizableSend<
45        crate::operation::update_campaign::UpdateCampaignOutput,
46        crate::operation::update_campaign::UpdateCampaignError,
47    > for UpdateCampaignFluentBuilder
48{
49    fn send(
50        self,
51        config_override: crate::config::Builder,
52    ) -> crate::client::customize::internal::BoxFuture<
53        crate::client::customize::internal::SendResult<
54            crate::operation::update_campaign::UpdateCampaignOutput,
55            crate::operation::update_campaign::UpdateCampaignError,
56        >,
57    > {
58        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
59    }
60}
61impl UpdateCampaignFluentBuilder {
62    /// Creates a new `UpdateCampaignFluentBuilder`.
63    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
64        Self {
65            handle,
66            inner: ::std::default::Default::default(),
67            config_override: ::std::option::Option::None,
68        }
69    }
70    /// Access the UpdateCampaign as a reference.
71    pub fn as_input(&self) -> &crate::operation::update_campaign::builders::UpdateCampaignInputBuilder {
72        &self.inner
73    }
74    /// Sends the request and returns the response.
75    ///
76    /// If an error occurs, an `SdkError` will be returned with additional details that
77    /// can be matched against.
78    ///
79    /// By default, any retryable failures will be retried twice. Retry behavior
80    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
81    /// set when configuring the client.
82    pub async fn send(
83        self,
84    ) -> ::std::result::Result<
85        crate::operation::update_campaign::UpdateCampaignOutput,
86        ::aws_smithy_runtime_api::client::result::SdkError<
87            crate::operation::update_campaign::UpdateCampaignError,
88            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
89        >,
90    > {
91        let input = self
92            .inner
93            .build()
94            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
95        let runtime_plugins = crate::operation::update_campaign::UpdateCampaign::operation_runtime_plugins(
96            self.handle.runtime_plugins.clone(),
97            &self.handle.conf,
98            self.config_override,
99        );
100        crate::operation::update_campaign::UpdateCampaign::orchestrate(&runtime_plugins, input).await
101    }
102
103    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
104    pub fn customize(
105        self,
106    ) -> crate::client::customize::CustomizableOperation<
107        crate::operation::update_campaign::UpdateCampaignOutput,
108        crate::operation::update_campaign::UpdateCampaignError,
109        Self,
110    > {
111        crate::client::customize::CustomizableOperation::new(self)
112    }
113    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
114        self.set_config_override(::std::option::Option::Some(config_override.into()));
115        self
116    }
117
118    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
119        self.config_override = config_override;
120        self
121    }
122    /// <p>The Amazon Resource Name (ARN) of the campaign.</p>
123    pub fn campaign_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.inner = self.inner.campaign_arn(input.into());
125        self
126    }
127    /// <p>The Amazon Resource Name (ARN) of the campaign.</p>
128    pub fn set_campaign_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.inner = self.inner.set_campaign_arn(input);
130        self
131    }
132    /// <p>The Amazon Resource Name (ARN) of the campaign.</p>
133    pub fn get_campaign_arn(&self) -> &::std::option::Option<::std::string::String> {
134        self.inner.get_campaign_arn()
135    }
136    /// <p>The Amazon Resource Name (ARN) of a new model to deploy. To specify the latest solution version of your solution, specify the ARN of your <i>solution</i> in <code>SolutionArn/$LATEST</code> format. You must use this format if you set <code>syncWithLatestSolutionVersion</code> to <code>True</code> in the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_CampaignConfig.html">CampaignConfig</a>.</p>
137    /// <p>To deploy a model that isn't the latest solution version of your solution, specify the ARN of the solution version.</p>
138    /// <p>For more information about automatic campaign updates, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/campaigns.html#create-campaign-automatic-latest-sv-update">Enabling automatic campaign updates</a>.</p>
139    pub fn solution_version_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140        self.inner = self.inner.solution_version_arn(input.into());
141        self
142    }
143    /// <p>The Amazon Resource Name (ARN) of a new model to deploy. To specify the latest solution version of your solution, specify the ARN of your <i>solution</i> in <code>SolutionArn/$LATEST</code> format. You must use this format if you set <code>syncWithLatestSolutionVersion</code> to <code>True</code> in the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_CampaignConfig.html">CampaignConfig</a>.</p>
144    /// <p>To deploy a model that isn't the latest solution version of your solution, specify the ARN of the solution version.</p>
145    /// <p>For more information about automatic campaign updates, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/campaigns.html#create-campaign-automatic-latest-sv-update">Enabling automatic campaign updates</a>.</p>
146    pub fn set_solution_version_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.inner = self.inner.set_solution_version_arn(input);
148        self
149    }
150    /// <p>The Amazon Resource Name (ARN) of a new model to deploy. To specify the latest solution version of your solution, specify the ARN of your <i>solution</i> in <code>SolutionArn/$LATEST</code> format. You must use this format if you set <code>syncWithLatestSolutionVersion</code> to <code>True</code> in the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_CampaignConfig.html">CampaignConfig</a>.</p>
151    /// <p>To deploy a model that isn't the latest solution version of your solution, specify the ARN of the solution version.</p>
152    /// <p>For more information about automatic campaign updates, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/campaigns.html#create-campaign-automatic-latest-sv-update">Enabling automatic campaign updates</a>.</p>
153    pub fn get_solution_version_arn(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_solution_version_arn()
155    }
156    /// <p>Specifies the requested minimum provisioned transactions (recommendations) per second that Amazon Personalize will support. A high <code>minProvisionedTPS</code> will increase your bill. We recommend starting with 1 for <code>minProvisionedTPS</code> (the default). Track your usage using Amazon CloudWatch metrics, and increase the <code>minProvisionedTPS</code> as necessary.</p>
157    pub fn min_provisioned_tps(mut self, input: i32) -> Self {
158        self.inner = self.inner.min_provisioned_tps(input);
159        self
160    }
161    /// <p>Specifies the requested minimum provisioned transactions (recommendations) per second that Amazon Personalize will support. A high <code>minProvisionedTPS</code> will increase your bill. We recommend starting with 1 for <code>minProvisionedTPS</code> (the default). Track your usage using Amazon CloudWatch metrics, and increase the <code>minProvisionedTPS</code> as necessary.</p>
162    pub fn set_min_provisioned_tps(mut self, input: ::std::option::Option<i32>) -> Self {
163        self.inner = self.inner.set_min_provisioned_tps(input);
164        self
165    }
166    /// <p>Specifies the requested minimum provisioned transactions (recommendations) per second that Amazon Personalize will support. A high <code>minProvisionedTPS</code> will increase your bill. We recommend starting with 1 for <code>minProvisionedTPS</code> (the default). Track your usage using Amazon CloudWatch metrics, and increase the <code>minProvisionedTPS</code> as necessary.</p>
167    pub fn get_min_provisioned_tps(&self) -> &::std::option::Option<i32> {
168        self.inner.get_min_provisioned_tps()
169    }
170    /// <p>The configuration details of a campaign.</p>
171    pub fn campaign_config(mut self, input: crate::types::CampaignConfig) -> Self {
172        self.inner = self.inner.campaign_config(input);
173        self
174    }
175    /// <p>The configuration details of a campaign.</p>
176    pub fn set_campaign_config(mut self, input: ::std::option::Option<crate::types::CampaignConfig>) -> Self {
177        self.inner = self.inner.set_campaign_config(input);
178        self
179    }
180    /// <p>The configuration details of a campaign.</p>
181    pub fn get_campaign_config(&self) -> &::std::option::Option<crate::types::CampaignConfig> {
182        self.inner.get_campaign_config()
183    }
184}