aws_sdk_personalize/operation/create_campaign/_create_campaign_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateCampaignInput {
6 /// <p>A name for the new campaign. The campaign name must be unique within your account.</p>
7 pub name: ::std::option::Option<::std::string::String>,
8 /// <p>The Amazon Resource Name (ARN) of the trained model to deploy with the campaign. 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>
9 /// <p>To deploy a model that isn't the latest solution version of your solution, specify the ARN of the solution version.</p>
10 /// <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>
11 pub solution_version_arn: ::std::option::Option<::std::string::String>,
12 /// <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>
13 pub min_provisioned_tps: ::std::option::Option<i32>,
14 /// <p>The configuration details of a campaign.</p>
15 pub campaign_config: ::std::option::Option<crate::types::CampaignConfig>,
16 /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the campaign.</p>
17 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
18}
19impl CreateCampaignInput {
20 /// <p>A name for the new campaign. The campaign name must be unique within your account.</p>
21 pub fn name(&self) -> ::std::option::Option<&str> {
22 self.name.as_deref()
23 }
24 /// <p>The Amazon Resource Name (ARN) of the trained model to deploy with the campaign. 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>
25 /// <p>To deploy a model that isn't the latest solution version of your solution, specify the ARN of the solution version.</p>
26 /// <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>
27 pub fn solution_version_arn(&self) -> ::std::option::Option<&str> {
28 self.solution_version_arn.as_deref()
29 }
30 /// <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>
31 pub fn min_provisioned_tps(&self) -> ::std::option::Option<i32> {
32 self.min_provisioned_tps
33 }
34 /// <p>The configuration details of a campaign.</p>
35 pub fn campaign_config(&self) -> ::std::option::Option<&crate::types::CampaignConfig> {
36 self.campaign_config.as_ref()
37 }
38 /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the campaign.</p>
39 ///
40 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
41 pub fn tags(&self) -> &[crate::types::Tag] {
42 self.tags.as_deref().unwrap_or_default()
43 }
44}
45impl CreateCampaignInput {
46 /// Creates a new builder-style object to manufacture [`CreateCampaignInput`](crate::operation::create_campaign::CreateCampaignInput).
47 pub fn builder() -> crate::operation::create_campaign::builders::CreateCampaignInputBuilder {
48 crate::operation::create_campaign::builders::CreateCampaignInputBuilder::default()
49 }
50}
51
52/// A builder for [`CreateCampaignInput`](crate::operation::create_campaign::CreateCampaignInput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct CreateCampaignInputBuilder {
56 pub(crate) name: ::std::option::Option<::std::string::String>,
57 pub(crate) solution_version_arn: ::std::option::Option<::std::string::String>,
58 pub(crate) min_provisioned_tps: ::std::option::Option<i32>,
59 pub(crate) campaign_config: ::std::option::Option<crate::types::CampaignConfig>,
60 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
61}
62impl CreateCampaignInputBuilder {
63 /// <p>A name for the new campaign. The campaign name must be unique within your account.</p>
64 /// This field is required.
65 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66 self.name = ::std::option::Option::Some(input.into());
67 self
68 }
69 /// <p>A name for the new campaign. The campaign name must be unique within your account.</p>
70 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71 self.name = input;
72 self
73 }
74 /// <p>A name for the new campaign. The campaign name must be unique within your account.</p>
75 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
76 &self.name
77 }
78 /// <p>The Amazon Resource Name (ARN) of the trained model to deploy with the campaign. 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>
79 /// <p>To deploy a model that isn't the latest solution version of your solution, specify the ARN of the solution version.</p>
80 /// <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>
81 /// This field is required.
82 pub fn solution_version_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83 self.solution_version_arn = ::std::option::Option::Some(input.into());
84 self
85 }
86 /// <p>The Amazon Resource Name (ARN) of the trained model to deploy with the campaign. 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>
87 /// <p>To deploy a model that isn't the latest solution version of your solution, specify the ARN of the solution version.</p>
88 /// <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>
89 pub fn set_solution_version_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90 self.solution_version_arn = input;
91 self
92 }
93 /// <p>The Amazon Resource Name (ARN) of the trained model to deploy with the campaign. 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>
94 /// <p>To deploy a model that isn't the latest solution version of your solution, specify the ARN of the solution version.</p>
95 /// <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>
96 pub fn get_solution_version_arn(&self) -> &::std::option::Option<::std::string::String> {
97 &self.solution_version_arn
98 }
99 /// <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>
100 pub fn min_provisioned_tps(mut self, input: i32) -> Self {
101 self.min_provisioned_tps = ::std::option::Option::Some(input);
102 self
103 }
104 /// <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>
105 pub fn set_min_provisioned_tps(mut self, input: ::std::option::Option<i32>) -> Self {
106 self.min_provisioned_tps = input;
107 self
108 }
109 /// <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>
110 pub fn get_min_provisioned_tps(&self) -> &::std::option::Option<i32> {
111 &self.min_provisioned_tps
112 }
113 /// <p>The configuration details of a campaign.</p>
114 pub fn campaign_config(mut self, input: crate::types::CampaignConfig) -> Self {
115 self.campaign_config = ::std::option::Option::Some(input);
116 self
117 }
118 /// <p>The configuration details of a campaign.</p>
119 pub fn set_campaign_config(mut self, input: ::std::option::Option<crate::types::CampaignConfig>) -> Self {
120 self.campaign_config = input;
121 self
122 }
123 /// <p>The configuration details of a campaign.</p>
124 pub fn get_campaign_config(&self) -> &::std::option::Option<crate::types::CampaignConfig> {
125 &self.campaign_config
126 }
127 /// Appends an item to `tags`.
128 ///
129 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
130 ///
131 /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the campaign.</p>
132 pub fn tags(mut self, input: crate::types::Tag) -> Self {
133 let mut v = self.tags.unwrap_or_default();
134 v.push(input);
135 self.tags = ::std::option::Option::Some(v);
136 self
137 }
138 /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the campaign.</p>
139 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
140 self.tags = input;
141 self
142 }
143 /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the campaign.</p>
144 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
145 &self.tags
146 }
147 /// Consumes the builder and constructs a [`CreateCampaignInput`](crate::operation::create_campaign::CreateCampaignInput).
148 pub fn build(
149 self,
150 ) -> ::std::result::Result<crate::operation::create_campaign::CreateCampaignInput, ::aws_smithy_types::error::operation::BuildError> {
151 ::std::result::Result::Ok(crate::operation::create_campaign::CreateCampaignInput {
152 name: self.name,
153 solution_version_arn: self.solution_version_arn,
154 min_provisioned_tps: self.min_provisioned_tps,
155 campaign_config: self.campaign_config,
156 tags: self.tags,
157 })
158 }
159}