aws-sdk-devopsagent 1.4.0

AWS SDK for AWS DevOps Agent Service
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 GetAccountUsageOutput {
    /// Monthly investigation hours usage and limit for an account
    pub monthly_account_investigation_hours: ::std::option::Option<crate::types::UsageMetric>,
    /// Monthly evaluation hours usage and limit for an account
    pub monthly_account_evaluation_hours: ::std::option::Option<crate::types::UsageMetric>,
    /// Monthly system learning hours usage and limit for an account
    pub monthly_account_system_learning_hours: ::std::option::Option<crate::types::UsageMetric>,
    /// Monthly on-demand hours usage and limit for an account
    pub monthly_account_on_demand_hours: ::std::option::Option<crate::types::UsageMetric>,
    /// The start time of the usage tracking period
    pub usage_period_start_time: ::aws_smithy_types::DateTime,
    /// The end time of the usage tracking period
    pub usage_period_end_time: ::aws_smithy_types::DateTime,
    _request_id: Option<String>,
}
impl GetAccountUsageOutput {
    /// Monthly investigation hours usage and limit for an account
    pub fn monthly_account_investigation_hours(&self) -> ::std::option::Option<&crate::types::UsageMetric> {
        self.monthly_account_investigation_hours.as_ref()
    }
    /// Monthly evaluation hours usage and limit for an account
    pub fn monthly_account_evaluation_hours(&self) -> ::std::option::Option<&crate::types::UsageMetric> {
        self.monthly_account_evaluation_hours.as_ref()
    }
    /// Monthly system learning hours usage and limit for an account
    pub fn monthly_account_system_learning_hours(&self) -> ::std::option::Option<&crate::types::UsageMetric> {
        self.monthly_account_system_learning_hours.as_ref()
    }
    /// Monthly on-demand hours usage and limit for an account
    pub fn monthly_account_on_demand_hours(&self) -> ::std::option::Option<&crate::types::UsageMetric> {
        self.monthly_account_on_demand_hours.as_ref()
    }
    /// The start time of the usage tracking period
    pub fn usage_period_start_time(&self) -> &::aws_smithy_types::DateTime {
        &self.usage_period_start_time
    }
    /// The end time of the usage tracking period
    pub fn usage_period_end_time(&self) -> &::aws_smithy_types::DateTime {
        &self.usage_period_end_time
    }
}
impl ::aws_types::request_id::RequestId for GetAccountUsageOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetAccountUsageOutput {
    /// Creates a new builder-style object to manufacture [`GetAccountUsageOutput`](crate::operation::get_account_usage::GetAccountUsageOutput).
    pub fn builder() -> crate::operation::get_account_usage::builders::GetAccountUsageOutputBuilder {
        crate::operation::get_account_usage::builders::GetAccountUsageOutputBuilder::default()
    }
}

/// A builder for [`GetAccountUsageOutput`](crate::operation::get_account_usage::GetAccountUsageOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetAccountUsageOutputBuilder {
    pub(crate) monthly_account_investigation_hours: ::std::option::Option<crate::types::UsageMetric>,
    pub(crate) monthly_account_evaluation_hours: ::std::option::Option<crate::types::UsageMetric>,
    pub(crate) monthly_account_system_learning_hours: ::std::option::Option<crate::types::UsageMetric>,
    pub(crate) monthly_account_on_demand_hours: ::std::option::Option<crate::types::UsageMetric>,
    pub(crate) usage_period_start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) usage_period_end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetAccountUsageOutputBuilder {
    /// Monthly investigation hours usage and limit for an account
    pub fn monthly_account_investigation_hours(mut self, input: crate::types::UsageMetric) -> Self {
        self.monthly_account_investigation_hours = ::std::option::Option::Some(input);
        self
    }
    /// Monthly investigation hours usage and limit for an account
    pub fn set_monthly_account_investigation_hours(mut self, input: ::std::option::Option<crate::types::UsageMetric>) -> Self {
        self.monthly_account_investigation_hours = input;
        self
    }
    /// Monthly investigation hours usage and limit for an account
    pub fn get_monthly_account_investigation_hours(&self) -> &::std::option::Option<crate::types::UsageMetric> {
        &self.monthly_account_investigation_hours
    }
    /// Monthly evaluation hours usage and limit for an account
    pub fn monthly_account_evaluation_hours(mut self, input: crate::types::UsageMetric) -> Self {
        self.monthly_account_evaluation_hours = ::std::option::Option::Some(input);
        self
    }
    /// Monthly evaluation hours usage and limit for an account
    pub fn set_monthly_account_evaluation_hours(mut self, input: ::std::option::Option<crate::types::UsageMetric>) -> Self {
        self.monthly_account_evaluation_hours = input;
        self
    }
    /// Monthly evaluation hours usage and limit for an account
    pub fn get_monthly_account_evaluation_hours(&self) -> &::std::option::Option<crate::types::UsageMetric> {
        &self.monthly_account_evaluation_hours
    }
    /// Monthly system learning hours usage and limit for an account
    pub fn monthly_account_system_learning_hours(mut self, input: crate::types::UsageMetric) -> Self {
        self.monthly_account_system_learning_hours = ::std::option::Option::Some(input);
        self
    }
    /// Monthly system learning hours usage and limit for an account
    pub fn set_monthly_account_system_learning_hours(mut self, input: ::std::option::Option<crate::types::UsageMetric>) -> Self {
        self.monthly_account_system_learning_hours = input;
        self
    }
    /// Monthly system learning hours usage and limit for an account
    pub fn get_monthly_account_system_learning_hours(&self) -> &::std::option::Option<crate::types::UsageMetric> {
        &self.monthly_account_system_learning_hours
    }
    /// Monthly on-demand hours usage and limit for an account
    pub fn monthly_account_on_demand_hours(mut self, input: crate::types::UsageMetric) -> Self {
        self.monthly_account_on_demand_hours = ::std::option::Option::Some(input);
        self
    }
    /// Monthly on-demand hours usage and limit for an account
    pub fn set_monthly_account_on_demand_hours(mut self, input: ::std::option::Option<crate::types::UsageMetric>) -> Self {
        self.monthly_account_on_demand_hours = input;
        self
    }
    /// Monthly on-demand hours usage and limit for an account
    pub fn get_monthly_account_on_demand_hours(&self) -> &::std::option::Option<crate::types::UsageMetric> {
        &self.monthly_account_on_demand_hours
    }
    /// The start time of the usage tracking period
    /// This field is required.
    pub fn usage_period_start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.usage_period_start_time = ::std::option::Option::Some(input);
        self
    }
    /// The start time of the usage tracking period
    pub fn set_usage_period_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.usage_period_start_time = input;
        self
    }
    /// The start time of the usage tracking period
    pub fn get_usage_period_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.usage_period_start_time
    }
    /// The end time of the usage tracking period
    /// This field is required.
    pub fn usage_period_end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.usage_period_end_time = ::std::option::Option::Some(input);
        self
    }
    /// The end time of the usage tracking period
    pub fn set_usage_period_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.usage_period_end_time = input;
        self
    }
    /// The end time of the usage tracking period
    pub fn get_usage_period_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.usage_period_end_time
    }
    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 [`GetAccountUsageOutput`](crate::operation::get_account_usage::GetAccountUsageOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`usage_period_start_time`](crate::operation::get_account_usage::builders::GetAccountUsageOutputBuilder::usage_period_start_time)
    /// - [`usage_period_end_time`](crate::operation::get_account_usage::builders::GetAccountUsageOutputBuilder::usage_period_end_time)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_account_usage::GetAccountUsageOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_account_usage::GetAccountUsageOutput {
            monthly_account_investigation_hours: self.monthly_account_investigation_hours,
            monthly_account_evaluation_hours: self.monthly_account_evaluation_hours,
            monthly_account_system_learning_hours: self.monthly_account_system_learning_hours,
            monthly_account_on_demand_hours: self.monthly_account_on_demand_hours,
            usage_period_start_time: self.usage_period_start_time.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "usage_period_start_time",
                    "usage_period_start_time was not specified but it is required when building GetAccountUsageOutput",
                )
            })?,
            usage_period_end_time: self.usage_period_end_time.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "usage_period_end_time",
                    "usage_period_end_time was not specified but it is required when building GetAccountUsageOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}