aws-sdk-machinelearning 1.98.0

AWS SDK for Amazon Machine Learning
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Represents the output of a <code>DescribeBatchPredictions</code> operation. The content is essentially a list of <code>BatchPrediction</code>s.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DescribeBatchPredictionsOutput {
    /// <p>A list of <code>BatchPrediction</code> objects that meet the search criteria.</p>
    pub results: ::std::option::Option<::std::vec::Vec<crate::types::BatchPrediction>>,
    /// <p>The ID of the next page in the paginated results that indicates at least one more page follows.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl DescribeBatchPredictionsOutput {
    /// <p>A list of <code>BatchPrediction</code> objects that meet the search criteria.</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 `.results.is_none()`.
    pub fn results(&self) -> &[crate::types::BatchPrediction] {
        self.results.as_deref().unwrap_or_default()
    }
    /// <p>The ID of the next page in the paginated results that indicates at least one more page follows.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for DescribeBatchPredictionsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DescribeBatchPredictionsOutput {
    /// Creates a new builder-style object to manufacture [`DescribeBatchPredictionsOutput`](crate::operation::describe_batch_predictions::DescribeBatchPredictionsOutput).
    pub fn builder() -> crate::operation::describe_batch_predictions::builders::DescribeBatchPredictionsOutputBuilder {
        crate::operation::describe_batch_predictions::builders::DescribeBatchPredictionsOutputBuilder::default()
    }
}

/// A builder for [`DescribeBatchPredictionsOutput`](crate::operation::describe_batch_predictions::DescribeBatchPredictionsOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DescribeBatchPredictionsOutputBuilder {
    pub(crate) results: ::std::option::Option<::std::vec::Vec<crate::types::BatchPrediction>>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl DescribeBatchPredictionsOutputBuilder {
    /// Appends an item to `results`.
    ///
    /// To override the contents of this collection use [`set_results`](Self::set_results).
    ///
    /// <p>A list of <code>BatchPrediction</code> objects that meet the search criteria.</p>
    pub fn results(mut self, input: crate::types::BatchPrediction) -> Self {
        let mut v = self.results.unwrap_or_default();
        v.push(input);
        self.results = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of <code>BatchPrediction</code> objects that meet the search criteria.</p>
    pub fn set_results(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BatchPrediction>>) -> Self {
        self.results = input;
        self
    }
    /// <p>A list of <code>BatchPrediction</code> objects that meet the search criteria.</p>
    pub fn get_results(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BatchPrediction>> {
        &self.results
    }
    /// <p>The ID of the next page in the paginated results that indicates at least one more page follows.</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>The ID of the next page in the paginated results that indicates at least one more page follows.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>The ID of the next page in the paginated results that indicates at least one more page follows.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    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 [`DescribeBatchPredictionsOutput`](crate::operation::describe_batch_predictions::DescribeBatchPredictionsOutput).
    pub fn build(self) -> crate::operation::describe_batch_predictions::DescribeBatchPredictionsOutput {
        crate::operation::describe_batch_predictions::DescribeBatchPredictionsOutput {
            results: self.results,
            next_token: self.next_token,
            _request_id: self._request_id,
        }
    }
}