#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateTemplateOutput {
pub template_id: ::std::string::String,
pub template_arn: ::std::string::String,
pub template_name: ::std::string::String,
pub template_description: ::std::option::Option<::std::string::String>,
pub status: crate::types::EntityStatus,
pub version: ::std::string::String,
pub associated_rule_list: ::std::vec::Vec<crate::types::AssociatedRule>,
pub update_token: ::std::option::Option<::std::string::String>,
pub is_snapshot: ::std::option::Option<bool>,
pub has_published_version: ::std::option::Option<bool>,
pub firewall_type: crate::types::TemplateFirewallType,
pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
_request_id: Option<String>,
}
impl CreateTemplateOutput {
pub fn template_id(&self) -> &str {
use std::ops::Deref;
self.template_id.deref()
}
pub fn template_arn(&self) -> &str {
use std::ops::Deref;
self.template_arn.deref()
}
pub fn template_name(&self) -> &str {
use std::ops::Deref;
self.template_name.deref()
}
pub fn template_description(&self) -> ::std::option::Option<&str> {
self.template_description.as_deref()
}
pub fn status(&self) -> &crate::types::EntityStatus {
&self.status
}
pub fn version(&self) -> &str {
use std::ops::Deref;
self.version.deref()
}
pub fn associated_rule_list(&self) -> &[crate::types::AssociatedRule] {
use std::ops::Deref;
self.associated_rule_list.deref()
}
pub fn update_token(&self) -> ::std::option::Option<&str> {
self.update_token.as_deref()
}
pub fn is_snapshot(&self) -> ::std::option::Option<bool> {
self.is_snapshot
}
pub fn has_published_version(&self) -> ::std::option::Option<bool> {
self.has_published_version
}
pub fn firewall_type(&self) -> &crate::types::TemplateFirewallType {
&self.firewall_type
}
pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.updated_at.as_ref()
}
}
impl ::aws_types::request_id::RequestId for CreateTemplateOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl CreateTemplateOutput {
pub fn builder() -> crate::operation::create_template::builders::CreateTemplateOutputBuilder {
crate::operation::create_template::builders::CreateTemplateOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateTemplateOutputBuilder {
pub(crate) template_id: ::std::option::Option<::std::string::String>,
pub(crate) template_arn: ::std::option::Option<::std::string::String>,
pub(crate) template_name: ::std::option::Option<::std::string::String>,
pub(crate) template_description: ::std::option::Option<::std::string::String>,
pub(crate) status: ::std::option::Option<crate::types::EntityStatus>,
pub(crate) version: ::std::option::Option<::std::string::String>,
pub(crate) associated_rule_list: ::std::option::Option<::std::vec::Vec<crate::types::AssociatedRule>>,
pub(crate) update_token: ::std::option::Option<::std::string::String>,
pub(crate) is_snapshot: ::std::option::Option<bool>,
pub(crate) has_published_version: ::std::option::Option<bool>,
pub(crate) firewall_type: ::std::option::Option<crate::types::TemplateFirewallType>,
pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
_request_id: Option<String>,
}
impl CreateTemplateOutputBuilder {
pub fn template_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.template_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_template_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.template_id = input;
self
}
pub fn get_template_id(&self) -> &::std::option::Option<::std::string::String> {
&self.template_id
}
pub fn template_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.template_arn = ::std::option::Option::Some(input.into());
self
}
pub fn set_template_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.template_arn = input;
self
}
pub fn get_template_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.template_arn
}
pub fn template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.template_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.template_name = input;
self
}
pub fn get_template_name(&self) -> &::std::option::Option<::std::string::String> {
&self.template_name
}
pub fn template_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.template_description = ::std::option::Option::Some(input.into());
self
}
pub fn set_template_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.template_description = input;
self
}
pub fn get_template_description(&self) -> &::std::option::Option<::std::string::String> {
&self.template_description
}
pub fn status(mut self, input: crate::types::EntityStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
pub fn set_status(mut self, input: ::std::option::Option<crate::types::EntityStatus>) -> Self {
self.status = input;
self
}
pub fn get_status(&self) -> &::std::option::Option<crate::types::EntityStatus> {
&self.status
}
pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.version = ::std::option::Option::Some(input.into());
self
}
pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.version = input;
self
}
pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
&self.version
}
pub fn associated_rule_list(mut self, input: crate::types::AssociatedRule) -> Self {
let mut v = self.associated_rule_list.unwrap_or_default();
v.push(input);
self.associated_rule_list = ::std::option::Option::Some(v);
self
}
pub fn set_associated_rule_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AssociatedRule>>) -> Self {
self.associated_rule_list = input;
self
}
pub fn get_associated_rule_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssociatedRule>> {
&self.associated_rule_list
}
pub fn update_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.update_token = ::std::option::Option::Some(input.into());
self
}
pub fn set_update_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.update_token = input;
self
}
pub fn get_update_token(&self) -> &::std::option::Option<::std::string::String> {
&self.update_token
}
pub fn is_snapshot(mut self, input: bool) -> Self {
self.is_snapshot = ::std::option::Option::Some(input);
self
}
pub fn set_is_snapshot(mut self, input: ::std::option::Option<bool>) -> Self {
self.is_snapshot = input;
self
}
pub fn get_is_snapshot(&self) -> &::std::option::Option<bool> {
&self.is_snapshot
}
pub fn has_published_version(mut self, input: bool) -> Self {
self.has_published_version = ::std::option::Option::Some(input);
self
}
pub fn set_has_published_version(mut self, input: ::std::option::Option<bool>) -> Self {
self.has_published_version = input;
self
}
pub fn get_has_published_version(&self) -> &::std::option::Option<bool> {
&self.has_published_version
}
pub fn firewall_type(mut self, input: crate::types::TemplateFirewallType) -> Self {
self.firewall_type = ::std::option::Option::Some(input);
self
}
pub fn set_firewall_type(mut self, input: ::std::option::Option<crate::types::TemplateFirewallType>) -> Self {
self.firewall_type = input;
self
}
pub fn get_firewall_type(&self) -> &::std::option::Option<crate::types::TemplateFirewallType> {
&self.firewall_type
}
pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.updated_at = ::std::option::Option::Some(input);
self
}
pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.updated_at = input;
self
}
pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.updated_at
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_template::CreateTemplateOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_template::CreateTemplateOutput {
template_id: self.template_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"template_id",
"template_id was not specified but it is required when building CreateTemplateOutput",
)
})?,
template_arn: self.template_arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"template_arn",
"template_arn was not specified but it is required when building CreateTemplateOutput",
)
})?,
template_name: self.template_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"template_name",
"template_name was not specified but it is required when building CreateTemplateOutput",
)
})?,
template_description: self.template_description,
status: self.status.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"status",
"status was not specified but it is required when building CreateTemplateOutput",
)
})?,
version: self.version.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"version",
"version was not specified but it is required when building CreateTemplateOutput",
)
})?,
associated_rule_list: self.associated_rule_list.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"associated_rule_list",
"associated_rule_list was not specified but it is required when building CreateTemplateOutput",
)
})?,
update_token: self.update_token,
is_snapshot: self.is_snapshot,
has_published_version: self.has_published_version,
firewall_type: self.firewall_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"firewall_type",
"firewall_type was not specified but it is required when building CreateTemplateOutput",
)
})?,
updated_at: self.updated_at,
_request_id: self._request_id,
})
}
}