Skip to main content

aws_sdk_cloudformation/types/
_stack_set_auto_deployment_target_summary.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>One of the targets for the StackSet. Returned by the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListStackSetAutoDeploymentTargets.html">ListStackSetAutoDeploymentTargets</a> API operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct StackSetAutoDeploymentTargetSummary {
7    /// <p>The organization root ID or organizational unit (OU) IDs where the StackSet is targeted.</p>
8    pub organizational_unit_id: ::std::option::Option<::std::string::String>,
9    /// <p>The list of Regions targeted for this organization or OU.</p>
10    pub regions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
11}
12impl StackSetAutoDeploymentTargetSummary {
13    /// <p>The organization root ID or organizational unit (OU) IDs where the StackSet is targeted.</p>
14    pub fn organizational_unit_id(&self) -> ::std::option::Option<&str> {
15        self.organizational_unit_id.as_deref()
16    }
17    /// <p>The list of Regions targeted for this organization or OU.</p>
18    ///
19    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.regions.is_none()`.
20    pub fn regions(&self) -> &[::std::string::String] {
21        self.regions.as_deref().unwrap_or_default()
22    }
23}
24impl StackSetAutoDeploymentTargetSummary {
25    /// Creates a new builder-style object to manufacture [`StackSetAutoDeploymentTargetSummary`](crate::types::StackSetAutoDeploymentTargetSummary).
26    pub fn builder() -> crate::types::builders::StackSetAutoDeploymentTargetSummaryBuilder {
27        crate::types::builders::StackSetAutoDeploymentTargetSummaryBuilder::default()
28    }
29}
30
31/// A builder for [`StackSetAutoDeploymentTargetSummary`](crate::types::StackSetAutoDeploymentTargetSummary).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct StackSetAutoDeploymentTargetSummaryBuilder {
35    pub(crate) organizational_unit_id: ::std::option::Option<::std::string::String>,
36    pub(crate) regions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
37}
38impl StackSetAutoDeploymentTargetSummaryBuilder {
39    /// <p>The organization root ID or organizational unit (OU) IDs where the StackSet is targeted.</p>
40    pub fn organizational_unit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41        self.organizational_unit_id = ::std::option::Option::Some(input.into());
42        self
43    }
44    /// <p>The organization root ID or organizational unit (OU) IDs where the StackSet is targeted.</p>
45    pub fn set_organizational_unit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46        self.organizational_unit_id = input;
47        self
48    }
49    /// <p>The organization root ID or organizational unit (OU) IDs where the StackSet is targeted.</p>
50    pub fn get_organizational_unit_id(&self) -> &::std::option::Option<::std::string::String> {
51        &self.organizational_unit_id
52    }
53    /// Appends an item to `regions`.
54    ///
55    /// To override the contents of this collection use [`set_regions`](Self::set_regions).
56    ///
57    /// <p>The list of Regions targeted for this organization or OU.</p>
58    pub fn regions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59        let mut v = self.regions.unwrap_or_default();
60        v.push(input.into());
61        self.regions = ::std::option::Option::Some(v);
62        self
63    }
64    /// <p>The list of Regions targeted for this organization or OU.</p>
65    pub fn set_regions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
66        self.regions = input;
67        self
68    }
69    /// <p>The list of Regions targeted for this organization or OU.</p>
70    pub fn get_regions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
71        &self.regions
72    }
73    /// Consumes the builder and constructs a [`StackSetAutoDeploymentTargetSummary`](crate::types::StackSetAutoDeploymentTargetSummary).
74    pub fn build(self) -> crate::types::StackSetAutoDeploymentTargetSummary {
75        crate::types::StackSetAutoDeploymentTargetSummary {
76            organizational_unit_id: self.organizational_unit_id,
77            regions: self.regions,
78        }
79    }
80}