#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateThreatModelInput {
pub title: ::std::option::Option<::std::string::String>,
pub agent_space_id: ::std::option::Option<::std::string::String>,
pub description: ::std::option::Option<::std::string::String>,
pub assets: ::std::option::Option<crate::types::Assets>,
pub scope_docs: ::std::option::Option<::std::vec::Vec<crate::types::DocumentInfo>>,
pub service_role: ::std::option::Option<::std::string::String>,
pub log_config: ::std::option::Option<crate::types::CloudWatchLog>,
pub report_destination: ::std::option::Option<crate::types::ReportDestination>,
}
impl CreateThreatModelInput {
pub fn title(&self) -> ::std::option::Option<&str> {
self.title.as_deref()
}
pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
self.agent_space_id.as_deref()
}
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
pub fn assets(&self) -> ::std::option::Option<&crate::types::Assets> {
self.assets.as_ref()
}
pub fn scope_docs(&self) -> &[crate::types::DocumentInfo] {
self.scope_docs.as_deref().unwrap_or_default()
}
pub fn service_role(&self) -> ::std::option::Option<&str> {
self.service_role.as_deref()
}
pub fn log_config(&self) -> ::std::option::Option<&crate::types::CloudWatchLog> {
self.log_config.as_ref()
}
pub fn report_destination(&self) -> ::std::option::Option<&crate::types::ReportDestination> {
self.report_destination.as_ref()
}
}
impl CreateThreatModelInput {
pub fn builder() -> crate::operation::create_threat_model::builders::CreateThreatModelInputBuilder {
crate::operation::create_threat_model::builders::CreateThreatModelInputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateThreatModelInputBuilder {
pub(crate) title: ::std::option::Option<::std::string::String>,
pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) assets: ::std::option::Option<crate::types::Assets>,
pub(crate) scope_docs: ::std::option::Option<::std::vec::Vec<crate::types::DocumentInfo>>,
pub(crate) service_role: ::std::option::Option<::std::string::String>,
pub(crate) log_config: ::std::option::Option<crate::types::CloudWatchLog>,
pub(crate) report_destination: ::std::option::Option<crate::types::ReportDestination>,
}
impl CreateThreatModelInputBuilder {
pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.title = ::std::option::Option::Some(input.into());
self
}
pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.title = input;
self
}
pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
&self.title
}
pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.agent_space_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.agent_space_id = input;
self
}
pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
&self.agent_space_id
}
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 assets(mut self, input: crate::types::Assets) -> Self {
self.assets = ::std::option::Option::Some(input);
self
}
pub fn set_assets(mut self, input: ::std::option::Option<crate::types::Assets>) -> Self {
self.assets = input;
self
}
pub fn get_assets(&self) -> &::std::option::Option<crate::types::Assets> {
&self.assets
}
pub fn scope_docs(mut self, input: crate::types::DocumentInfo) -> Self {
let mut v = self.scope_docs.unwrap_or_default();
v.push(input);
self.scope_docs = ::std::option::Option::Some(v);
self
}
pub fn set_scope_docs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DocumentInfo>>) -> Self {
self.scope_docs = input;
self
}
pub fn get_scope_docs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DocumentInfo>> {
&self.scope_docs
}
pub fn service_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.service_role = ::std::option::Option::Some(input.into());
self
}
pub fn set_service_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.service_role = input;
self
}
pub fn get_service_role(&self) -> &::std::option::Option<::std::string::String> {
&self.service_role
}
pub fn log_config(mut self, input: crate::types::CloudWatchLog) -> Self {
self.log_config = ::std::option::Option::Some(input);
self
}
pub fn set_log_config(mut self, input: ::std::option::Option<crate::types::CloudWatchLog>) -> Self {
self.log_config = input;
self
}
pub fn get_log_config(&self) -> &::std::option::Option<crate::types::CloudWatchLog> {
&self.log_config
}
pub fn report_destination(mut self, input: crate::types::ReportDestination) -> Self {
self.report_destination = ::std::option::Option::Some(input);
self
}
pub fn set_report_destination(mut self, input: ::std::option::Option<crate::types::ReportDestination>) -> Self {
self.report_destination = input;
self
}
pub fn get_report_destination(&self) -> &::std::option::Option<crate::types::ReportDestination> {
&self.report_destination
}
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_threat_model::CreateThreatModelInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_threat_model::CreateThreatModelInput {
title: self.title,
agent_space_id: self.agent_space_id,
description: self.description,
assets: self.assets,
scope_docs: self.scope_docs,
service_role: self.service_role,
log_config: self.log_config,
report_destination: self.report_destination,
})
}
}