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.
pub use crate::operation::update_threat::_update_threat_input::UpdateThreatInputBuilder;

pub use crate::operation::update_threat::_update_threat_output::UpdateThreatOutputBuilder;

impl crate::operation::update_threat::builders::UpdateThreatInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::update_threat::UpdateThreatOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_threat::UpdateThreatError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.update_threat();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `UpdateThreat`.
///
/// <p>Updates a threat.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateThreatFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::update_threat::builders::UpdateThreatInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::update_threat::UpdateThreatOutput,
        crate::operation::update_threat::UpdateThreatError,
    > for UpdateThreatFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::update_threat::UpdateThreatOutput,
            crate::operation::update_threat::UpdateThreatError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl UpdateThreatFluentBuilder {
    /// Creates a new `UpdateThreatFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the UpdateThreat as a reference.
    pub fn as_input(&self) -> &crate::operation::update_threat::builders::UpdateThreatInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::update_threat::UpdateThreatOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_threat::UpdateThreatError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::update_threat::UpdateThreat::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::update_threat::UpdateThreat::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::update_threat::UpdateThreatOutput,
        crate::operation::update_threat::UpdateThreatError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The unique identifier of the threat to update.</p>
    pub fn threat_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.threat_id(input.into());
        self
    }
    /// <p>The unique identifier of the threat to update.</p>
    pub fn set_threat_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_threat_id(input);
        self
    }
    /// <p>The unique identifier of the threat to update.</p>
    pub fn get_threat_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_threat_id()
    }
    /// <p>The unique identifier of the agent space.</p>
    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.agent_space_id(input.into());
        self
    }
    /// <p>The unique identifier of the agent space.</p>
    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_agent_space_id(input);
        self
    }
    /// <p>The unique identifier of the agent space.</p>
    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_agent_space_id()
    }
    /// <p>A short title summarizing the threat.</p>
    pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.title(input.into());
        self
    }
    /// <p>A short title summarizing the threat.</p>
    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_title(input);
        self
    }
    /// <p>A short title summarizing the threat.</p>
    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_title()
    }
    /// <p>The updated status of the threat.</p>
    pub fn status(mut self, input: crate::types::ThreatStatus) -> Self {
        self.inner = self.inner.status(input);
        self
    }
    /// <p>The updated status of the threat.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ThreatStatus>) -> Self {
        self.inner = self.inner.set_status(input);
        self
    }
    /// <p>The updated status of the threat.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::ThreatStatus> {
        self.inner.get_status()
    }
    /// <p>Optional customer comment.</p>
    pub fn comments(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.comments(input.into());
        self
    }
    /// <p>Optional customer comment.</p>
    pub fn set_comments(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_comments(input);
        self
    }
    /// <p>Optional customer comment.</p>
    pub fn get_comments(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_comments()
    }
    /// <p>The updated natural-language threat statement.</p>
    pub fn statement(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.statement(input.into());
        self
    }
    /// <p>The updated natural-language threat statement.</p>
    pub fn set_statement(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_statement(input);
        self
    }
    /// <p>The updated natural-language threat statement.</p>
    pub fn get_statement(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_statement()
    }
    /// <p>The updated severity level of the threat.</p>
    pub fn severity(mut self, input: crate::types::ThreatSeverity) -> Self {
        self.inner = self.inner.severity(input);
        self
    }
    /// <p>The updated severity level of the threat.</p>
    pub fn set_severity(mut self, input: ::std::option::Option<crate::types::ThreatSeverity>) -> Self {
        self.inner = self.inner.set_severity(input);
        self
    }
    /// <p>The updated severity level of the threat.</p>
    pub fn get_severity(&self) -> &::std::option::Option<crate::types::ThreatSeverity> {
        self.inner.get_severity()
    }
    /// <p>The updated actor or origin of the threat.</p>
    pub fn threat_source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.threat_source(input.into());
        self
    }
    /// <p>The updated actor or origin of the threat.</p>
    pub fn set_threat_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_threat_source(input);
        self
    }
    /// <p>The updated actor or origin of the threat.</p>
    pub fn get_threat_source(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_threat_source()
    }
    /// <p>The updated conditions required for the threat to be exploitable.</p>
    pub fn prerequisites(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.prerequisites(input.into());
        self
    }
    /// <p>The updated conditions required for the threat to be exploitable.</p>
    pub fn set_prerequisites(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_prerequisites(input);
        self
    }
    /// <p>The updated conditions required for the threat to be exploitable.</p>
    pub fn get_prerequisites(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_prerequisites()
    }
    /// <p>The updated description of what the threat source can do.</p>
    pub fn threat_action(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.threat_action(input.into());
        self
    }
    /// <p>The updated description of what the threat source can do.</p>
    pub fn set_threat_action(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_threat_action(input);
        self
    }
    /// <p>The updated description of what the threat source can do.</p>
    pub fn get_threat_action(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_threat_action()
    }
    /// <p>The updated direct consequence of the threat action.</p>
    pub fn threat_impact(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.threat_impact(input.into());
        self
    }
    /// <p>The updated direct consequence of the threat action.</p>
    pub fn set_threat_impact(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_threat_impact(input);
        self
    }
    /// <p>The updated direct consequence of the threat action.</p>
    pub fn get_threat_impact(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_threat_impact()
    }
    ///
    /// Appends an item to `impactedGoal`.
    ///
    /// To override the contents of this collection use [`set_impacted_goal`](Self::set_impacted_goal).
    ///
    /// <p>The updated security goals affected by the threat.</p>
    pub fn impacted_goal(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.impacted_goal(input.into());
        self
    }
    /// <p>The updated security goals affected by the threat.</p>
    pub fn set_impacted_goal(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inner = self.inner.set_impacted_goal(input);
        self
    }
    /// <p>The updated security goals affected by the threat.</p>
    pub fn get_impacted_goal(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        self.inner.get_impacted_goal()
    }
    ///
    /// Appends an item to `impactedAssets`.
    ///
    /// To override the contents of this collection use [`set_impacted_assets`](Self::set_impacted_assets).
    ///
    /// <p>The updated list of specific assets affected by the threat.</p>
    pub fn impacted_assets(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.impacted_assets(input.into());
        self
    }
    /// <p>The updated list of specific assets affected by the threat.</p>
    pub fn set_impacted_assets(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inner = self.inner.set_impacted_assets(input);
        self
    }
    /// <p>The updated list of specific assets affected by the threat.</p>
    pub fn get_impacted_assets(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        self.inner.get_impacted_assets()
    }
    /// <p>The updated DFD element this threat is anchored to.</p>
    pub fn anchor(mut self, input: crate::types::ThreatAnchorShape) -> Self {
        self.inner = self.inner.anchor(input);
        self
    }
    /// <p>The updated DFD element this threat is anchored to.</p>
    pub fn set_anchor(mut self, input: ::std::option::Option<crate::types::ThreatAnchorShape>) -> Self {
        self.inner = self.inner.set_anchor(input);
        self
    }
    /// <p>The updated DFD element this threat is anchored to.</p>
    pub fn get_anchor(&self) -> &::std::option::Option<crate::types::ThreatAnchorShape> {
        self.inner.get_anchor()
    }
    ///
    /// Appends an item to `evidence`.
    ///
    /// To override the contents of this collection use [`set_evidence`](Self::set_evidence).
    ///
    /// <p>The updated source code files supporting the threat.</p>
    pub fn evidence(mut self, input: crate::types::ThreatEvidenceShape) -> Self {
        self.inner = self.inner.evidence(input);
        self
    }
    /// <p>The updated source code files supporting the threat.</p>
    pub fn set_evidence(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ThreatEvidenceShape>>) -> Self {
        self.inner = self.inner.set_evidence(input);
        self
    }
    /// <p>The updated source code files supporting the threat.</p>
    pub fn get_evidence(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ThreatEvidenceShape>> {
        self.inner.get_evidence()
    }
    /// <p>The updated recommended mitigation guidance for this threat.</p>
    pub fn recommendation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.recommendation(input.into());
        self
    }
    /// <p>The updated recommended mitigation guidance for this threat.</p>
    pub fn set_recommendation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_recommendation(input);
        self
    }
    /// <p>The updated recommended mitigation guidance for this threat.</p>
    pub fn get_recommendation(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_recommendation()
    }
}