aws-sdk-deadline 1.20.0

AWS SDK for AWSDeadlineCloud
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 ListBudgetsOutput {
    /// <p>If Deadline Cloud returns <code>nextToken</code>, then there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. To retrieve the next page, call the operation again using the returned token. Keep all other arguments unchanged. If no results remain, then <code>nextToken</code> is set to <code>null</code>. Each pagination token expires after 24 hours. If you provide a token that isn't valid, then you receive an HTTP 400 <code>ValidationException</code> error.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    /// <p>The budgets to include on the list.</p>
    pub budgets: ::std::vec::Vec<crate::types::BudgetSummary>,
    _request_id: Option<String>,
}
impl ListBudgetsOutput {
    /// <p>If Deadline Cloud returns <code>nextToken</code>, then there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. To retrieve the next page, call the operation again using the returned token. Keep all other arguments unchanged. If no results remain, then <code>nextToken</code> is set to <code>null</code>. Each pagination token expires after 24 hours. If you provide a token that isn't valid, then you receive an HTTP 400 <code>ValidationException</code> error.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
    /// <p>The budgets to include on the list.</p>
    pub fn budgets(&self) -> &[crate::types::BudgetSummary] {
        use std::ops::Deref;
        self.budgets.deref()
    }
}
impl ::aws_types::request_id::RequestId for ListBudgetsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl ListBudgetsOutput {
    /// Creates a new builder-style object to manufacture [`ListBudgetsOutput`](crate::operation::list_budgets::ListBudgetsOutput).
    pub fn builder() -> crate::operation::list_budgets::builders::ListBudgetsOutputBuilder {
        crate::operation::list_budgets::builders::ListBudgetsOutputBuilder::default()
    }
}

/// A builder for [`ListBudgetsOutput`](crate::operation::list_budgets::ListBudgetsOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ListBudgetsOutputBuilder {
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    pub(crate) budgets: ::std::option::Option<::std::vec::Vec<crate::types::BudgetSummary>>,
    _request_id: Option<String>,
}
impl ListBudgetsOutputBuilder {
    /// <p>If Deadline Cloud returns <code>nextToken</code>, then there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. To retrieve the next page, call the operation again using the returned token. Keep all other arguments unchanged. If no results remain, then <code>nextToken</code> is set to <code>null</code>. Each pagination token expires after 24 hours. If you provide a token that isn't valid, then you receive an HTTP 400 <code>ValidationException</code> error.</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 Deadline Cloud returns <code>nextToken</code>, then there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. To retrieve the next page, call the operation again using the returned token. Keep all other arguments unchanged. If no results remain, then <code>nextToken</code> is set to <code>null</code>. Each pagination token expires after 24 hours. If you provide a token that isn't valid, then you receive an HTTP 400 <code>ValidationException</code> error.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>If Deadline Cloud returns <code>nextToken</code>, then there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. To retrieve the next page, call the operation again using the returned token. Keep all other arguments unchanged. If no results remain, then <code>nextToken</code> is set to <code>null</code>. Each pagination token expires after 24 hours. If you provide a token that isn't valid, then you receive an HTTP 400 <code>ValidationException</code> error.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    /// Appends an item to `budgets`.
    ///
    /// To override the contents of this collection use [`set_budgets`](Self::set_budgets).
    ///
    /// <p>The budgets to include on the list.</p>
    pub fn budgets(mut self, input: crate::types::BudgetSummary) -> Self {
        let mut v = self.budgets.unwrap_or_default();
        v.push(input);
        self.budgets = ::std::option::Option::Some(v);
        self
    }
    /// <p>The budgets to include on the list.</p>
    pub fn set_budgets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BudgetSummary>>) -> Self {
        self.budgets = input;
        self
    }
    /// <p>The budgets to include on the list.</p>
    pub fn get_budgets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BudgetSummary>> {
        &self.budgets
    }
    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 [`ListBudgetsOutput`](crate::operation::list_budgets::ListBudgetsOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`budgets`](crate::operation::list_budgets::builders::ListBudgetsOutputBuilder::budgets)
    pub fn build(self) -> ::std::result::Result<crate::operation::list_budgets::ListBudgetsOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::list_budgets::ListBudgetsOutput {
            next_token: self.next_token,
            budgets: self.budgets.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "budgets",
                    "budgets was not specified but it is required when building ListBudgetsOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}