#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetFindingRecommendationOutput {
pub started_at: ::aws_smithy_types::DateTime,
pub completed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub next_token: ::std::option::Option<::std::string::String>,
pub error: ::std::option::Option<crate::types::RecommendationError>,
pub resource_arn: ::std::string::String,
pub recommended_steps: ::std::option::Option<::std::vec::Vec<crate::types::RecommendedStep>>,
pub recommendation_type: crate::types::RecommendationType,
pub status: crate::types::Status,
_request_id: Option<String>,
}
impl GetFindingRecommendationOutput {
pub fn started_at(&self) -> &::aws_smithy_types::DateTime {
&self.started_at
}
pub fn completed_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.completed_at.as_ref()
}
pub fn next_token(&self) -> ::std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn error(&self) -> ::std::option::Option<&crate::types::RecommendationError> {
self.error.as_ref()
}
pub fn resource_arn(&self) -> &str {
use std::ops::Deref;
self.resource_arn.deref()
}
pub fn recommended_steps(&self) -> &[crate::types::RecommendedStep] {
self.recommended_steps.as_deref().unwrap_or_default()
}
pub fn recommendation_type(&self) -> &crate::types::RecommendationType {
&self.recommendation_type
}
pub fn status(&self) -> &crate::types::Status {
&self.status
}
}
impl ::aws_types::request_id::RequestId for GetFindingRecommendationOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetFindingRecommendationOutput {
pub fn builder() -> crate::operation::get_finding_recommendation::builders::GetFindingRecommendationOutputBuilder {
crate::operation::get_finding_recommendation::builders::GetFindingRecommendationOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetFindingRecommendationOutputBuilder {
pub(crate) started_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) completed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) next_token: ::std::option::Option<::std::string::String>,
pub(crate) error: ::std::option::Option<crate::types::RecommendationError>,
pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
pub(crate) recommended_steps: ::std::option::Option<::std::vec::Vec<crate::types::RecommendedStep>>,
pub(crate) recommendation_type: ::std::option::Option<crate::types::RecommendationType>,
pub(crate) status: ::std::option::Option<crate::types::Status>,
_request_id: Option<String>,
}
impl GetFindingRecommendationOutputBuilder {
pub fn started_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.started_at = ::std::option::Option::Some(input);
self
}
pub fn set_started_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.started_at = input;
self
}
pub fn get_started_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.started_at
}
pub fn completed_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.completed_at = ::std::option::Option::Some(input);
self
}
pub fn set_completed_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.completed_at = input;
self
}
pub fn get_completed_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.completed_at
}
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
}
pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
&self.next_token
}
pub fn error(mut self, input: crate::types::RecommendationError) -> Self {
self.error = ::std::option::Option::Some(input);
self
}
pub fn set_error(mut self, input: ::std::option::Option<crate::types::RecommendationError>) -> Self {
self.error = input;
self
}
pub fn get_error(&self) -> &::std::option::Option<crate::types::RecommendationError> {
&self.error
}
pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.resource_arn = ::std::option::Option::Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.resource_arn
}
pub fn recommended_steps(mut self, input: crate::types::RecommendedStep) -> Self {
let mut v = self.recommended_steps.unwrap_or_default();
v.push(input);
self.recommended_steps = ::std::option::Option::Some(v);
self
}
pub fn set_recommended_steps(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RecommendedStep>>) -> Self {
self.recommended_steps = input;
self
}
pub fn get_recommended_steps(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RecommendedStep>> {
&self.recommended_steps
}
pub fn recommendation_type(mut self, input: crate::types::RecommendationType) -> Self {
self.recommendation_type = ::std::option::Option::Some(input);
self
}
pub fn set_recommendation_type(mut self, input: ::std::option::Option<crate::types::RecommendationType>) -> Self {
self.recommendation_type = input;
self
}
pub fn get_recommendation_type(&self) -> &::std::option::Option<crate::types::RecommendationType> {
&self.recommendation_type
}
pub fn status(mut self, input: crate::types::Status) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
pub fn set_status(mut self, input: ::std::option::Option<crate::types::Status>) -> Self {
self.status = input;
self
}
pub fn get_status(&self) -> &::std::option::Option<crate::types::Status> {
&self.status
}
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_finding_recommendation::GetFindingRecommendationOutput,
::aws_smithy_types::error::operation::BuildError,
> {
::std::result::Result::Ok(crate::operation::get_finding_recommendation::GetFindingRecommendationOutput {
started_at: self.started_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"started_at",
"started_at was not specified but it is required when building GetFindingRecommendationOutput",
)
})?,
completed_at: self.completed_at,
next_token: self.next_token,
error: self.error,
resource_arn: self.resource_arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"resource_arn",
"resource_arn was not specified but it is required when building GetFindingRecommendationOutput",
)
})?,
recommended_steps: self.recommended_steps,
recommendation_type: self.recommendation_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"recommendation_type",
"recommendation_type was not specified but it is required when building GetFindingRecommendationOutput",
)
})?,
status: self.status.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"status",
"status was not specified but it is required when building GetFindingRecommendationOutput",
)
})?,
_request_id: self._request_id,
})
}
}