use crate::{KeyValue, StringValue};
use super::*;
pub enum SsmSpanBuilder {}
impl AwsSpanBuilder<'_> {
pub fn ssm(
method: impl Into<StringValue>,
parameter_name: Option<impl Into<StringValue>>,
) -> Self {
let mut attributes = Vec::new();
if let Some(name) = parameter_name {
attributes.push(KeyValue::new("aws.ssm.parameter_name", name.into()));
}
Self::client("SSM", method, attributes)
}
}
macro_rules! ssm_global_operation {
($op: ident) => {
impl SsmSpanBuilder {
#[doc = concat!("Creates a span builder for the SSM ", stringify!($op), " operation.")]
#[inline]
pub fn $op<'a>() -> AwsSpanBuilder<'a> {
AwsSpanBuilder::ssm(stringify_camel!($op), None::<StringValue>)
}
}
};
}
macro_rules! ssm_parameter_operation {
($op: ident) => {
impl SsmSpanBuilder {
#[doc = concat!("Creates a span builder for the SSM ", stringify!($op), " parameter operation.")]
pub fn $op<'a>(
parameter_name: impl Into<StringValue>,
) -> AwsSpanBuilder<'a> {
AwsSpanBuilder::ssm(stringify_camel!($op), Some(parameter_name))
}
}
};
}
ssm_parameter_operation!(get_parameter);
ssm_parameter_operation!(put_parameter);
ssm_parameter_operation!(delete_parameter);
ssm_parameter_operation!(get_parameter_history);
ssm_parameter_operation!(label_parameter_version);
ssm_parameter_operation!(unlabel_parameter_version);
ssm_global_operation!(get_parameters);
ssm_global_operation!(delete_parameters);
ssm_parameter_operation!(get_parameters_by_path);
ssm_global_operation!(describe_parameters);