aws_sdk_shield/operation/update_subscription/
_update_subscription_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 UpdateSubscriptionInput {
6    /// <p>When you initally create a subscription, <code>AutoRenew</code> is set to <code>ENABLED</code>. If <code>ENABLED</code>, the subscription will be automatically renewed at the end of the existing subscription period. You can change this by submitting an <code>UpdateSubscription</code> request. If the <code>UpdateSubscription</code> request does not included a value for <code>AutoRenew</code>, the existing value for <code>AutoRenew</code> remains unchanged.</p>
7    pub auto_renew: ::std::option::Option<crate::types::AutoRenew>,
8}
9impl UpdateSubscriptionInput {
10    /// <p>When you initally create a subscription, <code>AutoRenew</code> is set to <code>ENABLED</code>. If <code>ENABLED</code>, the subscription will be automatically renewed at the end of the existing subscription period. You can change this by submitting an <code>UpdateSubscription</code> request. If the <code>UpdateSubscription</code> request does not included a value for <code>AutoRenew</code>, the existing value for <code>AutoRenew</code> remains unchanged.</p>
11    pub fn auto_renew(&self) -> ::std::option::Option<&crate::types::AutoRenew> {
12        self.auto_renew.as_ref()
13    }
14}
15impl UpdateSubscriptionInput {
16    /// Creates a new builder-style object to manufacture [`UpdateSubscriptionInput`](crate::operation::update_subscription::UpdateSubscriptionInput).
17    pub fn builder() -> crate::operation::update_subscription::builders::UpdateSubscriptionInputBuilder {
18        crate::operation::update_subscription::builders::UpdateSubscriptionInputBuilder::default()
19    }
20}
21
22/// A builder for [`UpdateSubscriptionInput`](crate::operation::update_subscription::UpdateSubscriptionInput).
23#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
24#[non_exhaustive]
25pub struct UpdateSubscriptionInputBuilder {
26    pub(crate) auto_renew: ::std::option::Option<crate::types::AutoRenew>,
27}
28impl UpdateSubscriptionInputBuilder {
29    /// <p>When you initally create a subscription, <code>AutoRenew</code> is set to <code>ENABLED</code>. If <code>ENABLED</code>, the subscription will be automatically renewed at the end of the existing subscription period. You can change this by submitting an <code>UpdateSubscription</code> request. If the <code>UpdateSubscription</code> request does not included a value for <code>AutoRenew</code>, the existing value for <code>AutoRenew</code> remains unchanged.</p>
30    pub fn auto_renew(mut self, input: crate::types::AutoRenew) -> Self {
31        self.auto_renew = ::std::option::Option::Some(input);
32        self
33    }
34    /// <p>When you initally create a subscription, <code>AutoRenew</code> is set to <code>ENABLED</code>. If <code>ENABLED</code>, the subscription will be automatically renewed at the end of the existing subscription period. You can change this by submitting an <code>UpdateSubscription</code> request. If the <code>UpdateSubscription</code> request does not included a value for <code>AutoRenew</code>, the existing value for <code>AutoRenew</code> remains unchanged.</p>
35    pub fn set_auto_renew(mut self, input: ::std::option::Option<crate::types::AutoRenew>) -> Self {
36        self.auto_renew = input;
37        self
38    }
39    /// <p>When you initally create a subscription, <code>AutoRenew</code> is set to <code>ENABLED</code>. If <code>ENABLED</code>, the subscription will be automatically renewed at the end of the existing subscription period. You can change this by submitting an <code>UpdateSubscription</code> request. If the <code>UpdateSubscription</code> request does not included a value for <code>AutoRenew</code>, the existing value for <code>AutoRenew</code> remains unchanged.</p>
40    pub fn get_auto_renew(&self) -> &::std::option::Option<crate::types::AutoRenew> {
41        &self.auto_renew
42    }
43    /// Consumes the builder and constructs a [`UpdateSubscriptionInput`](crate::operation::update_subscription::UpdateSubscriptionInput).
44    pub fn build(
45        self,
46    ) -> ::std::result::Result<crate::operation::update_subscription::UpdateSubscriptionInput, ::aws_smithy_types::error::operation::BuildError> {
47        ::std::result::Result::Ok(crate::operation::update_subscription::UpdateSubscriptionInput { auto_renew: self.auto_renew })
48    }
49}