1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Information about the VPC configuration that CodeBuild accesses.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct AwsCodeBuildProjectVpcConfig {
    /// <p>The ID of the VPC.</p>
    pub vpc_id: ::std::option::Option<::std::string::String>,
    /// <p>A list of one or more subnet IDs in your VPC.</p>
    pub subnets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>A list of one or more security group IDs in your VPC.</p>
    pub security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl AwsCodeBuildProjectVpcConfig {
    /// <p>The ID of the VPC.</p>
    pub fn vpc_id(&self) -> ::std::option::Option<&str> {
        self.vpc_id.as_deref()
    }
    /// <p>A list of one or more subnet IDs in your VPC.</p>
    pub fn subnets(&self) -> ::std::option::Option<&[::std::string::String]> {
        self.subnets.as_deref()
    }
    /// <p>A list of one or more security group IDs in your VPC.</p>
    pub fn security_group_ids(&self) -> ::std::option::Option<&[::std::string::String]> {
        self.security_group_ids.as_deref()
    }
}
impl AwsCodeBuildProjectVpcConfig {
    /// Creates a new builder-style object to manufacture [`AwsCodeBuildProjectVpcConfig`](crate::types::AwsCodeBuildProjectVpcConfig).
    pub fn builder() -> crate::types::builders::AwsCodeBuildProjectVpcConfigBuilder {
        crate::types::builders::AwsCodeBuildProjectVpcConfigBuilder::default()
    }
}

/// A builder for [`AwsCodeBuildProjectVpcConfig`](crate::types::AwsCodeBuildProjectVpcConfig).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct AwsCodeBuildProjectVpcConfigBuilder {
    pub(crate) vpc_id: ::std::option::Option<::std::string::String>,
    pub(crate) subnets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl AwsCodeBuildProjectVpcConfigBuilder {
    /// <p>The ID of the VPC.</p>
    pub fn vpc_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.vpc_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the VPC.</p>
    pub fn set_vpc_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.vpc_id = input;
        self
    }
    /// <p>The ID of the VPC.</p>
    pub fn get_vpc_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.vpc_id
    }
    /// Appends an item to `subnets`.
    ///
    /// To override the contents of this collection use [`set_subnets`](Self::set_subnets).
    ///
    /// <p>A list of one or more subnet IDs in your VPC.</p>
    pub fn subnets(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.subnets.unwrap_or_default();
        v.push(input.into());
        self.subnets = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of one or more subnet IDs in your VPC.</p>
    pub fn set_subnets(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.subnets = input;
        self
    }
    /// <p>A list of one or more subnet IDs in your VPC.</p>
    pub fn get_subnets(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.subnets
    }
    /// Appends an item to `security_group_ids`.
    ///
    /// To override the contents of this collection use [`set_security_group_ids`](Self::set_security_group_ids).
    ///
    /// <p>A list of one or more security group IDs in your VPC.</p>
    pub fn security_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.security_group_ids.unwrap_or_default();
        v.push(input.into());
        self.security_group_ids = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of one or more security group IDs in your VPC.</p>
    pub fn set_security_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.security_group_ids = input;
        self
    }
    /// <p>A list of one or more security group IDs in your VPC.</p>
    pub fn get_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.security_group_ids
    }
    /// Consumes the builder and constructs a [`AwsCodeBuildProjectVpcConfig`](crate::types::AwsCodeBuildProjectVpcConfig).
    pub fn build(self) -> crate::types::AwsCodeBuildProjectVpcConfig {
        crate::types::AwsCodeBuildProjectVpcConfig {
            vpc_id: self.vpc_id,
            subnets: self.subnets,
            security_group_ids: self.security_group_ids,
        }
    }
}