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_model::_update_threat_model_input::UpdateThreatModelInputBuilder;

pub use crate::operation::update_threat_model::_update_threat_model_output::UpdateThreatModelOutputBuilder;

impl crate::operation::update_threat_model::builders::UpdateThreatModelInputBuilder {
    /// 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_model::UpdateThreatModelOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_threat_model::UpdateThreatModelError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.update_threat_model();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `UpdateThreatModel`.
///
/// <p>Updates an existing threat model configuration.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateThreatModelFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::update_threat_model::builders::UpdateThreatModelInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::update_threat_model::UpdateThreatModelOutput,
        crate::operation::update_threat_model::UpdateThreatModelError,
    > for UpdateThreatModelFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::update_threat_model::UpdateThreatModelOutput,
            crate::operation::update_threat_model::UpdateThreatModelError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl UpdateThreatModelFluentBuilder {
    /// Creates a new `UpdateThreatModelFluentBuilder`.
    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 UpdateThreatModel as a reference.
    pub fn as_input(&self) -> &crate::operation::update_threat_model::builders::UpdateThreatModelInputBuilder {
        &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_model::UpdateThreatModelOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_threat_model::UpdateThreatModelError,
            ::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_model::UpdateThreatModel::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::update_threat_model::UpdateThreatModel::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_model::UpdateThreatModelOutput,
        crate::operation::update_threat_model::UpdateThreatModelError,
        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 model to update.</p>
    pub fn threat_model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.threat_model_id(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.inner = self.inner.set_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.inner.get_threat_model_id()
    }
    /// <p>The unique identifier of the agent space that contains the threat model.</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 that contains the threat model.</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 that contains the threat model.</p>
    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_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.inner = self.inner.title(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.inner = self.inner.set_title(input);
        self
    }
    /// <p>The updated title of the threat model.</p>
    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_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.inner = self.inner.description(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.inner = self.inner.set_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.inner.get_description()
    }
    /// <p>The updated assets for the threat model.</p>
    pub fn assets(mut self, input: crate::types::Assets) -> Self {
        self.inner = self.inner.assets(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.inner = self.inner.set_assets(input);
        self
    }
    /// <p>The updated assets for the threat model.</p>
    pub fn get_assets(&self) -> &::std::option::Option<crate::types::Assets> {
        self.inner.get_assets()
    }
    ///
    /// Appends an item to `scopeDocs`.
    ///
    /// 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 {
        self.inner = self.inner.scope_docs(input);
        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.inner = self.inner.set_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.inner.get_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.inner = self.inner.service_role(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.inner = self.inner.set_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.inner.get_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.inner = self.inner.log_config(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.inner = self.inner.set_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.inner.get_log_config()
    }
}