aws_sdk_iotfleetwise/operation/update_campaign/
_update_campaign_output.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 UpdateCampaignOutput {
6    /// <p>The Amazon Resource Name (ARN) of the campaign.</p>
7    pub arn: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the updated campaign.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>The state of a campaign. The status can be one of:</p>
11    /// <ul>
12    /// <li>
13    /// <p><code>CREATING</code> - Amazon Web Services IoT FleetWise is processing your request to create the campaign.</p></li>
14    /// <li>
15    /// <p><code>WAITING_FOR_APPROVAL</code> - After you create a campaign, it enters this state. Use the API operation to approve the campaign for deployment to the target vehicle or fleet.</p></li>
16    /// <li>
17    /// <p><code>RUNNING</code> - The campaign is active.</p></li>
18    /// <li>
19    /// <p><code>SUSPENDED</code> - The campaign is suspended. To resume the campaign, use the API operation.</p></li>
20    /// </ul>
21    pub status: ::std::option::Option<crate::types::CampaignStatus>,
22    _request_id: Option<String>,
23}
24impl UpdateCampaignOutput {
25    /// <p>The Amazon Resource Name (ARN) of the campaign.</p>
26    pub fn arn(&self) -> ::std::option::Option<&str> {
27        self.arn.as_deref()
28    }
29    /// <p>The name of the updated campaign.</p>
30    pub fn name(&self) -> ::std::option::Option<&str> {
31        self.name.as_deref()
32    }
33    /// <p>The state of a campaign. The status can be one of:</p>
34    /// <ul>
35    /// <li>
36    /// <p><code>CREATING</code> - Amazon Web Services IoT FleetWise is processing your request to create the campaign.</p></li>
37    /// <li>
38    /// <p><code>WAITING_FOR_APPROVAL</code> - After you create a campaign, it enters this state. Use the API operation to approve the campaign for deployment to the target vehicle or fleet.</p></li>
39    /// <li>
40    /// <p><code>RUNNING</code> - The campaign is active.</p></li>
41    /// <li>
42    /// <p><code>SUSPENDED</code> - The campaign is suspended. To resume the campaign, use the API operation.</p></li>
43    /// </ul>
44    pub fn status(&self) -> ::std::option::Option<&crate::types::CampaignStatus> {
45        self.status.as_ref()
46    }
47}
48impl ::aws_types::request_id::RequestId for UpdateCampaignOutput {
49    fn request_id(&self) -> Option<&str> {
50        self._request_id.as_deref()
51    }
52}
53impl UpdateCampaignOutput {
54    /// Creates a new builder-style object to manufacture [`UpdateCampaignOutput`](crate::operation::update_campaign::UpdateCampaignOutput).
55    pub fn builder() -> crate::operation::update_campaign::builders::UpdateCampaignOutputBuilder {
56        crate::operation::update_campaign::builders::UpdateCampaignOutputBuilder::default()
57    }
58}
59
60/// A builder for [`UpdateCampaignOutput`](crate::operation::update_campaign::UpdateCampaignOutput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct UpdateCampaignOutputBuilder {
64    pub(crate) arn: ::std::option::Option<::std::string::String>,
65    pub(crate) name: ::std::option::Option<::std::string::String>,
66    pub(crate) status: ::std::option::Option<crate::types::CampaignStatus>,
67    _request_id: Option<String>,
68}
69impl UpdateCampaignOutputBuilder {
70    /// <p>The Amazon Resource Name (ARN) of the campaign.</p>
71    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
72        self.arn = ::std::option::Option::Some(input.into());
73        self
74    }
75    /// <p>The Amazon Resource Name (ARN) of the campaign.</p>
76    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
77        self.arn = input;
78        self
79    }
80    /// <p>The Amazon Resource Name (ARN) of the campaign.</p>
81    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
82        &self.arn
83    }
84    /// <p>The name of the updated campaign.</p>
85    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
86        self.name = ::std::option::Option::Some(input.into());
87        self
88    }
89    /// <p>The name of the updated campaign.</p>
90    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91        self.name = input;
92        self
93    }
94    /// <p>The name of the updated campaign.</p>
95    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
96        &self.name
97    }
98    /// <p>The state of a campaign. The status can be one of:</p>
99    /// <ul>
100    /// <li>
101    /// <p><code>CREATING</code> - Amazon Web Services IoT FleetWise is processing your request to create the campaign.</p></li>
102    /// <li>
103    /// <p><code>WAITING_FOR_APPROVAL</code> - After you create a campaign, it enters this state. Use the API operation to approve the campaign for deployment to the target vehicle or fleet.</p></li>
104    /// <li>
105    /// <p><code>RUNNING</code> - The campaign is active.</p></li>
106    /// <li>
107    /// <p><code>SUSPENDED</code> - The campaign is suspended. To resume the campaign, use the API operation.</p></li>
108    /// </ul>
109    pub fn status(mut self, input: crate::types::CampaignStatus) -> Self {
110        self.status = ::std::option::Option::Some(input);
111        self
112    }
113    /// <p>The state of a campaign. The status can be one of:</p>
114    /// <ul>
115    /// <li>
116    /// <p><code>CREATING</code> - Amazon Web Services IoT FleetWise is processing your request to create the campaign.</p></li>
117    /// <li>
118    /// <p><code>WAITING_FOR_APPROVAL</code> - After you create a campaign, it enters this state. Use the API operation to approve the campaign for deployment to the target vehicle or fleet.</p></li>
119    /// <li>
120    /// <p><code>RUNNING</code> - The campaign is active.</p></li>
121    /// <li>
122    /// <p><code>SUSPENDED</code> - The campaign is suspended. To resume the campaign, use the API operation.</p></li>
123    /// </ul>
124    pub fn set_status(mut self, input: ::std::option::Option<crate::types::CampaignStatus>) -> Self {
125        self.status = input;
126        self
127    }
128    /// <p>The state of a campaign. The status can be one of:</p>
129    /// <ul>
130    /// <li>
131    /// <p><code>CREATING</code> - Amazon Web Services IoT FleetWise is processing your request to create the campaign.</p></li>
132    /// <li>
133    /// <p><code>WAITING_FOR_APPROVAL</code> - After you create a campaign, it enters this state. Use the API operation to approve the campaign for deployment to the target vehicle or fleet.</p></li>
134    /// <li>
135    /// <p><code>RUNNING</code> - The campaign is active.</p></li>
136    /// <li>
137    /// <p><code>SUSPENDED</code> - The campaign is suspended. To resume the campaign, use the API operation.</p></li>
138    /// </ul>
139    pub fn get_status(&self) -> &::std::option::Option<crate::types::CampaignStatus> {
140        &self.status
141    }
142    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
143        self._request_id = Some(request_id.into());
144        self
145    }
146
147    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
148        self._request_id = request_id;
149        self
150    }
151    /// Consumes the builder and constructs a [`UpdateCampaignOutput`](crate::operation::update_campaign::UpdateCampaignOutput).
152    pub fn build(self) -> crate::operation::update_campaign::UpdateCampaignOutput {
153        crate::operation::update_campaign::UpdateCampaignOutput {
154            arn: self.arn,
155            name: self.name,
156            status: self.status,
157            _request_id: self._request_id,
158        }
159    }
160}