aws-sdk-codeguruprofiler 1.98.0

AWS SDK for Amazon CodeGuru Profiler
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The structure representing the GetRecommendationsResponse.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetRecommendationsOutput {
    /// <p>The name of the profiling group the analysis data is about.</p>
    pub profiling_group_name: ::std::string::String,
    /// <p>The start time of the profile the analysis data is about. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
    pub profile_start_time: ::aws_smithy_types::DateTime,
    /// <p>The end time of the profile the analysis data is about. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
    pub profile_end_time: ::aws_smithy_types::DateTime,
    /// <p>The list of recommendations that the analysis found for this profile.</p>
    pub recommendations: ::std::vec::Vec<crate::types::Recommendation>,
    /// <p>The list of anomalies that the analysis has found for this profile.</p>
    pub anomalies: ::std::vec::Vec<crate::types::Anomaly>,
    _request_id: Option<String>,
}
impl GetRecommendationsOutput {
    /// <p>The name of the profiling group the analysis data is about.</p>
    pub fn profiling_group_name(&self) -> &str {
        use std::ops::Deref;
        self.profiling_group_name.deref()
    }
    /// <p>The start time of the profile the analysis data is about. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
    pub fn profile_start_time(&self) -> &::aws_smithy_types::DateTime {
        &self.profile_start_time
    }
    /// <p>The end time of the profile the analysis data is about. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
    pub fn profile_end_time(&self) -> &::aws_smithy_types::DateTime {
        &self.profile_end_time
    }
    /// <p>The list of recommendations that the analysis found for this profile.</p>
    pub fn recommendations(&self) -> &[crate::types::Recommendation] {
        use std::ops::Deref;
        self.recommendations.deref()
    }
    /// <p>The list of anomalies that the analysis has found for this profile.</p>
    pub fn anomalies(&self) -> &[crate::types::Anomaly] {
        use std::ops::Deref;
        self.anomalies.deref()
    }
}
impl ::aws_types::request_id::RequestId for GetRecommendationsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetRecommendationsOutput {
    /// Creates a new builder-style object to manufacture [`GetRecommendationsOutput`](crate::operation::get_recommendations::GetRecommendationsOutput).
    pub fn builder() -> crate::operation::get_recommendations::builders::GetRecommendationsOutputBuilder {
        crate::operation::get_recommendations::builders::GetRecommendationsOutputBuilder::default()
    }
}

/// A builder for [`GetRecommendationsOutput`](crate::operation::get_recommendations::GetRecommendationsOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetRecommendationsOutputBuilder {
    pub(crate) profiling_group_name: ::std::option::Option<::std::string::String>,
    pub(crate) profile_start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) profile_end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) recommendations: ::std::option::Option<::std::vec::Vec<crate::types::Recommendation>>,
    pub(crate) anomalies: ::std::option::Option<::std::vec::Vec<crate::types::Anomaly>>,
    _request_id: Option<String>,
}
impl GetRecommendationsOutputBuilder {
    /// <p>The name of the profiling group the analysis data is about.</p>
    /// This field is required.
    pub fn profiling_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.profiling_group_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the profiling group the analysis data is about.</p>
    pub fn set_profiling_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.profiling_group_name = input;
        self
    }
    /// <p>The name of the profiling group the analysis data is about.</p>
    pub fn get_profiling_group_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.profiling_group_name
    }
    /// <p>The start time of the profile the analysis data is about. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
    /// This field is required.
    pub fn profile_start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.profile_start_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The start time of the profile the analysis data is about. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
    pub fn set_profile_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.profile_start_time = input;
        self
    }
    /// <p>The start time of the profile the analysis data is about. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
    pub fn get_profile_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.profile_start_time
    }
    /// <p>The end time of the profile the analysis data is about. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
    /// This field is required.
    pub fn profile_end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.profile_end_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The end time of the profile the analysis data is about. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
    pub fn set_profile_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.profile_end_time = input;
        self
    }
    /// <p>The end time of the profile the analysis data is about. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
    pub fn get_profile_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.profile_end_time
    }
    /// Appends an item to `recommendations`.
    ///
    /// To override the contents of this collection use [`set_recommendations`](Self::set_recommendations).
    ///
    /// <p>The list of recommendations that the analysis found for this profile.</p>
    pub fn recommendations(mut self, input: crate::types::Recommendation) -> Self {
        let mut v = self.recommendations.unwrap_or_default();
        v.push(input);
        self.recommendations = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of recommendations that the analysis found for this profile.</p>
    pub fn set_recommendations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Recommendation>>) -> Self {
        self.recommendations = input;
        self
    }
    /// <p>The list of recommendations that the analysis found for this profile.</p>
    pub fn get_recommendations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Recommendation>> {
        &self.recommendations
    }
    /// Appends an item to `anomalies`.
    ///
    /// To override the contents of this collection use [`set_anomalies`](Self::set_anomalies).
    ///
    /// <p>The list of anomalies that the analysis has found for this profile.</p>
    pub fn anomalies(mut self, input: crate::types::Anomaly) -> Self {
        let mut v = self.anomalies.unwrap_or_default();
        v.push(input);
        self.anomalies = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of anomalies that the analysis has found for this profile.</p>
    pub fn set_anomalies(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Anomaly>>) -> Self {
        self.anomalies = input;
        self
    }
    /// <p>The list of anomalies that the analysis has found for this profile.</p>
    pub fn get_anomalies(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Anomaly>> {
        &self.anomalies
    }
    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 [`GetRecommendationsOutput`](crate::operation::get_recommendations::GetRecommendationsOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`profiling_group_name`](crate::operation::get_recommendations::builders::GetRecommendationsOutputBuilder::profiling_group_name)
    /// - [`profile_start_time`](crate::operation::get_recommendations::builders::GetRecommendationsOutputBuilder::profile_start_time)
    /// - [`profile_end_time`](crate::operation::get_recommendations::builders::GetRecommendationsOutputBuilder::profile_end_time)
    /// - [`recommendations`](crate::operation::get_recommendations::builders::GetRecommendationsOutputBuilder::recommendations)
    /// - [`anomalies`](crate::operation::get_recommendations::builders::GetRecommendationsOutputBuilder::anomalies)
    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 {
            profiling_group_name: self.profiling_group_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "profiling_group_name",
                    "profiling_group_name was not specified but it is required when building GetRecommendationsOutput",
                )
            })?,
            profile_start_time: self.profile_start_time.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "profile_start_time",
                    "profile_start_time was not specified but it is required when building GetRecommendationsOutput",
                )
            })?,
            profile_end_time: self.profile_end_time.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "profile_end_time",
                    "profile_end_time was not specified but it is required when building 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",
                )
            })?,
            anomalies: self.anomalies.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "anomalies",
                    "anomalies was not specified but it is required when building GetRecommendationsOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}