aws-sdk-codebuild 1.122.0

AWS SDK for AWS CodeBuild
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DescribeCodeCoveragesOutput {
    /// <p>If there are more items to return, this contains a token that is passed to a subsequent call to <code>DescribeCodeCoverages</code> to retrieve the next set of items.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    /// <p>An array of <code>CodeCoverage</code> objects that contain the results.</p>
    pub code_coverages: ::std::option::Option<::std::vec::Vec<crate::types::CodeCoverage>>,
    _request_id: Option<String>,
}
impl DescribeCodeCoveragesOutput {
    /// <p>If there are more items to return, this contains a token that is passed to a subsequent call to <code>DescribeCodeCoverages</code> to retrieve the next set of items.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
    /// <p>An array of <code>CodeCoverage</code> objects that contain the results.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.code_coverages.is_none()`.
    pub fn code_coverages(&self) -> &[crate::types::CodeCoverage] {
        self.code_coverages.as_deref().unwrap_or_default()
    }
}
impl ::aws_types::request_id::RequestId for DescribeCodeCoveragesOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DescribeCodeCoveragesOutput {
    /// Creates a new builder-style object to manufacture [`DescribeCodeCoveragesOutput`](crate::operation::describe_code_coverages::DescribeCodeCoveragesOutput).
    pub fn builder() -> crate::operation::describe_code_coverages::builders::DescribeCodeCoveragesOutputBuilder {
        crate::operation::describe_code_coverages::builders::DescribeCodeCoveragesOutputBuilder::default()
    }
}

/// A builder for [`DescribeCodeCoveragesOutput`](crate::operation::describe_code_coverages::DescribeCodeCoveragesOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DescribeCodeCoveragesOutputBuilder {
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    pub(crate) code_coverages: ::std::option::Option<::std::vec::Vec<crate::types::CodeCoverage>>,
    _request_id: Option<String>,
}
impl DescribeCodeCoveragesOutputBuilder {
    /// <p>If there are more items to return, this contains a token that is passed to a subsequent call to <code>DescribeCodeCoverages</code> to retrieve the next set of items.</p>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.next_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>If there are more items to return, this contains a token that is passed to a subsequent call to <code>DescribeCodeCoverages</code> to retrieve the next set of items.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>If there are more items to return, this contains a token that is passed to a subsequent call to <code>DescribeCodeCoverages</code> to retrieve the next set of items.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    /// Appends an item to `code_coverages`.
    ///
    /// To override the contents of this collection use [`set_code_coverages`](Self::set_code_coverages).
    ///
    /// <p>An array of <code>CodeCoverage</code> objects that contain the results.</p>
    pub fn code_coverages(mut self, input: crate::types::CodeCoverage) -> Self {
        let mut v = self.code_coverages.unwrap_or_default();
        v.push(input);
        self.code_coverages = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of <code>CodeCoverage</code> objects that contain the results.</p>
    pub fn set_code_coverages(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CodeCoverage>>) -> Self {
        self.code_coverages = input;
        self
    }
    /// <p>An array of <code>CodeCoverage</code> objects that contain the results.</p>
    pub fn get_code_coverages(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CodeCoverage>> {
        &self.code_coverages
    }
    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 [`DescribeCodeCoveragesOutput`](crate::operation::describe_code_coverages::DescribeCodeCoveragesOutput).
    pub fn build(self) -> crate::operation::describe_code_coverages::DescribeCodeCoveragesOutput {
        crate::operation::describe_code_coverages::DescribeCodeCoveragesOutput {
            next_token: self.next_token,
            code_coverages: self.code_coverages,
            _request_id: self._request_id,
        }
    }
}