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 UpdateCustomMetricInput {
    /// <p>The name of the custom metric. Cannot be updated.</p>
    pub metric_name: ::std::option::Option<::std::string::String>,
    /// <p>Field represents a friendly name in the console for the custom metric, it doesn't have to be unique. Don't use this name as the metric identifier in the device metric report. Can be updated.</p>
    pub display_name: ::std::option::Option<::std::string::String>,
}
impl UpdateCustomMetricInput {
    /// <p>The name of the custom metric. Cannot be updated.</p>
    pub fn metric_name(&self) -> ::std::option::Option<&str> {
        self.metric_name.as_deref()
    }
    /// <p>Field represents a friendly name in the console for the custom metric, it doesn't have to be unique. Don't use this name as the metric identifier in the device metric report. Can be updated.</p>
    pub fn display_name(&self) -> ::std::option::Option<&str> {
        self.display_name.as_deref()
    }
}
impl UpdateCustomMetricInput {
    /// Creates a new builder-style object to manufacture [`UpdateCustomMetricInput`](crate::operation::update_custom_metric::UpdateCustomMetricInput).
    pub fn builder() -> crate::operation::update_custom_metric::builders::UpdateCustomMetricInputBuilder {
        crate::operation::update_custom_metric::builders::UpdateCustomMetricInputBuilder::default()
    }
}

/// A builder for [`UpdateCustomMetricInput`](crate::operation::update_custom_metric::UpdateCustomMetricInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateCustomMetricInputBuilder {
    pub(crate) metric_name: ::std::option::Option<::std::string::String>,
    pub(crate) display_name: ::std::option::Option<::std::string::String>,
}
impl UpdateCustomMetricInputBuilder {
    /// <p>The name of the custom metric. Cannot be updated.</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 custom metric. Cannot be updated.</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 custom metric. Cannot be updated.</p>
    pub fn get_metric_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.metric_name
    }
    /// <p>Field represents a friendly name in the console for the custom metric, it doesn't have to be unique. Don't use this name as the metric identifier in the device metric report. Can be updated.</p>
    /// This field is required.
    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.display_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Field represents a friendly name in the console for the custom metric, it doesn't have to be unique. Don't use this name as the metric identifier in the device metric report. Can be updated.</p>
    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.display_name = input;
        self
    }
    /// <p>Field represents a friendly name in the console for the custom metric, it doesn't have to be unique. Don't use this name as the metric identifier in the device metric report. Can be updated.</p>
    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.display_name
    }
    /// Consumes the builder and constructs a [`UpdateCustomMetricInput`](crate::operation::update_custom_metric::UpdateCustomMetricInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_custom_metric::UpdateCustomMetricInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::update_custom_metric::UpdateCustomMetricInput {
            metric_name: self.metric_name,
            display_name: self.display_name,
        })
    }
}