Skip to main content

aws_sdk_securityhub/types/
_aws_code_build_project_vpc_config.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Information about the VPC configuration that CodeBuild accesses.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AwsCodeBuildProjectVpcConfig {
7    /// <p>The ID of the VPC.</p>
8    pub vpc_id: ::std::option::Option<::std::string::String>,
9    /// <p>A list of one or more subnet IDs in your VPC.</p>
10    pub subnets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
11    /// <p>A list of one or more security group IDs in your VPC.</p>
12    pub security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
13}
14impl AwsCodeBuildProjectVpcConfig {
15    /// <p>The ID of the VPC.</p>
16    pub fn vpc_id(&self) -> ::std::option::Option<&str> {
17        self.vpc_id.as_deref()
18    }
19    /// <p>A list of one or more subnet IDs in your VPC.</p>
20    ///
21    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.subnets.is_none()`.
22    pub fn subnets(&self) -> &[::std::string::String] {
23        self.subnets.as_deref().unwrap_or_default()
24    }
25    /// <p>A list of one or more security group IDs in your VPC.</p>
26    ///
27    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.security_group_ids.is_none()`.
28    pub fn security_group_ids(&self) -> &[::std::string::String] {
29        self.security_group_ids.as_deref().unwrap_or_default()
30    }
31}
32impl AwsCodeBuildProjectVpcConfig {
33    /// Creates a new builder-style object to manufacture [`AwsCodeBuildProjectVpcConfig`](crate::types::AwsCodeBuildProjectVpcConfig).
34    pub fn builder() -> crate::types::builders::AwsCodeBuildProjectVpcConfigBuilder {
35        crate::types::builders::AwsCodeBuildProjectVpcConfigBuilder::default()
36    }
37}
38
39/// A builder for [`AwsCodeBuildProjectVpcConfig`](crate::types::AwsCodeBuildProjectVpcConfig).
40#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
41#[non_exhaustive]
42pub struct AwsCodeBuildProjectVpcConfigBuilder {
43    pub(crate) vpc_id: ::std::option::Option<::std::string::String>,
44    pub(crate) subnets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
45    pub(crate) security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
46}
47impl AwsCodeBuildProjectVpcConfigBuilder {
48    /// <p>The ID of the VPC.</p>
49    pub fn vpc_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
50        self.vpc_id = ::std::option::Option::Some(input.into());
51        self
52    }
53    /// <p>The ID of the VPC.</p>
54    pub fn set_vpc_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
55        self.vpc_id = input;
56        self
57    }
58    /// <p>The ID of the VPC.</p>
59    pub fn get_vpc_id(&self) -> &::std::option::Option<::std::string::String> {
60        &self.vpc_id
61    }
62    /// Appends an item to `subnets`.
63    ///
64    /// To override the contents of this collection use [`set_subnets`](Self::set_subnets).
65    ///
66    /// <p>A list of one or more subnet IDs in your VPC.</p>
67    pub fn subnets(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        let mut v = self.subnets.unwrap_or_default();
69        v.push(input.into());
70        self.subnets = ::std::option::Option::Some(v);
71        self
72    }
73    /// <p>A list of one or more subnet IDs in your VPC.</p>
74    pub fn set_subnets(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
75        self.subnets = input;
76        self
77    }
78    /// <p>A list of one or more subnet IDs in your VPC.</p>
79    pub fn get_subnets(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
80        &self.subnets
81    }
82    /// Appends an item to `security_group_ids`.
83    ///
84    /// To override the contents of this collection use [`set_security_group_ids`](Self::set_security_group_ids).
85    ///
86    /// <p>A list of one or more security group IDs in your VPC.</p>
87    pub fn security_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
88        let mut v = self.security_group_ids.unwrap_or_default();
89        v.push(input.into());
90        self.security_group_ids = ::std::option::Option::Some(v);
91        self
92    }
93    /// <p>A list of one or more security group IDs in your VPC.</p>
94    pub fn set_security_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
95        self.security_group_ids = input;
96        self
97    }
98    /// <p>A list of one or more security group IDs in your VPC.</p>
99    pub fn get_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
100        &self.security_group_ids
101    }
102    /// Consumes the builder and constructs a [`AwsCodeBuildProjectVpcConfig`](crate::types::AwsCodeBuildProjectVpcConfig).
103    pub fn build(self) -> crate::types::AwsCodeBuildProjectVpcConfig {
104        crate::types::AwsCodeBuildProjectVpcConfig {
105            vpc_id: self.vpc_id,
106            subnets: self.subnets,
107            security_group_ids: self.security_group_ids,
108        }
109    }
110}