aws-sdk-accessanalyzer 1.106.0

AWS SDK for Access Analyzer
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 GetFindingRecommendationOutput {
    /// <p>The time at which the retrieval of the finding recommendation was started.</p>
    pub started_at: ::aws_smithy_types::DateTime,
    /// <p>The time at which the retrieval of the finding recommendation was completed.</p>
    pub completed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>A token used for pagination of results returned.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    /// <p>Detailed information about the reason that the retrieval of a recommendation for the finding failed.</p>
    pub error: ::std::option::Option<crate::types::RecommendationError>,
    /// <p>The ARN of the resource of the finding.</p>
    pub resource_arn: ::std::string::String,
    /// <p>A group of recommended steps for the finding.</p>
    pub recommended_steps: ::std::option::Option<::std::vec::Vec<crate::types::RecommendedStep>>,
    /// <p>The type of recommendation for the finding.</p>
    pub recommendation_type: crate::types::RecommendationType,
    /// <p>The status of the retrieval of the finding recommendation.</p>
    pub status: crate::types::Status,
    _request_id: Option<String>,
}
impl GetFindingRecommendationOutput {
    /// <p>The time at which the retrieval of the finding recommendation was started.</p>
    pub fn started_at(&self) -> &::aws_smithy_types::DateTime {
        &self.started_at
    }
    /// <p>The time at which the retrieval of the finding recommendation was completed.</p>
    pub fn completed_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.completed_at.as_ref()
    }
    /// <p>A token used for pagination of results returned.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
    /// <p>Detailed information about the reason that the retrieval of a recommendation for the finding failed.</p>
    pub fn error(&self) -> ::std::option::Option<&crate::types::RecommendationError> {
        self.error.as_ref()
    }
    /// <p>The ARN of the resource of the finding.</p>
    pub fn resource_arn(&self) -> &str {
        use std::ops::Deref;
        self.resource_arn.deref()
    }
    /// <p>A group of recommended steps for the finding.</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 `.recommended_steps.is_none()`.
    pub fn recommended_steps(&self) -> &[crate::types::RecommendedStep] {
        self.recommended_steps.as_deref().unwrap_or_default()
    }
    /// <p>The type of recommendation for the finding.</p>
    pub fn recommendation_type(&self) -> &crate::types::RecommendationType {
        &self.recommendation_type
    }
    /// <p>The status of the retrieval of the finding recommendation.</p>
    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 {
    /// Creates a new builder-style object to manufacture [`GetFindingRecommendationOutput`](crate::operation::get_finding_recommendation::GetFindingRecommendationOutput).
    pub fn builder() -> crate::operation::get_finding_recommendation::builders::GetFindingRecommendationOutputBuilder {
        crate::operation::get_finding_recommendation::builders::GetFindingRecommendationOutputBuilder::default()
    }
}

/// A builder for [`GetFindingRecommendationOutput`](crate::operation::get_finding_recommendation::GetFindingRecommendationOutput).
#[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 {
    /// <p>The time at which the retrieval of the finding recommendation was started.</p>
    /// This field is required.
    pub fn started_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.started_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time at which the retrieval of the finding recommendation was started.</p>
    pub fn set_started_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.started_at = input;
        self
    }
    /// <p>The time at which the retrieval of the finding recommendation was started.</p>
    pub fn get_started_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.started_at
    }
    /// <p>The time at which the retrieval of the finding recommendation was completed.</p>
    pub fn completed_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.completed_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time at which the retrieval of the finding recommendation was completed.</p>
    pub fn set_completed_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.completed_at = input;
        self
    }
    /// <p>The time at which the retrieval of the finding recommendation was completed.</p>
    pub fn get_completed_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.completed_at
    }
    /// <p>A token used for pagination of results returned.</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>A token used for pagination of results returned.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>A token used for pagination of results returned.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    /// <p>Detailed information about the reason that the retrieval of a recommendation for the finding failed.</p>
    pub fn error(mut self, input: crate::types::RecommendationError) -> Self {
        self.error = ::std::option::Option::Some(input);
        self
    }
    /// <p>Detailed information about the reason that the retrieval of a recommendation for the finding failed.</p>
    pub fn set_error(mut self, input: ::std::option::Option<crate::types::RecommendationError>) -> Self {
        self.error = input;
        self
    }
    /// <p>Detailed information about the reason that the retrieval of a recommendation for the finding failed.</p>
    pub fn get_error(&self) -> &::std::option::Option<crate::types::RecommendationError> {
        &self.error
    }
    /// <p>The ARN of the resource of the finding.</p>
    /// This field is required.
    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
    }
    /// <p>The ARN of the resource of the finding.</p>
    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.resource_arn = input;
        self
    }
    /// <p>The ARN of the resource of the finding.</p>
    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.resource_arn
    }
    /// Appends an item to `recommended_steps`.
    ///
    /// To override the contents of this collection use [`set_recommended_steps`](Self::set_recommended_steps).
    ///
    /// <p>A group of recommended steps for the finding.</p>
    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
    }
    /// <p>A group of recommended steps for the finding.</p>
    pub fn set_recommended_steps(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RecommendedStep>>) -> Self {
        self.recommended_steps = input;
        self
    }
    /// <p>A group of recommended steps for the finding.</p>
    pub fn get_recommended_steps(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RecommendedStep>> {
        &self.recommended_steps
    }
    /// <p>The type of recommendation for the finding.</p>
    /// This field is required.
    pub fn recommendation_type(mut self, input: crate::types::RecommendationType) -> Self {
        self.recommendation_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of recommendation for the finding.</p>
    pub fn set_recommendation_type(mut self, input: ::std::option::Option<crate::types::RecommendationType>) -> Self {
        self.recommendation_type = input;
        self
    }
    /// <p>The type of recommendation for the finding.</p>
    pub fn get_recommendation_type(&self) -> &::std::option::Option<crate::types::RecommendationType> {
        &self.recommendation_type
    }
    /// <p>The status of the retrieval of the finding recommendation.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::Status) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the retrieval of the finding recommendation.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::Status>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status of the retrieval of the finding recommendation.</p>
    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
    }
    /// Consumes the builder and constructs a [`GetFindingRecommendationOutput`](crate::operation::get_finding_recommendation::GetFindingRecommendationOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`started_at`](crate::operation::get_finding_recommendation::builders::GetFindingRecommendationOutputBuilder::started_at)
    /// - [`resource_arn`](crate::operation::get_finding_recommendation::builders::GetFindingRecommendationOutputBuilder::resource_arn)
    /// - [`recommendation_type`](crate::operation::get_finding_recommendation::builders::GetFindingRecommendationOutputBuilder::recommendation_type)
    /// - [`status`](crate::operation::get_finding_recommendation::builders::GetFindingRecommendationOutputBuilder::status)
    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,
        })
    }
}