aws_sdk_wisdom/operation/get_recommendations/
_get_recommendations_output.rs#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetRecommendationsOutput {
pub recommendations: ::std::vec::Vec<crate::types::RecommendationData>,
pub triggers: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationTrigger>>,
_request_id: Option<String>,
}
impl GetRecommendationsOutput {
pub fn recommendations(&self) -> &[crate::types::RecommendationData] {
use std::ops::Deref;
self.recommendations.deref()
}
pub fn triggers(&self) -> &[crate::types::RecommendationTrigger] {
self.triggers.as_deref().unwrap_or_default()
}
}
impl ::aws_types::request_id::RequestId for GetRecommendationsOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetRecommendationsOutput {
pub fn builder() -> crate::operation::get_recommendations::builders::GetRecommendationsOutputBuilder {
crate::operation::get_recommendations::builders::GetRecommendationsOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetRecommendationsOutputBuilder {
pub(crate) recommendations: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationData>>,
pub(crate) triggers: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationTrigger>>,
_request_id: Option<String>,
}
impl GetRecommendationsOutputBuilder {
pub fn recommendations(mut self, input: crate::types::RecommendationData) -> Self {
let mut v = self.recommendations.unwrap_or_default();
v.push(input);
self.recommendations = ::std::option::Option::Some(v);
self
}
pub fn set_recommendations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationData>>) -> Self {
self.recommendations = input;
self
}
pub fn get_recommendations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RecommendationData>> {
&self.recommendations
}
pub fn triggers(mut self, input: crate::types::RecommendationTrigger) -> Self {
let mut v = self.triggers.unwrap_or_default();
v.push(input);
self.triggers = ::std::option::Option::Some(v);
self
}
pub fn set_triggers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationTrigger>>) -> Self {
self.triggers = input;
self
}
pub fn get_triggers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RecommendationTrigger>> {
&self.triggers
}
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
}
pub fn build(
self,
) -> ::std::result::Result<crate::operation::get_recommendations::GetRecommendationsOutput, ::aws_smithy_types::error::operation::BuildError>
{
::std::result::Result::Ok(crate::operation::get_recommendations::GetRecommendationsOutput {
recommendations: self.recommendations.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"recommendations",
"recommendations was not specified but it is required when building GetRecommendationsOutput",
)
})?,
triggers: self.triggers,
_request_id: self._request_id,
})
}
}