Skip to main content

aws_sdk_arczonalshift/operation/update_zonal_shift/
_update_zonal_shift_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 UpdateZonalShiftInput {
6    /// <p>The identifier of a zonal shift.</p>
7    pub zonal_shift_id: ::std::option::Option<::std::string::String>,
8    /// <p>A comment that you enter about the zonal shift. Only the latest comment is retained; no comment history is maintained. A new comment overwrites any existing comment string.</p>
9    pub comment: ::std::option::Option<::std::string::String>,
10    /// <p>The length of time that you want a zonal shift to be active, which ARC converts to an expiry time (expiration time). Zonal shifts are temporary. You can set a zonal shift to be active initially for up to three days (72 hours).</p>
11    /// <p>If you want to still keep traffic away from an Availability Zone, you can update the zonal shift and set a new expiration. You can also cancel a zonal shift, before it expires, for example, if you're ready to restore traffic to the Availability Zone.</p>
12    /// <p>To set a length of time for a zonal shift to be active, specify a whole number, and then one of the following, with no space:</p>
13    /// <ul>
14    /// <li>
15    /// <p><b>A lowercase letter m:</b> To specify that the value is in minutes.</p></li>
16    /// <li>
17    /// <p><b>A lowercase letter h:</b> To specify that the value is in hours.</p></li>
18    /// </ul>
19    /// <p>For example: <code>20h</code> means the zonal shift expires in 20 hours. <code>120m</code> means the zonal shift expires in 120 minutes (2 hours).</p>
20    pub expires_in: ::std::option::Option<::std::string::String>,
21}
22impl UpdateZonalShiftInput {
23    /// <p>The identifier of a zonal shift.</p>
24    pub fn zonal_shift_id(&self) -> ::std::option::Option<&str> {
25        self.zonal_shift_id.as_deref()
26    }
27    /// <p>A comment that you enter about the zonal shift. Only the latest comment is retained; no comment history is maintained. A new comment overwrites any existing comment string.</p>
28    pub fn comment(&self) -> ::std::option::Option<&str> {
29        self.comment.as_deref()
30    }
31    /// <p>The length of time that you want a zonal shift to be active, which ARC converts to an expiry time (expiration time). Zonal shifts are temporary. You can set a zonal shift to be active initially for up to three days (72 hours).</p>
32    /// <p>If you want to still keep traffic away from an Availability Zone, you can update the zonal shift and set a new expiration. You can also cancel a zonal shift, before it expires, for example, if you're ready to restore traffic to the Availability Zone.</p>
33    /// <p>To set a length of time for a zonal shift to be active, specify a whole number, and then one of the following, with no space:</p>
34    /// <ul>
35    /// <li>
36    /// <p><b>A lowercase letter m:</b> To specify that the value is in minutes.</p></li>
37    /// <li>
38    /// <p><b>A lowercase letter h:</b> To specify that the value is in hours.</p></li>
39    /// </ul>
40    /// <p>For example: <code>20h</code> means the zonal shift expires in 20 hours. <code>120m</code> means the zonal shift expires in 120 minutes (2 hours).</p>
41    pub fn expires_in(&self) -> ::std::option::Option<&str> {
42        self.expires_in.as_deref()
43    }
44}
45impl UpdateZonalShiftInput {
46    /// Creates a new builder-style object to manufacture [`UpdateZonalShiftInput`](crate::operation::update_zonal_shift::UpdateZonalShiftInput).
47    pub fn builder() -> crate::operation::update_zonal_shift::builders::UpdateZonalShiftInputBuilder {
48        crate::operation::update_zonal_shift::builders::UpdateZonalShiftInputBuilder::default()
49    }
50}
51
52/// A builder for [`UpdateZonalShiftInput`](crate::operation::update_zonal_shift::UpdateZonalShiftInput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct UpdateZonalShiftInputBuilder {
56    pub(crate) zonal_shift_id: ::std::option::Option<::std::string::String>,
57    pub(crate) comment: ::std::option::Option<::std::string::String>,
58    pub(crate) expires_in: ::std::option::Option<::std::string::String>,
59}
60impl UpdateZonalShiftInputBuilder {
61    /// <p>The identifier of a zonal shift.</p>
62    /// This field is required.
63    pub fn zonal_shift_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
64        self.zonal_shift_id = ::std::option::Option::Some(input.into());
65        self
66    }
67    /// <p>The identifier of a zonal shift.</p>
68    pub fn set_zonal_shift_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
69        self.zonal_shift_id = input;
70        self
71    }
72    /// <p>The identifier of a zonal shift.</p>
73    pub fn get_zonal_shift_id(&self) -> &::std::option::Option<::std::string::String> {
74        &self.zonal_shift_id
75    }
76    /// <p>A comment that you enter about the zonal shift. Only the latest comment is retained; no comment history is maintained. A new comment overwrites any existing comment string.</p>
77    pub fn comment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.comment = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <p>A comment that you enter about the zonal shift. Only the latest comment is retained; no comment history is maintained. A new comment overwrites any existing comment string.</p>
82    pub fn set_comment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.comment = input;
84        self
85    }
86    /// <p>A comment that you enter about the zonal shift. Only the latest comment is retained; no comment history is maintained. A new comment overwrites any existing comment string.</p>
87    pub fn get_comment(&self) -> &::std::option::Option<::std::string::String> {
88        &self.comment
89    }
90    /// <p>The length of time that you want a zonal shift to be active, which ARC converts to an expiry time (expiration time). Zonal shifts are temporary. You can set a zonal shift to be active initially for up to three days (72 hours).</p>
91    /// <p>If you want to still keep traffic away from an Availability Zone, you can update the zonal shift and set a new expiration. You can also cancel a zonal shift, before it expires, for example, if you're ready to restore traffic to the Availability Zone.</p>
92    /// <p>To set a length of time for a zonal shift to be active, specify a whole number, and then one of the following, with no space:</p>
93    /// <ul>
94    /// <li>
95    /// <p><b>A lowercase letter m:</b> To specify that the value is in minutes.</p></li>
96    /// <li>
97    /// <p><b>A lowercase letter h:</b> To specify that the value is in hours.</p></li>
98    /// </ul>
99    /// <p>For example: <code>20h</code> means the zonal shift expires in 20 hours. <code>120m</code> means the zonal shift expires in 120 minutes (2 hours).</p>
100    pub fn expires_in(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101        self.expires_in = ::std::option::Option::Some(input.into());
102        self
103    }
104    /// <p>The length of time that you want a zonal shift to be active, which ARC converts to an expiry time (expiration time). Zonal shifts are temporary. You can set a zonal shift to be active initially for up to three days (72 hours).</p>
105    /// <p>If you want to still keep traffic away from an Availability Zone, you can update the zonal shift and set a new expiration. You can also cancel a zonal shift, before it expires, for example, if you're ready to restore traffic to the Availability Zone.</p>
106    /// <p>To set a length of time for a zonal shift to be active, specify a whole number, and then one of the following, with no space:</p>
107    /// <ul>
108    /// <li>
109    /// <p><b>A lowercase letter m:</b> To specify that the value is in minutes.</p></li>
110    /// <li>
111    /// <p><b>A lowercase letter h:</b> To specify that the value is in hours.</p></li>
112    /// </ul>
113    /// <p>For example: <code>20h</code> means the zonal shift expires in 20 hours. <code>120m</code> means the zonal shift expires in 120 minutes (2 hours).</p>
114    pub fn set_expires_in(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115        self.expires_in = input;
116        self
117    }
118    /// <p>The length of time that you want a zonal shift to be active, which ARC converts to an expiry time (expiration time). Zonal shifts are temporary. You can set a zonal shift to be active initially for up to three days (72 hours).</p>
119    /// <p>If you want to still keep traffic away from an Availability Zone, you can update the zonal shift and set a new expiration. You can also cancel a zonal shift, before it expires, for example, if you're ready to restore traffic to the Availability Zone.</p>
120    /// <p>To set a length of time for a zonal shift to be active, specify a whole number, and then one of the following, with no space:</p>
121    /// <ul>
122    /// <li>
123    /// <p><b>A lowercase letter m:</b> To specify that the value is in minutes.</p></li>
124    /// <li>
125    /// <p><b>A lowercase letter h:</b> To specify that the value is in hours.</p></li>
126    /// </ul>
127    /// <p>For example: <code>20h</code> means the zonal shift expires in 20 hours. <code>120m</code> means the zonal shift expires in 120 minutes (2 hours).</p>
128    pub fn get_expires_in(&self) -> &::std::option::Option<::std::string::String> {
129        &self.expires_in
130    }
131    /// Consumes the builder and constructs a [`UpdateZonalShiftInput`](crate::operation::update_zonal_shift::UpdateZonalShiftInput).
132    pub fn build(
133        self,
134    ) -> ::std::result::Result<crate::operation::update_zonal_shift::UpdateZonalShiftInput, ::aws_smithy_types::error::operation::BuildError> {
135        ::std::result::Result::Ok(crate::operation::update_zonal_shift::UpdateZonalShiftInput {
136            zonal_shift_id: self.zonal_shift_id,
137            comment: self.comment,
138            expires_in: self.expires_in,
139        })
140    }
141}