#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CoreNetworkPolicy {
pub core_network_id: ::std::option::Option<::std::string::String>,
pub policy_version_id: ::std::option::Option<i32>,
pub alias: ::std::option::Option<crate::types::CoreNetworkPolicyAlias>,
pub description: ::std::option::Option<::std::string::String>,
pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub change_set_state: ::std::option::Option<crate::types::ChangeSetState>,
pub policy_errors: ::std::option::Option<::std::vec::Vec<crate::types::CoreNetworkPolicyError>>,
pub policy_document: ::std::option::Option<::std::string::String>,
}
impl CoreNetworkPolicy {
pub fn core_network_id(&self) -> ::std::option::Option<&str> {
self.core_network_id.as_deref()
}
pub fn policy_version_id(&self) -> ::std::option::Option<i32> {
self.policy_version_id
}
pub fn alias(&self) -> ::std::option::Option<&crate::types::CoreNetworkPolicyAlias> {
self.alias.as_ref()
}
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.created_at.as_ref()
}
pub fn change_set_state(&self) -> ::std::option::Option<&crate::types::ChangeSetState> {
self.change_set_state.as_ref()
}
pub fn policy_errors(&self) -> &[crate::types::CoreNetworkPolicyError] {
self.policy_errors.as_deref().unwrap_or_default()
}
pub fn policy_document(&self) -> ::std::option::Option<&str> {
self.policy_document.as_deref()
}
}
impl CoreNetworkPolicy {
pub fn builder() -> crate::types::builders::CoreNetworkPolicyBuilder {
crate::types::builders::CoreNetworkPolicyBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CoreNetworkPolicyBuilder {
pub(crate) core_network_id: ::std::option::Option<::std::string::String>,
pub(crate) policy_version_id: ::std::option::Option<i32>,
pub(crate) alias: ::std::option::Option<crate::types::CoreNetworkPolicyAlias>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) change_set_state: ::std::option::Option<crate::types::ChangeSetState>,
pub(crate) policy_errors: ::std::option::Option<::std::vec::Vec<crate::types::CoreNetworkPolicyError>>,
pub(crate) policy_document: ::std::option::Option<::std::string::String>,
}
impl CoreNetworkPolicyBuilder {
pub fn core_network_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.core_network_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_core_network_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.core_network_id = input;
self
}
pub fn get_core_network_id(&self) -> &::std::option::Option<::std::string::String> {
&self.core_network_id
}
pub fn policy_version_id(mut self, input: i32) -> Self {
self.policy_version_id = ::std::option::Option::Some(input);
self
}
pub fn set_policy_version_id(mut self, input: ::std::option::Option<i32>) -> Self {
self.policy_version_id = input;
self
}
pub fn get_policy_version_id(&self) -> &::std::option::Option<i32> {
&self.policy_version_id
}
pub fn alias(mut self, input: crate::types::CoreNetworkPolicyAlias) -> Self {
self.alias = ::std::option::Option::Some(input);
self
}
pub fn set_alias(mut self, input: ::std::option::Option<crate::types::CoreNetworkPolicyAlias>) -> Self {
self.alias = input;
self
}
pub fn get_alias(&self) -> &::std::option::Option<crate::types::CoreNetworkPolicyAlias> {
&self.alias
}
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_at = ::std::option::Option::Some(input);
self
}
pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_at = input;
self
}
pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_at
}
pub fn change_set_state(mut self, input: crate::types::ChangeSetState) -> Self {
self.change_set_state = ::std::option::Option::Some(input);
self
}
pub fn set_change_set_state(mut self, input: ::std::option::Option<crate::types::ChangeSetState>) -> Self {
self.change_set_state = input;
self
}
pub fn get_change_set_state(&self) -> &::std::option::Option<crate::types::ChangeSetState> {
&self.change_set_state
}
pub fn policy_errors(mut self, input: crate::types::CoreNetworkPolicyError) -> Self {
let mut v = self.policy_errors.unwrap_or_default();
v.push(input);
self.policy_errors = ::std::option::Option::Some(v);
self
}
pub fn set_policy_errors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CoreNetworkPolicyError>>) -> Self {
self.policy_errors = input;
self
}
pub fn get_policy_errors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CoreNetworkPolicyError>> {
&self.policy_errors
}
pub fn policy_document(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.policy_document = ::std::option::Option::Some(input.into());
self
}
pub fn set_policy_document(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.policy_document = input;
self
}
pub fn get_policy_document(&self) -> &::std::option::Option<::std::string::String> {
&self.policy_document
}
pub fn build(self) -> crate::types::CoreNetworkPolicy {
crate::types::CoreNetworkPolicy {
core_network_id: self.core_network_id,
policy_version_id: self.policy_version_id,
alias: self.alias,
description: self.description,
created_at: self.created_at,
change_set_state: self.change_set_state,
policy_errors: self.policy_errors,
policy_document: self.policy_document,
}
}
}