aws_sdk_personalize/types/
_campaign_summary.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Provides a summary of the properties of a campaign. For a complete listing, call the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeCampaign.html">DescribeCampaign</a> API.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CampaignSummary {
7    /// <p>The name of the campaign.</p>
8    pub name: ::std::option::Option<::std::string::String>,
9    /// <p>The Amazon Resource Name (ARN) of the campaign.</p>
10    pub campaign_arn: ::std::option::Option<::std::string::String>,
11    /// <p>The status of the campaign.</p>
12    /// <p>A campaign can be in one of the following states:</p>
13    /// <ul>
14    /// <li>
15    /// <p>CREATE PENDING &gt; CREATE IN_PROGRESS &gt; ACTIVE -or- CREATE FAILED</p></li>
16    /// <li>
17    /// <p>DELETE PENDING &gt; DELETE IN_PROGRESS</p></li>
18    /// </ul>
19    pub status: ::std::option::Option<::std::string::String>,
20    /// <p>The date and time (in Unix time) that the campaign was created.</p>
21    pub creation_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
22    /// <p>The date and time (in Unix time) that the campaign was last updated.</p>
23    pub last_updated_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
24    /// <p>If a campaign fails, the reason behind the failure.</p>
25    pub failure_reason: ::std::option::Option<::std::string::String>,
26}
27impl CampaignSummary {
28    /// <p>The name of the campaign.</p>
29    pub fn name(&self) -> ::std::option::Option<&str> {
30        self.name.as_deref()
31    }
32    /// <p>The Amazon Resource Name (ARN) of the campaign.</p>
33    pub fn campaign_arn(&self) -> ::std::option::Option<&str> {
34        self.campaign_arn.as_deref()
35    }
36    /// <p>The status of the campaign.</p>
37    /// <p>A campaign can be in one of the following states:</p>
38    /// <ul>
39    /// <li>
40    /// <p>CREATE PENDING &gt; CREATE IN_PROGRESS &gt; ACTIVE -or- CREATE FAILED</p></li>
41    /// <li>
42    /// <p>DELETE PENDING &gt; DELETE IN_PROGRESS</p></li>
43    /// </ul>
44    pub fn status(&self) -> ::std::option::Option<&str> {
45        self.status.as_deref()
46    }
47    /// <p>The date and time (in Unix time) that the campaign was created.</p>
48    pub fn creation_date_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
49        self.creation_date_time.as_ref()
50    }
51    /// <p>The date and time (in Unix time) that the campaign was last updated.</p>
52    pub fn last_updated_date_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
53        self.last_updated_date_time.as_ref()
54    }
55    /// <p>If a campaign fails, the reason behind the failure.</p>
56    pub fn failure_reason(&self) -> ::std::option::Option<&str> {
57        self.failure_reason.as_deref()
58    }
59}
60impl CampaignSummary {
61    /// Creates a new builder-style object to manufacture [`CampaignSummary`](crate::types::CampaignSummary).
62    pub fn builder() -> crate::types::builders::CampaignSummaryBuilder {
63        crate::types::builders::CampaignSummaryBuilder::default()
64    }
65}
66
67/// A builder for [`CampaignSummary`](crate::types::CampaignSummary).
68#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
69#[non_exhaustive]
70pub struct CampaignSummaryBuilder {
71    pub(crate) name: ::std::option::Option<::std::string::String>,
72    pub(crate) campaign_arn: ::std::option::Option<::std::string::String>,
73    pub(crate) status: ::std::option::Option<::std::string::String>,
74    pub(crate) creation_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
75    pub(crate) last_updated_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
76    pub(crate) failure_reason: ::std::option::Option<::std::string::String>,
77}
78impl CampaignSummaryBuilder {
79    /// <p>The name of the campaign.</p>
80    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.name = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The name of the campaign.</p>
85    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.name = input;
87        self
88    }
89    /// <p>The name of the campaign.</p>
90    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
91        &self.name
92    }
93    /// <p>The Amazon Resource Name (ARN) of the campaign.</p>
94    pub fn campaign_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.campaign_arn = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>The Amazon Resource Name (ARN) of the campaign.</p>
99    pub fn set_campaign_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.campaign_arn = input;
101        self
102    }
103    /// <p>The Amazon Resource Name (ARN) of the campaign.</p>
104    pub fn get_campaign_arn(&self) -> &::std::option::Option<::std::string::String> {
105        &self.campaign_arn
106    }
107    /// <p>The status of the campaign.</p>
108    /// <p>A campaign can be in one of the following states:</p>
109    /// <ul>
110    /// <li>
111    /// <p>CREATE PENDING &gt; CREATE IN_PROGRESS &gt; ACTIVE -or- CREATE FAILED</p></li>
112    /// <li>
113    /// <p>DELETE PENDING &gt; DELETE IN_PROGRESS</p></li>
114    /// </ul>
115    pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.status = ::std::option::Option::Some(input.into());
117        self
118    }
119    /// <p>The status of the campaign.</p>
120    /// <p>A campaign can be in one of the following states:</p>
121    /// <ul>
122    /// <li>
123    /// <p>CREATE PENDING &gt; CREATE IN_PROGRESS &gt; ACTIVE -or- CREATE FAILED</p></li>
124    /// <li>
125    /// <p>DELETE PENDING &gt; DELETE IN_PROGRESS</p></li>
126    /// </ul>
127    pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.status = input;
129        self
130    }
131    /// <p>The status of the campaign.</p>
132    /// <p>A campaign can be in one of the following states:</p>
133    /// <ul>
134    /// <li>
135    /// <p>CREATE PENDING &gt; CREATE IN_PROGRESS &gt; ACTIVE -or- CREATE FAILED</p></li>
136    /// <li>
137    /// <p>DELETE PENDING &gt; DELETE IN_PROGRESS</p></li>
138    /// </ul>
139    pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
140        &self.status
141    }
142    /// <p>The date and time (in Unix time) that the campaign was created.</p>
143    pub fn creation_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
144        self.creation_date_time = ::std::option::Option::Some(input);
145        self
146    }
147    /// <p>The date and time (in Unix time) that the campaign was created.</p>
148    pub fn set_creation_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
149        self.creation_date_time = input;
150        self
151    }
152    /// <p>The date and time (in Unix time) that the campaign was created.</p>
153    pub fn get_creation_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
154        &self.creation_date_time
155    }
156    /// <p>The date and time (in Unix time) that the campaign was last updated.</p>
157    pub fn last_updated_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
158        self.last_updated_date_time = ::std::option::Option::Some(input);
159        self
160    }
161    /// <p>The date and time (in Unix time) that the campaign was last updated.</p>
162    pub fn set_last_updated_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
163        self.last_updated_date_time = input;
164        self
165    }
166    /// <p>The date and time (in Unix time) that the campaign was last updated.</p>
167    pub fn get_last_updated_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
168        &self.last_updated_date_time
169    }
170    /// <p>If a campaign fails, the reason behind the failure.</p>
171    pub fn failure_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        self.failure_reason = ::std::option::Option::Some(input.into());
173        self
174    }
175    /// <p>If a campaign fails, the reason behind the failure.</p>
176    pub fn set_failure_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.failure_reason = input;
178        self
179    }
180    /// <p>If a campaign fails, the reason behind the failure.</p>
181    pub fn get_failure_reason(&self) -> &::std::option::Option<::std::string::String> {
182        &self.failure_reason
183    }
184    /// Consumes the builder and constructs a [`CampaignSummary`](crate::types::CampaignSummary).
185    pub fn build(self) -> crate::types::CampaignSummary {
186        crate::types::CampaignSummary {
187            name: self.name,
188            campaign_arn: self.campaign_arn,
189            status: self.status,
190            creation_date_time: self.creation_date_time,
191            last_updated_date_time: self.last_updated_date_time,
192            failure_reason: self.failure_reason,
193        }
194    }
195}