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.

/// Output for the BatchDeletePentests operation
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct BatchDeletePentestsOutput {
    /// List of successfully deleted pentests
    pub deleted: ::std::option::Option<::std::vec::Vec<crate::types::Pentest>>,
    /// List of pentests that could not be deleted and the reasons for failure
    pub failed: ::std::option::Option<::std::vec::Vec<crate::types::DeletePentestFailure>>,
    _request_id: Option<String>,
}
impl BatchDeletePentestsOutput {
    /// List of successfully deleted pentests
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.deleted.is_none()`.
    pub fn deleted(&self) -> &[crate::types::Pentest] {
        self.deleted.as_deref().unwrap_or_default()
    }
    /// List of pentests that could not be deleted and the reasons for failure
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.failed.is_none()`.
    pub fn failed(&self) -> &[crate::types::DeletePentestFailure] {
        self.failed.as_deref().unwrap_or_default()
    }
}
impl ::aws_types::request_id::RequestId for BatchDeletePentestsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl BatchDeletePentestsOutput {
    /// Creates a new builder-style object to manufacture [`BatchDeletePentestsOutput`](crate::operation::batch_delete_pentests::BatchDeletePentestsOutput).
    pub fn builder() -> crate::operation::batch_delete_pentests::builders::BatchDeletePentestsOutputBuilder {
        crate::operation::batch_delete_pentests::builders::BatchDeletePentestsOutputBuilder::default()
    }
}

/// A builder for [`BatchDeletePentestsOutput`](crate::operation::batch_delete_pentests::BatchDeletePentestsOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct BatchDeletePentestsOutputBuilder {
    pub(crate) deleted: ::std::option::Option<::std::vec::Vec<crate::types::Pentest>>,
    pub(crate) failed: ::std::option::Option<::std::vec::Vec<crate::types::DeletePentestFailure>>,
    _request_id: Option<String>,
}
impl BatchDeletePentestsOutputBuilder {
    /// Appends an item to `deleted`.
    ///
    /// To override the contents of this collection use [`set_deleted`](Self::set_deleted).
    ///
    /// List of successfully deleted pentests
    pub fn deleted(mut self, input: crate::types::Pentest) -> Self {
        let mut v = self.deleted.unwrap_or_default();
        v.push(input);
        self.deleted = ::std::option::Option::Some(v);
        self
    }
    /// List of successfully deleted pentests
    pub fn set_deleted(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Pentest>>) -> Self {
        self.deleted = input;
        self
    }
    /// List of successfully deleted pentests
    pub fn get_deleted(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Pentest>> {
        &self.deleted
    }
    /// Appends an item to `failed`.
    ///
    /// To override the contents of this collection use [`set_failed`](Self::set_failed).
    ///
    /// List of pentests that could not be deleted and the reasons for failure
    pub fn failed(mut self, input: crate::types::DeletePentestFailure) -> Self {
        let mut v = self.failed.unwrap_or_default();
        v.push(input);
        self.failed = ::std::option::Option::Some(v);
        self
    }
    /// List of pentests that could not be deleted and the reasons for failure
    pub fn set_failed(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DeletePentestFailure>>) -> Self {
        self.failed = input;
        self
    }
    /// List of pentests that could not be deleted and the reasons for failure
    pub fn get_failed(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DeletePentestFailure>> {
        &self.failed
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`BatchDeletePentestsOutput`](crate::operation::batch_delete_pentests::BatchDeletePentestsOutput).
    pub fn build(self) -> crate::operation::batch_delete_pentests::BatchDeletePentestsOutput {
        crate::operation::batch_delete_pentests::BatchDeletePentestsOutput {
            deleted: self.deleted,
            failed: self.failed,
            _request_id: self._request_id,
        }
    }
}