aws-sdk-securityagent 1.8.0

AWS SDK for AWS Security Agent
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Input for updating an existing threat model.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateThreatModelInput {
    /// <p>The unique identifier of the threat model to update.</p>
    pub threat_model_id: ::std::option::Option<::std::string::String>,
    /// <p>The unique identifier of the agent space that contains the threat model.</p>
    pub agent_space_id: ::std::option::Option<::std::string::String>,
    /// <p>The updated title of the threat model.</p>
    pub title: ::std::option::Option<::std::string::String>,
    /// <p>The updated description of the application or system being threat modeled.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The updated assets for the threat model.</p>
    pub assets: ::std::option::Option<crate::types::Assets>,
    /// <p>The updated scoped documents for the agent to focus on during threat modeling.</p>
    pub scope_docs: ::std::option::Option<::std::vec::Vec<crate::types::DocumentInfo>>,
    /// <p>The updated IAM service role for the threat model.</p>
    pub service_role: ::std::option::Option<::std::string::String>,
    /// <p>The updated CloudWatch Logs configuration for the threat model.</p>
    pub log_config: ::std::option::Option<crate::types::CloudWatchLog>,
}
impl UpdateThreatModelInput {
    /// <p>The unique identifier of the threat model to update.</p>
    pub fn threat_model_id(&self) -> ::std::option::Option<&str> {
        self.threat_model_id.as_deref()
    }
    /// <p>The unique identifier of the agent space that contains the threat model.</p>
    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
        self.agent_space_id.as_deref()
    }
    /// <p>The updated title of the threat model.</p>
    pub fn title(&self) -> ::std::option::Option<&str> {
        self.title.as_deref()
    }
    /// <p>The updated description of the application or system being threat modeled.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The updated assets for the threat model.</p>
    pub fn assets(&self) -> ::std::option::Option<&crate::types::Assets> {
        self.assets.as_ref()
    }
    /// <p>The updated scoped documents for the agent to focus on during threat modeling.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.scope_docs.is_none()`.
    pub fn scope_docs(&self) -> &[crate::types::DocumentInfo] {
        self.scope_docs.as_deref().unwrap_or_default()
    }
    /// <p>The updated IAM service role for the threat model.</p>
    pub fn service_role(&self) -> ::std::option::Option<&str> {
        self.service_role.as_deref()
    }
    /// <p>The updated CloudWatch Logs configuration for the threat model.</p>
    pub fn log_config(&self) -> ::std::option::Option<&crate::types::CloudWatchLog> {
        self.log_config.as_ref()
    }
}
impl UpdateThreatModelInput {
    /// Creates a new builder-style object to manufacture [`UpdateThreatModelInput`](crate::operation::update_threat_model::UpdateThreatModelInput).
    pub fn builder() -> crate::operation::update_threat_model::builders::UpdateThreatModelInputBuilder {
        crate::operation::update_threat_model::builders::UpdateThreatModelInputBuilder::default()
    }
}

/// A builder for [`UpdateThreatModelInput`](crate::operation::update_threat_model::UpdateThreatModelInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateThreatModelInputBuilder {
    pub(crate) threat_model_id: ::std::option::Option<::std::string::String>,
    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
    pub(crate) title: ::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>,
}
impl UpdateThreatModelInputBuilder {
    /// <p>The unique identifier of the threat model to update.</p>
    /// This field is required.
    pub fn threat_model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.threat_model_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the threat model to update.</p>
    pub fn set_threat_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.threat_model_id = input;
        self
    }
    /// <p>The unique identifier of the threat model to update.</p>
    pub fn get_threat_model_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.threat_model_id
    }
    /// <p>The unique identifier of the agent space that contains the threat model.</p>
    /// This field is required.
    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
    }
    /// <p>The unique identifier of the agent space that contains the threat model.</p>
    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.agent_space_id = input;
        self
    }
    /// <p>The unique identifier of the agent space that contains the threat model.</p>
    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_space_id
    }
    /// <p>The updated title of the threat model.</p>
    pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.title = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The updated title of the threat model.</p>
    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.title = input;
        self
    }
    /// <p>The updated title of the threat model.</p>
    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
        &self.title
    }
    /// <p>The updated description of the application or system being threat modeled.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The updated description of the application or system being threat modeled.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The updated description of the application or system being threat modeled.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The updated assets for the threat model.</p>
    pub fn assets(mut self, input: crate::types::Assets) -> Self {
        self.assets = ::std::option::Option::Some(input);
        self
    }
    /// <p>The updated assets for the threat model.</p>
    pub fn set_assets(mut self, input: ::std::option::Option<crate::types::Assets>) -> Self {
        self.assets = input;
        self
    }
    /// <p>The updated assets for the threat model.</p>
    pub fn get_assets(&self) -> &::std::option::Option<crate::types::Assets> {
        &self.assets
    }
    /// Appends an item to `scope_docs`.
    ///
    /// To override the contents of this collection use [`set_scope_docs`](Self::set_scope_docs).
    ///
    /// <p>The updated scoped documents for the agent to focus on during threat modeling.</p>
    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
    }
    /// <p>The updated scoped documents for the agent to focus on during threat modeling.</p>
    pub fn set_scope_docs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DocumentInfo>>) -> Self {
        self.scope_docs = input;
        self
    }
    /// <p>The updated scoped documents for the agent to focus on during threat modeling.</p>
    pub fn get_scope_docs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DocumentInfo>> {
        &self.scope_docs
    }
    /// <p>The updated IAM service role for the threat model.</p>
    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
    }
    /// <p>The updated IAM service role for the threat model.</p>
    pub fn set_service_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.service_role = input;
        self
    }
    /// <p>The updated IAM service role for the threat model.</p>
    pub fn get_service_role(&self) -> &::std::option::Option<::std::string::String> {
        &self.service_role
    }
    /// <p>The updated CloudWatch Logs configuration for the threat model.</p>
    pub fn log_config(mut self, input: crate::types::CloudWatchLog) -> Self {
        self.log_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The updated CloudWatch Logs configuration for the threat model.</p>
    pub fn set_log_config(mut self, input: ::std::option::Option<crate::types::CloudWatchLog>) -> Self {
        self.log_config = input;
        self
    }
    /// <p>The updated CloudWatch Logs configuration for the threat model.</p>
    pub fn get_log_config(&self) -> &::std::option::Option<crate::types::CloudWatchLog> {
        &self.log_config
    }
    /// Consumes the builder and constructs a [`UpdateThreatModelInput`](crate::operation::update_threat_model::UpdateThreatModelInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_threat_model::UpdateThreatModelInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_threat_model::UpdateThreatModelInput {
            threat_model_id: self.threat_model_id,
            agent_space_id: self.agent_space_id,
            title: self.title,
            description: self.description,
            assets: self.assets,
            scope_docs: self.scope_docs,
            service_role: self.service_role,
            log_config: self.log_config,
        })
    }
}