Skip to main content

telemetry_rust/middleware/aws/operations/
appconfigdata.rs

1/// AWS AppConfig Data operations
2///
3/// API Reference: https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/API_Operations_AWS_AppConfig_Data.html
4use crate::{KeyValue, StringValue};
5
6use super::*;
7
8/// Builder for AppConfig Data-specific OpenTelemetry spans.
9///
10/// This enum serves as a namespace for AppConfig Data operation span builders.
11/// Each operation provides a specific method to create properly configured
12/// spans with AppConfig Data-specific attributes.
13pub enum AppConfigDataSpanBuilder {}
14
15impl AwsSpanBuilder<'_> {
16    /// Creates an AppConfig Data operation span builder.
17    ///
18    /// This method creates a span builder configured for AppConfig Data
19    /// operations with the application identifier as the primary resource identifier.
20    ///
21    /// # Arguments
22    ///
23    /// * `method` - The AppConfig Data operation method name
24    /// * `application_id` - Optional application identifier for the operation
25    pub fn appconfigdata(
26        method: impl Into<StringValue>,
27        application_id: Option<impl Into<StringValue>>,
28    ) -> Self {
29        let mut attributes = Vec::new();
30        if let Some(id) = application_id {
31            attributes.push(KeyValue::new("aws.appconfigdata.application_id", id.into()));
32        }
33        Self::client("AppConfigData", method, attributes)
34    }
35}
36
37macro_rules! appconfigdata_global_operation {
38    ($op: ident) => {
39        impl AppConfigDataSpanBuilder {
40            #[doc = concat!("Creates a span builder for the AppConfig Data ", stringify!($op), " operation.")]
41            #[inline]
42            pub fn $op<'a>() -> AwsSpanBuilder<'a> {
43                AwsSpanBuilder::appconfigdata(stringify_camel!($op), None::<StringValue>)
44            }
45        }
46    };
47}
48
49macro_rules! appconfigdata_application_operation {
50    ($op: ident) => {
51        impl AppConfigDataSpanBuilder {
52            #[doc = concat!("Creates a span builder for the AppConfig Data ", stringify!($op), " operation.")]
53            ///
54            /// # Arguments
55            ///
56            /// * `application_id` - The application identifier
57            pub fn $op<'a>(
58                application_id: impl Into<StringValue>,
59            ) -> AwsSpanBuilder<'a> {
60                AwsSpanBuilder::appconfigdata(stringify_camel!($op), Some(application_id))
61            }
62        }
63    };
64}
65
66// Session operations
67appconfigdata_application_operation!(start_configuration_session);
68
69// Configuration retrieval operations
70appconfigdata_global_operation!(get_latest_configuration);