aws_sdk_iotfleetwise/operation/update_campaign/_update_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)]
5pub struct UpdateCampaignInput {
6 /// <p>The name of the campaign to update.</p>
7 pub name: ::std::option::Option<::std::string::String>,
8 /// <p>The description of the campaign.</p>
9 pub description: ::std::option::Option<::std::string::String>,
10 /// <p>A list of vehicle attributes to associate with a signal.</p>
11 /// <p>Default: An empty array</p>
12 pub data_extra_dimensions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
13 /// <p>Specifies how to update a campaign. The action can be one of the following:</p>
14 /// <ul>
15 /// <li>
16 /// <p><code>APPROVE</code> - To approve delivering a data collection scheme to vehicles.</p></li>
17 /// <li>
18 /// <p><code>SUSPEND</code> - To suspend collecting signal data. The campaign is deleted from vehicles and all vehicles in the suspended campaign will stop sending data.</p></li>
19 /// <li>
20 /// <p><code>RESUME</code> - To reactivate the <code>SUSPEND</code> campaign. The campaign is redeployed to all vehicles and the vehicles will resume sending data.</p></li>
21 /// <li>
22 /// <p><code>UPDATE</code> - To update a campaign.</p></li>
23 /// </ul>
24 pub action: ::std::option::Option<crate::types::UpdateCampaignAction>,
25}
26impl UpdateCampaignInput {
27 /// <p>The name of the campaign to update.</p>
28 pub fn name(&self) -> ::std::option::Option<&str> {
29 self.name.as_deref()
30 }
31 /// <p>The description of the campaign.</p>
32 pub fn description(&self) -> ::std::option::Option<&str> {
33 self.description.as_deref()
34 }
35 /// <p>A list of vehicle attributes to associate with a signal.</p>
36 /// <p>Default: An empty array</p>
37 ///
38 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.data_extra_dimensions.is_none()`.
39 pub fn data_extra_dimensions(&self) -> &[::std::string::String] {
40 self.data_extra_dimensions.as_deref().unwrap_or_default()
41 }
42 /// <p>Specifies how to update a campaign. The action can be one of the following:</p>
43 /// <ul>
44 /// <li>
45 /// <p><code>APPROVE</code> - To approve delivering a data collection scheme to vehicles.</p></li>
46 /// <li>
47 /// <p><code>SUSPEND</code> - To suspend collecting signal data. The campaign is deleted from vehicles and all vehicles in the suspended campaign will stop sending data.</p></li>
48 /// <li>
49 /// <p><code>RESUME</code> - To reactivate the <code>SUSPEND</code> campaign. The campaign is redeployed to all vehicles and the vehicles will resume sending data.</p></li>
50 /// <li>
51 /// <p><code>UPDATE</code> - To update a campaign.</p></li>
52 /// </ul>
53 pub fn action(&self) -> ::std::option::Option<&crate::types::UpdateCampaignAction> {
54 self.action.as_ref()
55 }
56}
57impl ::std::fmt::Debug for UpdateCampaignInput {
58 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
59 let mut formatter = f.debug_struct("UpdateCampaignInput");
60 formatter.field("name", &self.name);
61 formatter.field("description", &self.description);
62 formatter.field("data_extra_dimensions", &"*** Sensitive Data Redacted ***");
63 formatter.field("action", &self.action);
64 formatter.finish()
65 }
66}
67impl UpdateCampaignInput {
68 /// Creates a new builder-style object to manufacture [`UpdateCampaignInput`](crate::operation::update_campaign::UpdateCampaignInput).
69 pub fn builder() -> crate::operation::update_campaign::builders::UpdateCampaignInputBuilder {
70 crate::operation::update_campaign::builders::UpdateCampaignInputBuilder::default()
71 }
72}
73
74/// A builder for [`UpdateCampaignInput`](crate::operation::update_campaign::UpdateCampaignInput).
75#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
76#[non_exhaustive]
77pub struct UpdateCampaignInputBuilder {
78 pub(crate) name: ::std::option::Option<::std::string::String>,
79 pub(crate) description: ::std::option::Option<::std::string::String>,
80 pub(crate) data_extra_dimensions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
81 pub(crate) action: ::std::option::Option<crate::types::UpdateCampaignAction>,
82}
83impl UpdateCampaignInputBuilder {
84 /// <p>The name of the campaign to update.</p>
85 /// This field is required.
86 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87 self.name = ::std::option::Option::Some(input.into());
88 self
89 }
90 /// <p>The name of the campaign to update.</p>
91 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92 self.name = input;
93 self
94 }
95 /// <p>The name of the campaign to update.</p>
96 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
97 &self.name
98 }
99 /// <p>The description of the campaign.</p>
100 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101 self.description = ::std::option::Option::Some(input.into());
102 self
103 }
104 /// <p>The description of the campaign.</p>
105 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106 self.description = input;
107 self
108 }
109 /// <p>The description of the campaign.</p>
110 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
111 &self.description
112 }
113 /// Appends an item to `data_extra_dimensions`.
114 ///
115 /// To override the contents of this collection use [`set_data_extra_dimensions`](Self::set_data_extra_dimensions).
116 ///
117 /// <p>A list of vehicle attributes to associate with a signal.</p>
118 /// <p>Default: An empty array</p>
119 pub fn data_extra_dimensions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120 let mut v = self.data_extra_dimensions.unwrap_or_default();
121 v.push(input.into());
122 self.data_extra_dimensions = ::std::option::Option::Some(v);
123 self
124 }
125 /// <p>A list of vehicle attributes to associate with a signal.</p>
126 /// <p>Default: An empty array</p>
127 pub fn set_data_extra_dimensions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
128 self.data_extra_dimensions = input;
129 self
130 }
131 /// <p>A list of vehicle attributes to associate with a signal.</p>
132 /// <p>Default: An empty array</p>
133 pub fn get_data_extra_dimensions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
134 &self.data_extra_dimensions
135 }
136 /// <p>Specifies how to update a campaign. The action can be one of the following:</p>
137 /// <ul>
138 /// <li>
139 /// <p><code>APPROVE</code> - To approve delivering a data collection scheme to vehicles.</p></li>
140 /// <li>
141 /// <p><code>SUSPEND</code> - To suspend collecting signal data. The campaign is deleted from vehicles and all vehicles in the suspended campaign will stop sending data.</p></li>
142 /// <li>
143 /// <p><code>RESUME</code> - To reactivate the <code>SUSPEND</code> campaign. The campaign is redeployed to all vehicles and the vehicles will resume sending data.</p></li>
144 /// <li>
145 /// <p><code>UPDATE</code> - To update a campaign.</p></li>
146 /// </ul>
147 /// This field is required.
148 pub fn action(mut self, input: crate::types::UpdateCampaignAction) -> Self {
149 self.action = ::std::option::Option::Some(input);
150 self
151 }
152 /// <p>Specifies how to update a campaign. The action can be one of the following:</p>
153 /// <ul>
154 /// <li>
155 /// <p><code>APPROVE</code> - To approve delivering a data collection scheme to vehicles.</p></li>
156 /// <li>
157 /// <p><code>SUSPEND</code> - To suspend collecting signal data. The campaign is deleted from vehicles and all vehicles in the suspended campaign will stop sending data.</p></li>
158 /// <li>
159 /// <p><code>RESUME</code> - To reactivate the <code>SUSPEND</code> campaign. The campaign is redeployed to all vehicles and the vehicles will resume sending data.</p></li>
160 /// <li>
161 /// <p><code>UPDATE</code> - To update a campaign.</p></li>
162 /// </ul>
163 pub fn set_action(mut self, input: ::std::option::Option<crate::types::UpdateCampaignAction>) -> Self {
164 self.action = input;
165 self
166 }
167 /// <p>Specifies how to update a campaign. The action can be one of the following:</p>
168 /// <ul>
169 /// <li>
170 /// <p><code>APPROVE</code> - To approve delivering a data collection scheme to vehicles.</p></li>
171 /// <li>
172 /// <p><code>SUSPEND</code> - To suspend collecting signal data. The campaign is deleted from vehicles and all vehicles in the suspended campaign will stop sending data.</p></li>
173 /// <li>
174 /// <p><code>RESUME</code> - To reactivate the <code>SUSPEND</code> campaign. The campaign is redeployed to all vehicles and the vehicles will resume sending data.</p></li>
175 /// <li>
176 /// <p><code>UPDATE</code> - To update a campaign.</p></li>
177 /// </ul>
178 pub fn get_action(&self) -> &::std::option::Option<crate::types::UpdateCampaignAction> {
179 &self.action
180 }
181 /// Consumes the builder and constructs a [`UpdateCampaignInput`](crate::operation::update_campaign::UpdateCampaignInput).
182 pub fn build(
183 self,
184 ) -> ::std::result::Result<crate::operation::update_campaign::UpdateCampaignInput, ::aws_smithy_types::error::operation::BuildError> {
185 ::std::result::Result::Ok(crate::operation::update_campaign::UpdateCampaignInput {
186 name: self.name,
187 description: self.description,
188 data_extra_dimensions: self.data_extra_dimensions,
189 action: self.action,
190 })
191 }
192}
193impl ::std::fmt::Debug for UpdateCampaignInputBuilder {
194 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
195 let mut formatter = f.debug_struct("UpdateCampaignInputBuilder");
196 formatter.field("name", &self.name);
197 formatter.field("description", &self.description);
198 formatter.field("data_extra_dimensions", &"*** Sensitive Data Redacted ***");
199 formatter.field("action", &self.action);
200 formatter.finish()
201 }
202}