1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
    /// Constructs a fluent builder for the [`CreateCustomMetric`](crate::operation::create_custom_metric::builders::CreateCustomMetricFluentBuilder) operation.
    ///
    /// - The fluent builder is configurable:
    ///   - [`metric_name(impl Into<String>)`](crate::operation::create_custom_metric::builders::CreateCustomMetricFluentBuilder::metric_name) / [`set_metric_name(Option<String>)`](crate::operation::create_custom_metric::builders::CreateCustomMetricFluentBuilder::set_metric_name):<br>required: **true**<br><p>The name of the custom metric. This will be used in the metric report submitted from the device/thing. The name can't begin with <code>aws:</code>. You can't change the name after you define it.</p><br>
    ///   - [`display_name(impl Into<String>)`](crate::operation::create_custom_metric::builders::CreateCustomMetricFluentBuilder::display_name) / [`set_display_name(Option<String>)`](crate::operation::create_custom_metric::builders::CreateCustomMetricFluentBuilder::set_display_name):<br>required: **false**<br><p>The friendly name in the console for the custom metric. This name doesn't have to be unique. Don't use this name as the metric identifier in the device metric report. You can update the friendly name after you define it.</p><br>
    ///   - [`metric_type(CustomMetricType)`](crate::operation::create_custom_metric::builders::CreateCustomMetricFluentBuilder::metric_type) / [`set_metric_type(Option<CustomMetricType>)`](crate::operation::create_custom_metric::builders::CreateCustomMetricFluentBuilder::set_metric_type):<br>required: **true**<br><p>The type of the custom metric.</p><important>  <p>The type <code>number</code> only takes a single metric value as an input, but when you submit the metrics value in the DeviceMetrics report, you must pass it as an array with a single value.</p> </important><br>
    ///   - [`tags(Tag)`](crate::operation::create_custom_metric::builders::CreateCustomMetricFluentBuilder::tags) / [`set_tags(Option<Vec::<Tag>>)`](crate::operation::create_custom_metric::builders::CreateCustomMetricFluentBuilder::set_tags):<br>required: **false**<br><p>Metadata that can be used to manage the custom metric.</p><br>
    ///   - [`client_request_token(impl Into<String>)`](crate::operation::create_custom_metric::builders::CreateCustomMetricFluentBuilder::client_request_token) / [`set_client_request_token(Option<String>)`](crate::operation::create_custom_metric::builders::CreateCustomMetricFluentBuilder::set_client_request_token):<br>required: **true**<br><p>Each custom metric must have a unique client request token. If you try to create a new custom metric that already exists with a different token, an exception occurs. If you omit this value, Amazon Web Services SDKs will automatically generate a unique client request.</p><br>
    /// - On success, responds with [`CreateCustomMetricOutput`](crate::operation::create_custom_metric::CreateCustomMetricOutput) with field(s):
    ///   - [`metric_name(Option<String>)`](crate::operation::create_custom_metric::CreateCustomMetricOutput::metric_name): <p>The name of the custom metric to be used in the metric report.</p>
    ///   - [`metric_arn(Option<String>)`](crate::operation::create_custom_metric::CreateCustomMetricOutput::metric_arn): <p>The Amazon Resource Number (ARN) of the custom metric. For example, <code>arn:<i>aws-partition</i>:iot:<i>region</i>:<i>accountId</i>:custommetric/<i>metricName</i> </code></p>
    /// - On failure, responds with [`SdkError<CreateCustomMetricError>`](crate::operation::create_custom_metric::CreateCustomMetricError)
    pub fn create_custom_metric(&self) -> crate::operation::create_custom_metric::builders::CreateCustomMetricFluentBuilder {
        crate::operation::create_custom_metric::builders::CreateCustomMetricFluentBuilder::new(self.handle.clone())
    }
}