aws-sdk-iot 1.112.0

AWS SDK for AWS IoT
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 UpdateFleetMetricInput {
    /// <p>The name of the fleet metric to update.</p>
    pub metric_name: ::std::option::Option<::std::string::String>,
    /// <p>The search query string.</p>
    pub query_string: ::std::option::Option<::std::string::String>,
    /// <p>The type of the aggregation query.</p>
    pub aggregation_type: ::std::option::Option<crate::types::AggregationType>,
    /// <p>The time in seconds between fleet metric emissions. Range \[60(1 min), 86400(1 day)\] and must be multiple of 60.</p>
    pub period: ::std::option::Option<i32>,
    /// <p>The field to aggregate.</p>
    pub aggregation_field: ::std::option::Option<::std::string::String>,
    /// <p>The description of the fleet metric.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The version of the query.</p>
    pub query_version: ::std::option::Option<::std::string::String>,
    /// <p>The name of the index to search.</p>
    pub index_name: ::std::option::Option<::std::string::String>,
    /// <p>Used to support unit transformation such as milliseconds to seconds. The unit must be supported by <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html">CW metric</a>.</p>
    pub unit: ::std::option::Option<crate::types::FleetMetricUnit>,
    /// <p>The expected version of the fleet metric record in the registry.</p>
    pub expected_version: ::std::option::Option<i64>,
}
impl UpdateFleetMetricInput {
    /// <p>The name of the fleet metric to update.</p>
    pub fn metric_name(&self) -> ::std::option::Option<&str> {
        self.metric_name.as_deref()
    }
    /// <p>The search query string.</p>
    pub fn query_string(&self) -> ::std::option::Option<&str> {
        self.query_string.as_deref()
    }
    /// <p>The type of the aggregation query.</p>
    pub fn aggregation_type(&self) -> ::std::option::Option<&crate::types::AggregationType> {
        self.aggregation_type.as_ref()
    }
    /// <p>The time in seconds between fleet metric emissions. Range \[60(1 min), 86400(1 day)\] and must be multiple of 60.</p>
    pub fn period(&self) -> ::std::option::Option<i32> {
        self.period
    }
    /// <p>The field to aggregate.</p>
    pub fn aggregation_field(&self) -> ::std::option::Option<&str> {
        self.aggregation_field.as_deref()
    }
    /// <p>The description of the fleet metric.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The version of the query.</p>
    pub fn query_version(&self) -> ::std::option::Option<&str> {
        self.query_version.as_deref()
    }
    /// <p>The name of the index to search.</p>
    pub fn index_name(&self) -> ::std::option::Option<&str> {
        self.index_name.as_deref()
    }
    /// <p>Used to support unit transformation such as milliseconds to seconds. The unit must be supported by <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html">CW metric</a>.</p>
    pub fn unit(&self) -> ::std::option::Option<&crate::types::FleetMetricUnit> {
        self.unit.as_ref()
    }
    /// <p>The expected version of the fleet metric record in the registry.</p>
    pub fn expected_version(&self) -> ::std::option::Option<i64> {
        self.expected_version
    }
}
impl UpdateFleetMetricInput {
    /// Creates a new builder-style object to manufacture [`UpdateFleetMetricInput`](crate::operation::update_fleet_metric::UpdateFleetMetricInput).
    pub fn builder() -> crate::operation::update_fleet_metric::builders::UpdateFleetMetricInputBuilder {
        crate::operation::update_fleet_metric::builders::UpdateFleetMetricInputBuilder::default()
    }
}

/// A builder for [`UpdateFleetMetricInput`](crate::operation::update_fleet_metric::UpdateFleetMetricInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateFleetMetricInputBuilder {
    pub(crate) metric_name: ::std::option::Option<::std::string::String>,
    pub(crate) query_string: ::std::option::Option<::std::string::String>,
    pub(crate) aggregation_type: ::std::option::Option<crate::types::AggregationType>,
    pub(crate) period: ::std::option::Option<i32>,
    pub(crate) aggregation_field: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) query_version: ::std::option::Option<::std::string::String>,
    pub(crate) index_name: ::std::option::Option<::std::string::String>,
    pub(crate) unit: ::std::option::Option<crate::types::FleetMetricUnit>,
    pub(crate) expected_version: ::std::option::Option<i64>,
}
impl UpdateFleetMetricInputBuilder {
    /// <p>The name of the fleet metric to update.</p>
    /// This field is required.
    pub fn metric_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.metric_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the fleet metric to update.</p>
    pub fn set_metric_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.metric_name = input;
        self
    }
    /// <p>The name of the fleet metric to update.</p>
    pub fn get_metric_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.metric_name
    }
    /// <p>The search query string.</p>
    pub fn query_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.query_string = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The search query string.</p>
    pub fn set_query_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.query_string = input;
        self
    }
    /// <p>The search query string.</p>
    pub fn get_query_string(&self) -> &::std::option::Option<::std::string::String> {
        &self.query_string
    }
    /// <p>The type of the aggregation query.</p>
    pub fn aggregation_type(mut self, input: crate::types::AggregationType) -> Self {
        self.aggregation_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of the aggregation query.</p>
    pub fn set_aggregation_type(mut self, input: ::std::option::Option<crate::types::AggregationType>) -> Self {
        self.aggregation_type = input;
        self
    }
    /// <p>The type of the aggregation query.</p>
    pub fn get_aggregation_type(&self) -> &::std::option::Option<crate::types::AggregationType> {
        &self.aggregation_type
    }
    /// <p>The time in seconds between fleet metric emissions. Range \[60(1 min), 86400(1 day)\] and must be multiple of 60.</p>
    pub fn period(mut self, input: i32) -> Self {
        self.period = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time in seconds between fleet metric emissions. Range \[60(1 min), 86400(1 day)\] and must be multiple of 60.</p>
    pub fn set_period(mut self, input: ::std::option::Option<i32>) -> Self {
        self.period = input;
        self
    }
    /// <p>The time in seconds between fleet metric emissions. Range \[60(1 min), 86400(1 day)\] and must be multiple of 60.</p>
    pub fn get_period(&self) -> &::std::option::Option<i32> {
        &self.period
    }
    /// <p>The field to aggregate.</p>
    pub fn aggregation_field(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.aggregation_field = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The field to aggregate.</p>
    pub fn set_aggregation_field(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.aggregation_field = input;
        self
    }
    /// <p>The field to aggregate.</p>
    pub fn get_aggregation_field(&self) -> &::std::option::Option<::std::string::String> {
        &self.aggregation_field
    }
    /// <p>The description of the fleet metric.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description of the fleet metric.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The description of the fleet metric.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The version of the query.</p>
    pub fn query_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.query_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The version of the query.</p>
    pub fn set_query_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.query_version = input;
        self
    }
    /// <p>The version of the query.</p>
    pub fn get_query_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.query_version
    }
    /// <p>The name of the index to search.</p>
    /// This field is required.
    pub fn index_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.index_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the index to search.</p>
    pub fn set_index_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.index_name = input;
        self
    }
    /// <p>The name of the index to search.</p>
    pub fn get_index_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.index_name
    }
    /// <p>Used to support unit transformation such as milliseconds to seconds. The unit must be supported by <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html">CW metric</a>.</p>
    pub fn unit(mut self, input: crate::types::FleetMetricUnit) -> Self {
        self.unit = ::std::option::Option::Some(input);
        self
    }
    /// <p>Used to support unit transformation such as milliseconds to seconds. The unit must be supported by <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html">CW metric</a>.</p>
    pub fn set_unit(mut self, input: ::std::option::Option<crate::types::FleetMetricUnit>) -> Self {
        self.unit = input;
        self
    }
    /// <p>Used to support unit transformation such as milliseconds to seconds. The unit must be supported by <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html">CW metric</a>.</p>
    pub fn get_unit(&self) -> &::std::option::Option<crate::types::FleetMetricUnit> {
        &self.unit
    }
    /// <p>The expected version of the fleet metric record in the registry.</p>
    pub fn expected_version(mut self, input: i64) -> Self {
        self.expected_version = ::std::option::Option::Some(input);
        self
    }
    /// <p>The expected version of the fleet metric record in the registry.</p>
    pub fn set_expected_version(mut self, input: ::std::option::Option<i64>) -> Self {
        self.expected_version = input;
        self
    }
    /// <p>The expected version of the fleet metric record in the registry.</p>
    pub fn get_expected_version(&self) -> &::std::option::Option<i64> {
        &self.expected_version
    }
    /// Consumes the builder and constructs a [`UpdateFleetMetricInput`](crate::operation::update_fleet_metric::UpdateFleetMetricInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_fleet_metric::UpdateFleetMetricInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_fleet_metric::UpdateFleetMetricInput {
            metric_name: self.metric_name,
            query_string: self.query_string,
            aggregation_type: self.aggregation_type,
            period: self.period,
            aggregation_field: self.aggregation_field,
            description: self.description,
            query_version: self.query_version,
            index_name: self.index_name,
            unit: self.unit,
            expected_version: self.expected_version,
        })
    }
}