#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Vpc {
pub owner_id: ::std::option::Option<::std::string::String>,
pub instance_tenancy: ::std::option::Option<crate::types::Tenancy>,
pub ipv6_cidr_block_association_set: ::std::option::Option<::std::vec::Vec<crate::types::VpcIpv6CidrBlockAssociation>>,
pub cidr_block_association_set: ::std::option::Option<::std::vec::Vec<crate::types::VpcCidrBlockAssociation>>,
pub is_default: ::std::option::Option<bool>,
pub encryption_control: ::std::option::Option<crate::types::VpcEncryptionControl>,
pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
pub block_public_access_states: ::std::option::Option<crate::types::BlockPublicAccessStates>,
pub vpc_id: ::std::option::Option<::std::string::String>,
pub state: ::std::option::Option<crate::types::VpcState>,
pub cidr_block: ::std::option::Option<::std::string::String>,
pub dhcp_options_id: ::std::option::Option<::std::string::String>,
}
impl Vpc {
pub fn owner_id(&self) -> ::std::option::Option<&str> {
self.owner_id.as_deref()
}
pub fn instance_tenancy(&self) -> ::std::option::Option<&crate::types::Tenancy> {
self.instance_tenancy.as_ref()
}
pub fn ipv6_cidr_block_association_set(&self) -> &[crate::types::VpcIpv6CidrBlockAssociation] {
self.ipv6_cidr_block_association_set.as_deref().unwrap_or_default()
}
pub fn cidr_block_association_set(&self) -> &[crate::types::VpcCidrBlockAssociation] {
self.cidr_block_association_set.as_deref().unwrap_or_default()
}
pub fn is_default(&self) -> ::std::option::Option<bool> {
self.is_default
}
pub fn encryption_control(&self) -> ::std::option::Option<&crate::types::VpcEncryptionControl> {
self.encryption_control.as_ref()
}
pub fn tags(&self) -> &[crate::types::Tag] {
self.tags.as_deref().unwrap_or_default()
}
pub fn block_public_access_states(&self) -> ::std::option::Option<&crate::types::BlockPublicAccessStates> {
self.block_public_access_states.as_ref()
}
pub fn vpc_id(&self) -> ::std::option::Option<&str> {
self.vpc_id.as_deref()
}
pub fn state(&self) -> ::std::option::Option<&crate::types::VpcState> {
self.state.as_ref()
}
pub fn cidr_block(&self) -> ::std::option::Option<&str> {
self.cidr_block.as_deref()
}
pub fn dhcp_options_id(&self) -> ::std::option::Option<&str> {
self.dhcp_options_id.as_deref()
}
}
impl Vpc {
pub fn builder() -> crate::types::builders::VpcBuilder {
crate::types::builders::VpcBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct VpcBuilder {
pub(crate) owner_id: ::std::option::Option<::std::string::String>,
pub(crate) instance_tenancy: ::std::option::Option<crate::types::Tenancy>,
pub(crate) ipv6_cidr_block_association_set: ::std::option::Option<::std::vec::Vec<crate::types::VpcIpv6CidrBlockAssociation>>,
pub(crate) cidr_block_association_set: ::std::option::Option<::std::vec::Vec<crate::types::VpcCidrBlockAssociation>>,
pub(crate) is_default: ::std::option::Option<bool>,
pub(crate) encryption_control: ::std::option::Option<crate::types::VpcEncryptionControl>,
pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
pub(crate) block_public_access_states: ::std::option::Option<crate::types::BlockPublicAccessStates>,
pub(crate) vpc_id: ::std::option::Option<::std::string::String>,
pub(crate) state: ::std::option::Option<crate::types::VpcState>,
pub(crate) cidr_block: ::std::option::Option<::std::string::String>,
pub(crate) dhcp_options_id: ::std::option::Option<::std::string::String>,
}
impl VpcBuilder {
pub fn owner_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.owner_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_owner_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.owner_id = input;
self
}
pub fn get_owner_id(&self) -> &::std::option::Option<::std::string::String> {
&self.owner_id
}
pub fn instance_tenancy(mut self, input: crate::types::Tenancy) -> Self {
self.instance_tenancy = ::std::option::Option::Some(input);
self
}
pub fn set_instance_tenancy(mut self, input: ::std::option::Option<crate::types::Tenancy>) -> Self {
self.instance_tenancy = input;
self
}
pub fn get_instance_tenancy(&self) -> &::std::option::Option<crate::types::Tenancy> {
&self.instance_tenancy
}
pub fn ipv6_cidr_block_association_set(mut self, input: crate::types::VpcIpv6CidrBlockAssociation) -> Self {
let mut v = self.ipv6_cidr_block_association_set.unwrap_or_default();
v.push(input);
self.ipv6_cidr_block_association_set = ::std::option::Option::Some(v);
self
}
pub fn set_ipv6_cidr_block_association_set(
mut self,
input: ::std::option::Option<::std::vec::Vec<crate::types::VpcIpv6CidrBlockAssociation>>,
) -> Self {
self.ipv6_cidr_block_association_set = input;
self
}
pub fn get_ipv6_cidr_block_association_set(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VpcIpv6CidrBlockAssociation>> {
&self.ipv6_cidr_block_association_set
}
pub fn cidr_block_association_set(mut self, input: crate::types::VpcCidrBlockAssociation) -> Self {
let mut v = self.cidr_block_association_set.unwrap_or_default();
v.push(input);
self.cidr_block_association_set = ::std::option::Option::Some(v);
self
}
pub fn set_cidr_block_association_set(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VpcCidrBlockAssociation>>) -> Self {
self.cidr_block_association_set = input;
self
}
pub fn get_cidr_block_association_set(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VpcCidrBlockAssociation>> {
&self.cidr_block_association_set
}
pub fn is_default(mut self, input: bool) -> Self {
self.is_default = ::std::option::Option::Some(input);
self
}
pub fn set_is_default(mut self, input: ::std::option::Option<bool>) -> Self {
self.is_default = input;
self
}
pub fn get_is_default(&self) -> &::std::option::Option<bool> {
&self.is_default
}
pub fn encryption_control(mut self, input: crate::types::VpcEncryptionControl) -> Self {
self.encryption_control = ::std::option::Option::Some(input);
self
}
pub fn set_encryption_control(mut self, input: ::std::option::Option<crate::types::VpcEncryptionControl>) -> Self {
self.encryption_control = input;
self
}
pub fn get_encryption_control(&self) -> &::std::option::Option<crate::types::VpcEncryptionControl> {
&self.encryption_control
}
pub fn tags(mut self, input: crate::types::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = ::std::option::Option::Some(v);
self
}
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.tags = input;
self
}
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
&self.tags
}
pub fn block_public_access_states(mut self, input: crate::types::BlockPublicAccessStates) -> Self {
self.block_public_access_states = ::std::option::Option::Some(input);
self
}
pub fn set_block_public_access_states(mut self, input: ::std::option::Option<crate::types::BlockPublicAccessStates>) -> Self {
self.block_public_access_states = input;
self
}
pub fn get_block_public_access_states(&self) -> &::std::option::Option<crate::types::BlockPublicAccessStates> {
&self.block_public_access_states
}
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
}
pub fn set_vpc_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.vpc_id = input;
self
}
pub fn get_vpc_id(&self) -> &::std::option::Option<::std::string::String> {
&self.vpc_id
}
pub fn state(mut self, input: crate::types::VpcState) -> Self {
self.state = ::std::option::Option::Some(input);
self
}
pub fn set_state(mut self, input: ::std::option::Option<crate::types::VpcState>) -> Self {
self.state = input;
self
}
pub fn get_state(&self) -> &::std::option::Option<crate::types::VpcState> {
&self.state
}
pub fn cidr_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.cidr_block = ::std::option::Option::Some(input.into());
self
}
pub fn set_cidr_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.cidr_block = input;
self
}
pub fn get_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
&self.cidr_block
}
pub fn dhcp_options_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.dhcp_options_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_dhcp_options_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.dhcp_options_id = input;
self
}
pub fn get_dhcp_options_id(&self) -> &::std::option::Option<::std::string::String> {
&self.dhcp_options_id
}
pub fn build(self) -> crate::types::Vpc {
crate::types::Vpc {
owner_id: self.owner_id,
instance_tenancy: self.instance_tenancy,
ipv6_cidr_block_association_set: self.ipv6_cidr_block_association_set,
cidr_block_association_set: self.cidr_block_association_set,
is_default: self.is_default,
encryption_control: self.encryption_control,
tags: self.tags,
block_public_access_states: self.block_public_access_states,
vpc_id: self.vpc_id,
state: self.state,
cidr_block: self.cidr_block,
dhcp_options_id: self.dhcp_options_id,
}
}
}