aws-sdk-securityagent 1.1.0

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

/// Input for the StartCodeRemediation operation
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct StartCodeRemediationInput {
    /// ID of the agent space where the pentest job exists
    pub agent_space_id: ::std::option::Option<::std::string::String>,
    /// Identifier of the pentest job to start code remediation for
    pub pentest_job_id: ::std::option::Option<::std::string::String>,
    /// Identifiers of the findings to start code remediation for
    pub finding_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl StartCodeRemediationInput {
    /// ID of the agent space where the pentest job exists
    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
        self.agent_space_id.as_deref()
    }
    /// Identifier of the pentest job to start code remediation for
    pub fn pentest_job_id(&self) -> ::std::option::Option<&str> {
        self.pentest_job_id.as_deref()
    }
    /// Identifiers of the findings to start code remediation for
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.finding_ids.is_none()`.
    pub fn finding_ids(&self) -> &[::std::string::String] {
        self.finding_ids.as_deref().unwrap_or_default()
    }
}
impl StartCodeRemediationInput {
    /// Creates a new builder-style object to manufacture [`StartCodeRemediationInput`](crate::operation::start_code_remediation::StartCodeRemediationInput).
    pub fn builder() -> crate::operation::start_code_remediation::builders::StartCodeRemediationInputBuilder {
        crate::operation::start_code_remediation::builders::StartCodeRemediationInputBuilder::default()
    }
}

/// A builder for [`StartCodeRemediationInput`](crate::operation::start_code_remediation::StartCodeRemediationInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StartCodeRemediationInputBuilder {
    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
    pub(crate) pentest_job_id: ::std::option::Option<::std::string::String>,
    pub(crate) finding_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl StartCodeRemediationInputBuilder {
    /// ID of the agent space where the pentest job exists
    /// 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
    }
    /// ID of the agent space where the pentest job exists
    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.agent_space_id = input;
        self
    }
    /// ID of the agent space where the pentest job exists
    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_space_id
    }
    /// Identifier of the pentest job to start code remediation for
    /// This field is required.
    pub fn pentest_job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.pentest_job_id = ::std::option::Option::Some(input.into());
        self
    }
    /// Identifier of the pentest job to start code remediation for
    pub fn set_pentest_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.pentest_job_id = input;
        self
    }
    /// Identifier of the pentest job to start code remediation for
    pub fn get_pentest_job_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.pentest_job_id
    }
    /// Appends an item to `finding_ids`.
    ///
    /// To override the contents of this collection use [`set_finding_ids`](Self::set_finding_ids).
    ///
    /// Identifiers of the findings to start code remediation for
    pub fn finding_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.finding_ids.unwrap_or_default();
        v.push(input.into());
        self.finding_ids = ::std::option::Option::Some(v);
        self
    }
    /// Identifiers of the findings to start code remediation for
    pub fn set_finding_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.finding_ids = input;
        self
    }
    /// Identifiers of the findings to start code remediation for
    pub fn get_finding_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.finding_ids
    }
    /// Consumes the builder and constructs a [`StartCodeRemediationInput`](crate::operation::start_code_remediation::StartCodeRemediationInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::start_code_remediation::StartCodeRemediationInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::start_code_remediation::StartCodeRemediationInput {
            agent_space_id: self.agent_space_id,
            pentest_job_id: self.pentest_job_id,
            finding_ids: self.finding_ids,
        })
    }
}