aws_sdk_elasticbeanstalk/types/
_application_version_lifecycle_config.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The application version lifecycle settings for an application. Defines the rules that Elastic Beanstalk applies to an application's versions in order to avoid hitting the per-region limit for application versions.</p>
4/// <p>When Elastic Beanstalk deletes an application version from its database, you can no longer deploy that version to an environment. The source bundle remains in S3 unless you configure the rule to delete it.</p>
5#[non_exhaustive]
6#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
7pub struct ApplicationVersionLifecycleConfig {
8    /// <p>Specify a max count rule to restrict the number of application versions that are retained for an application.</p>
9    pub max_count_rule: ::std::option::Option<crate::types::MaxCountRule>,
10    /// <p>Specify a max age rule to restrict the length of time that application versions are retained for an application.</p>
11    pub max_age_rule: ::std::option::Option<crate::types::MaxAgeRule>,
12}
13impl ApplicationVersionLifecycleConfig {
14    /// <p>Specify a max count rule to restrict the number of application versions that are retained for an application.</p>
15    pub fn max_count_rule(&self) -> ::std::option::Option<&crate::types::MaxCountRule> {
16        self.max_count_rule.as_ref()
17    }
18    /// <p>Specify a max age rule to restrict the length of time that application versions are retained for an application.</p>
19    pub fn max_age_rule(&self) -> ::std::option::Option<&crate::types::MaxAgeRule> {
20        self.max_age_rule.as_ref()
21    }
22}
23impl ApplicationVersionLifecycleConfig {
24    /// Creates a new builder-style object to manufacture [`ApplicationVersionLifecycleConfig`](crate::types::ApplicationVersionLifecycleConfig).
25    pub fn builder() -> crate::types::builders::ApplicationVersionLifecycleConfigBuilder {
26        crate::types::builders::ApplicationVersionLifecycleConfigBuilder::default()
27    }
28}
29
30/// A builder for [`ApplicationVersionLifecycleConfig`](crate::types::ApplicationVersionLifecycleConfig).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct ApplicationVersionLifecycleConfigBuilder {
34    pub(crate) max_count_rule: ::std::option::Option<crate::types::MaxCountRule>,
35    pub(crate) max_age_rule: ::std::option::Option<crate::types::MaxAgeRule>,
36}
37impl ApplicationVersionLifecycleConfigBuilder {
38    /// <p>Specify a max count rule to restrict the number of application versions that are retained for an application.</p>
39    pub fn max_count_rule(mut self, input: crate::types::MaxCountRule) -> Self {
40        self.max_count_rule = ::std::option::Option::Some(input);
41        self
42    }
43    /// <p>Specify a max count rule to restrict the number of application versions that are retained for an application.</p>
44    pub fn set_max_count_rule(mut self, input: ::std::option::Option<crate::types::MaxCountRule>) -> Self {
45        self.max_count_rule = input;
46        self
47    }
48    /// <p>Specify a max count rule to restrict the number of application versions that are retained for an application.</p>
49    pub fn get_max_count_rule(&self) -> &::std::option::Option<crate::types::MaxCountRule> {
50        &self.max_count_rule
51    }
52    /// <p>Specify a max age rule to restrict the length of time that application versions are retained for an application.</p>
53    pub fn max_age_rule(mut self, input: crate::types::MaxAgeRule) -> Self {
54        self.max_age_rule = ::std::option::Option::Some(input);
55        self
56    }
57    /// <p>Specify a max age rule to restrict the length of time that application versions are retained for an application.</p>
58    pub fn set_max_age_rule(mut self, input: ::std::option::Option<crate::types::MaxAgeRule>) -> Self {
59        self.max_age_rule = input;
60        self
61    }
62    /// <p>Specify a max age rule to restrict the length of time that application versions are retained for an application.</p>
63    pub fn get_max_age_rule(&self) -> &::std::option::Option<crate::types::MaxAgeRule> {
64        &self.max_age_rule
65    }
66    /// Consumes the builder and constructs a [`ApplicationVersionLifecycleConfig`](crate::types::ApplicationVersionLifecycleConfig).
67    pub fn build(self) -> crate::types::ApplicationVersionLifecycleConfig {
68        crate::types::ApplicationVersionLifecycleConfig {
69            max_count_rule: self.max_count_rule,
70            max_age_rule: self.max_age_rule,
71        }
72    }
73}