aws-sdk-shield 1.98.0

AWS SDK for AWS Shield
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Information about the Shield Advanced subscription for an account.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Subscription {
    /// <p>The start time of the subscription, in Unix time in seconds.</p>
    pub start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The date and time your subscription will end.</p>
    pub end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The length, in seconds, of the Shield Advanced subscription for the account.</p>
    pub time_commitment_in_seconds: i64,
    /// <p>If <code>ENABLED</code>, the subscription will be automatically renewed at the end of the existing subscription period.</p>
    /// <p>When you initally create a subscription, <code>AutoRenew</code> is set to <code>ENABLED</code>. 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>
    pub auto_renew: ::std::option::Option<crate::types::AutoRenew>,
    /// <p>Specifies how many protections of a given type you can create.</p>
    pub limits: ::std::option::Option<::std::vec::Vec<crate::types::Limit>>,
    /// <p>If <code>ENABLED</code>, the Shield Response Team (SRT) will use email and phone to notify contacts about escalations to the SRT and to initiate proactive customer support.</p>
    /// <p>If <code>PENDING</code>, you have requested proactive engagement and the request is pending. The status changes to <code>ENABLED</code> when your request is fully processed.</p>
    /// <p>If <code>DISABLED</code>, the SRT will not proactively notify contacts about escalations or to initiate proactive customer support.</p>
    pub proactive_engagement_status: ::std::option::Option<crate::types::ProactiveEngagementStatus>,
    /// <p>Limits settings for your subscription.</p>
    pub subscription_limits: ::std::option::Option<crate::types::SubscriptionLimits>,
    /// <p>The ARN (Amazon Resource Name) of the subscription.</p>
    pub subscription_arn: ::std::option::Option<::std::string::String>,
}
impl Subscription {
    /// <p>The start time of the subscription, in Unix time in seconds.</p>
    pub fn start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.start_time.as_ref()
    }
    /// <p>The date and time your subscription will end.</p>
    pub fn end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.end_time.as_ref()
    }
    /// <p>The length, in seconds, of the Shield Advanced subscription for the account.</p>
    pub fn time_commitment_in_seconds(&self) -> i64 {
        self.time_commitment_in_seconds
    }
    /// <p>If <code>ENABLED</code>, the subscription will be automatically renewed at the end of the existing subscription period.</p>
    /// <p>When you initally create a subscription, <code>AutoRenew</code> is set to <code>ENABLED</code>. 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>
    pub fn auto_renew(&self) -> ::std::option::Option<&crate::types::AutoRenew> {
        self.auto_renew.as_ref()
    }
    /// <p>Specifies how many protections of a given type you can create.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.limits.is_none()`.
    pub fn limits(&self) -> &[crate::types::Limit] {
        self.limits.as_deref().unwrap_or_default()
    }
    /// <p>If <code>ENABLED</code>, the Shield Response Team (SRT) will use email and phone to notify contacts about escalations to the SRT and to initiate proactive customer support.</p>
    /// <p>If <code>PENDING</code>, you have requested proactive engagement and the request is pending. The status changes to <code>ENABLED</code> when your request is fully processed.</p>
    /// <p>If <code>DISABLED</code>, the SRT will not proactively notify contacts about escalations or to initiate proactive customer support.</p>
    pub fn proactive_engagement_status(&self) -> ::std::option::Option<&crate::types::ProactiveEngagementStatus> {
        self.proactive_engagement_status.as_ref()
    }
    /// <p>Limits settings for your subscription.</p>
    pub fn subscription_limits(&self) -> ::std::option::Option<&crate::types::SubscriptionLimits> {
        self.subscription_limits.as_ref()
    }
    /// <p>The ARN (Amazon Resource Name) of the subscription.</p>
    pub fn subscription_arn(&self) -> ::std::option::Option<&str> {
        self.subscription_arn.as_deref()
    }
}
impl Subscription {
    /// Creates a new builder-style object to manufacture [`Subscription`](crate::types::Subscription).
    pub fn builder() -> crate::types::builders::SubscriptionBuilder {
        crate::types::builders::SubscriptionBuilder::default()
    }
}

/// A builder for [`Subscription`](crate::types::Subscription).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SubscriptionBuilder {
    pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) time_commitment_in_seconds: ::std::option::Option<i64>,
    pub(crate) auto_renew: ::std::option::Option<crate::types::AutoRenew>,
    pub(crate) limits: ::std::option::Option<::std::vec::Vec<crate::types::Limit>>,
    pub(crate) proactive_engagement_status: ::std::option::Option<crate::types::ProactiveEngagementStatus>,
    pub(crate) subscription_limits: ::std::option::Option<crate::types::SubscriptionLimits>,
    pub(crate) subscription_arn: ::std::option::Option<::std::string::String>,
}
impl SubscriptionBuilder {
    /// <p>The start time of the subscription, in Unix time in seconds.</p>
    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.start_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The start time of the subscription, in Unix time in seconds.</p>
    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.start_time = input;
        self
    }
    /// <p>The start time of the subscription, in Unix time in seconds.</p>
    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.start_time
    }
    /// <p>The date and time your subscription will end.</p>
    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.end_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time your subscription will end.</p>
    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.end_time = input;
        self
    }
    /// <p>The date and time your subscription will end.</p>
    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.end_time
    }
    /// <p>The length, in seconds, of the Shield Advanced subscription for the account.</p>
    pub fn time_commitment_in_seconds(mut self, input: i64) -> Self {
        self.time_commitment_in_seconds = ::std::option::Option::Some(input);
        self
    }
    /// <p>The length, in seconds, of the Shield Advanced subscription for the account.</p>
    pub fn set_time_commitment_in_seconds(mut self, input: ::std::option::Option<i64>) -> Self {
        self.time_commitment_in_seconds = input;
        self
    }
    /// <p>The length, in seconds, of the Shield Advanced subscription for the account.</p>
    pub fn get_time_commitment_in_seconds(&self) -> &::std::option::Option<i64> {
        &self.time_commitment_in_seconds
    }
    /// <p>If <code>ENABLED</code>, the subscription will be automatically renewed at the end of the existing subscription period.</p>
    /// <p>When you initally create a subscription, <code>AutoRenew</code> is set to <code>ENABLED</code>. 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>
    pub fn auto_renew(mut self, input: crate::types::AutoRenew) -> Self {
        self.auto_renew = ::std::option::Option::Some(input);
        self
    }
    /// <p>If <code>ENABLED</code>, the subscription will be automatically renewed at the end of the existing subscription period.</p>
    /// <p>When you initally create a subscription, <code>AutoRenew</code> is set to <code>ENABLED</code>. 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>
    pub fn set_auto_renew(mut self, input: ::std::option::Option<crate::types::AutoRenew>) -> Self {
        self.auto_renew = input;
        self
    }
    /// <p>If <code>ENABLED</code>, the subscription will be automatically renewed at the end of the existing subscription period.</p>
    /// <p>When you initally create a subscription, <code>AutoRenew</code> is set to <code>ENABLED</code>. 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>
    pub fn get_auto_renew(&self) -> &::std::option::Option<crate::types::AutoRenew> {
        &self.auto_renew
    }
    /// Appends an item to `limits`.
    ///
    /// To override the contents of this collection use [`set_limits`](Self::set_limits).
    ///
    /// <p>Specifies how many protections of a given type you can create.</p>
    pub fn limits(mut self, input: crate::types::Limit) -> Self {
        let mut v = self.limits.unwrap_or_default();
        v.push(input);
        self.limits = ::std::option::Option::Some(v);
        self
    }
    /// <p>Specifies how many protections of a given type you can create.</p>
    pub fn set_limits(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Limit>>) -> Self {
        self.limits = input;
        self
    }
    /// <p>Specifies how many protections of a given type you can create.</p>
    pub fn get_limits(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Limit>> {
        &self.limits
    }
    /// <p>If <code>ENABLED</code>, the Shield Response Team (SRT) will use email and phone to notify contacts about escalations to the SRT and to initiate proactive customer support.</p>
    /// <p>If <code>PENDING</code>, you have requested proactive engagement and the request is pending. The status changes to <code>ENABLED</code> when your request is fully processed.</p>
    /// <p>If <code>DISABLED</code>, the SRT will not proactively notify contacts about escalations or to initiate proactive customer support.</p>
    pub fn proactive_engagement_status(mut self, input: crate::types::ProactiveEngagementStatus) -> Self {
        self.proactive_engagement_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>If <code>ENABLED</code>, the Shield Response Team (SRT) will use email and phone to notify contacts about escalations to the SRT and to initiate proactive customer support.</p>
    /// <p>If <code>PENDING</code>, you have requested proactive engagement and the request is pending. The status changes to <code>ENABLED</code> when your request is fully processed.</p>
    /// <p>If <code>DISABLED</code>, the SRT will not proactively notify contacts about escalations or to initiate proactive customer support.</p>
    pub fn set_proactive_engagement_status(mut self, input: ::std::option::Option<crate::types::ProactiveEngagementStatus>) -> Self {
        self.proactive_engagement_status = input;
        self
    }
    /// <p>If <code>ENABLED</code>, the Shield Response Team (SRT) will use email and phone to notify contacts about escalations to the SRT and to initiate proactive customer support.</p>
    /// <p>If <code>PENDING</code>, you have requested proactive engagement and the request is pending. The status changes to <code>ENABLED</code> when your request is fully processed.</p>
    /// <p>If <code>DISABLED</code>, the SRT will not proactively notify contacts about escalations or to initiate proactive customer support.</p>
    pub fn get_proactive_engagement_status(&self) -> &::std::option::Option<crate::types::ProactiveEngagementStatus> {
        &self.proactive_engagement_status
    }
    /// <p>Limits settings for your subscription.</p>
    /// This field is required.
    pub fn subscription_limits(mut self, input: crate::types::SubscriptionLimits) -> Self {
        self.subscription_limits = ::std::option::Option::Some(input);
        self
    }
    /// <p>Limits settings for your subscription.</p>
    pub fn set_subscription_limits(mut self, input: ::std::option::Option<crate::types::SubscriptionLimits>) -> Self {
        self.subscription_limits = input;
        self
    }
    /// <p>Limits settings for your subscription.</p>
    pub fn get_subscription_limits(&self) -> &::std::option::Option<crate::types::SubscriptionLimits> {
        &self.subscription_limits
    }
    /// <p>The ARN (Amazon Resource Name) of the subscription.</p>
    pub fn subscription_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.subscription_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN (Amazon Resource Name) of the subscription.</p>
    pub fn set_subscription_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.subscription_arn = input;
        self
    }
    /// <p>The ARN (Amazon Resource Name) of the subscription.</p>
    pub fn get_subscription_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.subscription_arn
    }
    /// Consumes the builder and constructs a [`Subscription`](crate::types::Subscription).
    pub fn build(self) -> crate::types::Subscription {
        crate::types::Subscription {
            start_time: self.start_time,
            end_time: self.end_time,
            time_commitment_in_seconds: self.time_commitment_in_seconds.unwrap_or_default(),
            auto_renew: self.auto_renew,
            limits: self.limits,
            proactive_engagement_status: self.proactive_engagement_status,
            subscription_limits: self.subscription_limits,
            subscription_arn: self.subscription_arn,
        }
    }
}