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 BatchGetPentests operation
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct BatchGetPentestsOutput {
    /// List of successfully retrieved pentests
    pub pentests: ::std::option::Option<::std::vec::Vec<crate::types::Pentest>>,
    /// List of pentest IDs that could not be found
    pub not_found: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    _request_id: Option<String>,
}
impl BatchGetPentestsOutput {
    /// List of successfully retrieved 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 `.pentests.is_none()`.
    pub fn pentests(&self) -> &[crate::types::Pentest] {
        self.pentests.as_deref().unwrap_or_default()
    }
    /// List of pentest IDs that could not be found
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.not_found.is_none()`.
    pub fn not_found(&self) -> &[::std::string::String] {
        self.not_found.as_deref().unwrap_or_default()
    }
}
impl ::aws_types::request_id::RequestId for BatchGetPentestsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl BatchGetPentestsOutput {
    /// Creates a new builder-style object to manufacture [`BatchGetPentestsOutput`](crate::operation::batch_get_pentests::BatchGetPentestsOutput).
    pub fn builder() -> crate::operation::batch_get_pentests::builders::BatchGetPentestsOutputBuilder {
        crate::operation::batch_get_pentests::builders::BatchGetPentestsOutputBuilder::default()
    }
}

/// A builder for [`BatchGetPentestsOutput`](crate::operation::batch_get_pentests::BatchGetPentestsOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct BatchGetPentestsOutputBuilder {
    pub(crate) pentests: ::std::option::Option<::std::vec::Vec<crate::types::Pentest>>,
    pub(crate) not_found: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    _request_id: Option<String>,
}
impl BatchGetPentestsOutputBuilder {
    /// Appends an item to `pentests`.
    ///
    /// To override the contents of this collection use [`set_pentests`](Self::set_pentests).
    ///
    /// List of successfully retrieved pentests
    pub fn pentests(mut self, input: crate::types::Pentest) -> Self {
        let mut v = self.pentests.unwrap_or_default();
        v.push(input);
        self.pentests = ::std::option::Option::Some(v);
        self
    }
    /// List of successfully retrieved pentests
    pub fn set_pentests(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Pentest>>) -> Self {
        self.pentests = input;
        self
    }
    /// List of successfully retrieved pentests
    pub fn get_pentests(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Pentest>> {
        &self.pentests
    }
    /// Appends an item to `not_found`.
    ///
    /// To override the contents of this collection use [`set_not_found`](Self::set_not_found).
    ///
    /// List of pentest IDs that could not be found
    pub fn not_found(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.not_found.unwrap_or_default();
        v.push(input.into());
        self.not_found = ::std::option::Option::Some(v);
        self
    }
    /// List of pentest IDs that could not be found
    pub fn set_not_found(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.not_found = input;
        self
    }
    /// List of pentest IDs that could not be found
    pub fn get_not_found(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.not_found
    }
    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 [`BatchGetPentestsOutput`](crate::operation::batch_get_pentests::BatchGetPentestsOutput).
    pub fn build(self) -> crate::operation::batch_get_pentests::BatchGetPentestsOutput {
        crate::operation::batch_get_pentests::BatchGetPentestsOutput {
            pentests: self.pentests,
            not_found: self.not_found,
            _request_id: self._request_id,
        }
    }
}