aws-sdk-deadline 1.19.0

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

/// <p>A list of statistics for a session.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Statistics {
    /// <p>The queue ID.</p>
    pub queue_id: ::std::option::Option<::std::string::String>,
    /// <p>The fleet ID.</p>
    pub fleet_id: ::std::option::Option<::std::string::String>,
    /// <p>The job ID.</p>
    pub job_id: ::std::option::Option<::std::string::String>,
    /// <p>The job name.</p>
    pub job_name: ::std::option::Option<::std::string::String>,
    /// <p>The user ID.</p>
    pub user_id: ::std::option::Option<::std::string::String>,
    /// <p>The type of usage for the statistics.</p>
    pub usage_type: ::std::option::Option<crate::types::UsageType>,
    /// <p>The licensed product.</p>
    pub license_product: ::std::option::Option<::std::string::String>,
    /// <p>The type of instance.</p>
    pub instance_type: ::std::option::Option<::std::string::String>,
    /// <p>The number of instances in a list of statistics.</p>
    pub count: i32,
    /// <p>How the statistics should appear in USD. Options include: minimum, maximum, average or sum.</p>
    pub cost_in_usd: ::std::option::Option<crate::types::Stats>,
    /// <p>The total aggregated runtime.</p>
    pub runtime_in_seconds: ::std::option::Option<crate::types::Stats>,
    /// <p>The start time for the aggregation.</p>
    pub aggregation_start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The end time for the aggregation.</p>
    pub aggregation_end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl Statistics {
    /// <p>The queue ID.</p>
    pub fn queue_id(&self) -> ::std::option::Option<&str> {
        self.queue_id.as_deref()
    }
    /// <p>The fleet ID.</p>
    pub fn fleet_id(&self) -> ::std::option::Option<&str> {
        self.fleet_id.as_deref()
    }
    /// <p>The job ID.</p>
    pub fn job_id(&self) -> ::std::option::Option<&str> {
        self.job_id.as_deref()
    }
    /// <p>The job name.</p>
    pub fn job_name(&self) -> ::std::option::Option<&str> {
        self.job_name.as_deref()
    }
    /// <p>The user ID.</p>
    pub fn user_id(&self) -> ::std::option::Option<&str> {
        self.user_id.as_deref()
    }
    /// <p>The type of usage for the statistics.</p>
    pub fn usage_type(&self) -> ::std::option::Option<&crate::types::UsageType> {
        self.usage_type.as_ref()
    }
    /// <p>The licensed product.</p>
    pub fn license_product(&self) -> ::std::option::Option<&str> {
        self.license_product.as_deref()
    }
    /// <p>The type of instance.</p>
    pub fn instance_type(&self) -> ::std::option::Option<&str> {
        self.instance_type.as_deref()
    }
    /// <p>The number of instances in a list of statistics.</p>
    pub fn count(&self) -> i32 {
        self.count
    }
    /// <p>How the statistics should appear in USD. Options include: minimum, maximum, average or sum.</p>
    pub fn cost_in_usd(&self) -> ::std::option::Option<&crate::types::Stats> {
        self.cost_in_usd.as_ref()
    }
    /// <p>The total aggregated runtime.</p>
    pub fn runtime_in_seconds(&self) -> ::std::option::Option<&crate::types::Stats> {
        self.runtime_in_seconds.as_ref()
    }
    /// <p>The start time for the aggregation.</p>
    pub fn aggregation_start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.aggregation_start_time.as_ref()
    }
    /// <p>The end time for the aggregation.</p>
    pub fn aggregation_end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.aggregation_end_time.as_ref()
    }
}
impl Statistics {
    /// Creates a new builder-style object to manufacture [`Statistics`](crate::types::Statistics).
    pub fn builder() -> crate::types::builders::StatisticsBuilder {
        crate::types::builders::StatisticsBuilder::default()
    }
}

/// A builder for [`Statistics`](crate::types::Statistics).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StatisticsBuilder {
    pub(crate) queue_id: ::std::option::Option<::std::string::String>,
    pub(crate) fleet_id: ::std::option::Option<::std::string::String>,
    pub(crate) job_id: ::std::option::Option<::std::string::String>,
    pub(crate) job_name: ::std::option::Option<::std::string::String>,
    pub(crate) user_id: ::std::option::Option<::std::string::String>,
    pub(crate) usage_type: ::std::option::Option<crate::types::UsageType>,
    pub(crate) license_product: ::std::option::Option<::std::string::String>,
    pub(crate) instance_type: ::std::option::Option<::std::string::String>,
    pub(crate) count: ::std::option::Option<i32>,
    pub(crate) cost_in_usd: ::std::option::Option<crate::types::Stats>,
    pub(crate) runtime_in_seconds: ::std::option::Option<crate::types::Stats>,
    pub(crate) aggregation_start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) aggregation_end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl StatisticsBuilder {
    /// <p>The queue ID.</p>
    pub fn queue_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.queue_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The queue ID.</p>
    pub fn set_queue_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.queue_id = input;
        self
    }
    /// <p>The queue ID.</p>
    pub fn get_queue_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.queue_id
    }
    /// <p>The fleet ID.</p>
    pub fn fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.fleet_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The fleet ID.</p>
    pub fn set_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.fleet_id = input;
        self
    }
    /// <p>The fleet ID.</p>
    pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.fleet_id
    }
    /// <p>The job ID.</p>
    pub fn job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.job_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The job ID.</p>
    pub fn set_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.job_id = input;
        self
    }
    /// <p>The job ID.</p>
    pub fn get_job_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.job_id
    }
    /// <p>The job name.</p>
    pub fn job_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.job_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The job name.</p>
    pub fn set_job_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.job_name = input;
        self
    }
    /// <p>The job name.</p>
    pub fn get_job_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.job_name
    }
    /// <p>The user ID.</p>
    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.user_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The user ID.</p>
    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.user_id = input;
        self
    }
    /// <p>The user ID.</p>
    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.user_id
    }
    /// <p>The type of usage for the statistics.</p>
    pub fn usage_type(mut self, input: crate::types::UsageType) -> Self {
        self.usage_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of usage for the statistics.</p>
    pub fn set_usage_type(mut self, input: ::std::option::Option<crate::types::UsageType>) -> Self {
        self.usage_type = input;
        self
    }
    /// <p>The type of usage for the statistics.</p>
    pub fn get_usage_type(&self) -> &::std::option::Option<crate::types::UsageType> {
        &self.usage_type
    }
    /// <p>The licensed product.</p>
    pub fn license_product(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.license_product = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The licensed product.</p>
    pub fn set_license_product(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.license_product = input;
        self
    }
    /// <p>The licensed product.</p>
    pub fn get_license_product(&self) -> &::std::option::Option<::std::string::String> {
        &self.license_product
    }
    /// <p>The type of instance.</p>
    pub fn instance_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The type of instance.</p>
    pub fn set_instance_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_type = input;
        self
    }
    /// <p>The type of instance.</p>
    pub fn get_instance_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_type
    }
    /// <p>The number of instances in a list of statistics.</p>
    /// This field is required.
    pub fn count(mut self, input: i32) -> Self {
        self.count = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of instances in a list of statistics.</p>
    pub fn set_count(mut self, input: ::std::option::Option<i32>) -> Self {
        self.count = input;
        self
    }
    /// <p>The number of instances in a list of statistics.</p>
    pub fn get_count(&self) -> &::std::option::Option<i32> {
        &self.count
    }
    /// <p>How the statistics should appear in USD. Options include: minimum, maximum, average or sum.</p>
    /// This field is required.
    pub fn cost_in_usd(mut self, input: crate::types::Stats) -> Self {
        self.cost_in_usd = ::std::option::Option::Some(input);
        self
    }
    /// <p>How the statistics should appear in USD. Options include: minimum, maximum, average or sum.</p>
    pub fn set_cost_in_usd(mut self, input: ::std::option::Option<crate::types::Stats>) -> Self {
        self.cost_in_usd = input;
        self
    }
    /// <p>How the statistics should appear in USD. Options include: minimum, maximum, average or sum.</p>
    pub fn get_cost_in_usd(&self) -> &::std::option::Option<crate::types::Stats> {
        &self.cost_in_usd
    }
    /// <p>The total aggregated runtime.</p>
    /// This field is required.
    pub fn runtime_in_seconds(mut self, input: crate::types::Stats) -> Self {
        self.runtime_in_seconds = ::std::option::Option::Some(input);
        self
    }
    /// <p>The total aggregated runtime.</p>
    pub fn set_runtime_in_seconds(mut self, input: ::std::option::Option<crate::types::Stats>) -> Self {
        self.runtime_in_seconds = input;
        self
    }
    /// <p>The total aggregated runtime.</p>
    pub fn get_runtime_in_seconds(&self) -> &::std::option::Option<crate::types::Stats> {
        &self.runtime_in_seconds
    }
    /// <p>The start time for the aggregation.</p>
    pub fn aggregation_start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.aggregation_start_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The start time for the aggregation.</p>
    pub fn set_aggregation_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.aggregation_start_time = input;
        self
    }
    /// <p>The start time for the aggregation.</p>
    pub fn get_aggregation_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.aggregation_start_time
    }
    /// <p>The end time for the aggregation.</p>
    pub fn aggregation_end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.aggregation_end_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The end time for the aggregation.</p>
    pub fn set_aggregation_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.aggregation_end_time = input;
        self
    }
    /// <p>The end time for the aggregation.</p>
    pub fn get_aggregation_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.aggregation_end_time
    }
    /// Consumes the builder and constructs a [`Statistics`](crate::types::Statistics).
    /// This method will fail if any of the following fields are not set:
    /// - [`count`](crate::types::builders::StatisticsBuilder::count)
    pub fn build(self) -> ::std::result::Result<crate::types::Statistics, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Statistics {
            queue_id: self.queue_id,
            fleet_id: self.fleet_id,
            job_id: self.job_id,
            job_name: self.job_name,
            user_id: self.user_id,
            usage_type: self.usage_type,
            license_product: self.license_product,
            instance_type: self.instance_type,
            count: self.count.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "count",
                    "count was not specified but it is required when building Statistics",
                )
            })?,
            cost_in_usd: self.cost_in_usd,
            runtime_in_seconds: self.runtime_in_seconds,
            aggregation_start_time: self.aggregation_start_time,
            aggregation_end_time: self.aggregation_end_time,
        })
    }
}