aws-sdk-computeoptimizer 1.102.0

AWS SDK for AWS Compute Optimizer
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 GetLicenseRecommendationsOutput {
    /// <p>The token to use to advance to the next page of license recommendations.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    /// <p>An array of objects that describe license recommendations.</p>
    pub license_recommendations: ::std::option::Option<::std::vec::Vec<crate::types::LicenseRecommendation>>,
    /// <p>An array of objects that describe errors of the request.</p>
    pub errors: ::std::option::Option<::std::vec::Vec<crate::types::GetRecommendationError>>,
    _request_id: Option<String>,
}
impl GetLicenseRecommendationsOutput {
    /// <p>The token to use to advance to the next page of license recommendations.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
    /// <p>An array of objects that describe license recommendations.</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 `.license_recommendations.is_none()`.
    pub fn license_recommendations(&self) -> &[crate::types::LicenseRecommendation] {
        self.license_recommendations.as_deref().unwrap_or_default()
    }
    /// <p>An array of objects that describe errors of the request.</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 `.errors.is_none()`.
    pub fn errors(&self) -> &[crate::types::GetRecommendationError] {
        self.errors.as_deref().unwrap_or_default()
    }
}
impl ::aws_types::request_id::RequestId for GetLicenseRecommendationsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetLicenseRecommendationsOutput {
    /// Creates a new builder-style object to manufacture [`GetLicenseRecommendationsOutput`](crate::operation::get_license_recommendations::GetLicenseRecommendationsOutput).
    pub fn builder() -> crate::operation::get_license_recommendations::builders::GetLicenseRecommendationsOutputBuilder {
        crate::operation::get_license_recommendations::builders::GetLicenseRecommendationsOutputBuilder::default()
    }
}

/// A builder for [`GetLicenseRecommendationsOutput`](crate::operation::get_license_recommendations::GetLicenseRecommendationsOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetLicenseRecommendationsOutputBuilder {
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    pub(crate) license_recommendations: ::std::option::Option<::std::vec::Vec<crate::types::LicenseRecommendation>>,
    pub(crate) errors: ::std::option::Option<::std::vec::Vec<crate::types::GetRecommendationError>>,
    _request_id: Option<String>,
}
impl GetLicenseRecommendationsOutputBuilder {
    /// <p>The token to use to advance to the next page of license recommendations.</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 token to use to advance to the next page of license recommendations.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>The token to use to advance to the next page of license recommendations.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    /// Appends an item to `license_recommendations`.
    ///
    /// To override the contents of this collection use [`set_license_recommendations`](Self::set_license_recommendations).
    ///
    /// <p>An array of objects that describe license recommendations.</p>
    pub fn license_recommendations(mut self, input: crate::types::LicenseRecommendation) -> Self {
        let mut v = self.license_recommendations.unwrap_or_default();
        v.push(input);
        self.license_recommendations = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of objects that describe license recommendations.</p>
    pub fn set_license_recommendations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LicenseRecommendation>>) -> Self {
        self.license_recommendations = input;
        self
    }
    /// <p>An array of objects that describe license recommendations.</p>
    pub fn get_license_recommendations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LicenseRecommendation>> {
        &self.license_recommendations
    }
    /// Appends an item to `errors`.
    ///
    /// To override the contents of this collection use [`set_errors`](Self::set_errors).
    ///
    /// <p>An array of objects that describe errors of the request.</p>
    pub fn errors(mut self, input: crate::types::GetRecommendationError) -> Self {
        let mut v = self.errors.unwrap_or_default();
        v.push(input);
        self.errors = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of objects that describe errors of the request.</p>
    pub fn set_errors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GetRecommendationError>>) -> Self {
        self.errors = input;
        self
    }
    /// <p>An array of objects that describe errors of the request.</p>
    pub fn get_errors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GetRecommendationError>> {
        &self.errors
    }
    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 [`GetLicenseRecommendationsOutput`](crate::operation::get_license_recommendations::GetLicenseRecommendationsOutput).
    pub fn build(self) -> crate::operation::get_license_recommendations::GetLicenseRecommendationsOutput {
        crate::operation::get_license_recommendations::GetLicenseRecommendationsOutput {
            next_token: self.next_token,
            license_recommendations: self.license_recommendations,
            errors: self.errors,
            _request_id: self._request_id,
        }
    }
}