use crate::{KeyValue, StringValue, semconv};
use super::*;
pub enum S3SpanBuilder {}
impl AwsSpanBuilder<'_> {
pub fn s3(
method: impl Into<StringValue>,
bucket: Option<impl Into<StringValue>>,
key: Option<impl Into<StringValue>>,
) -> Self {
let mut attributes = Vec::new();
if let Some(bucket) = bucket {
attributes.push(KeyValue::new(semconv::AWS_S3_BUCKET, bucket.into()));
}
if let Some(key) = key {
attributes.push(KeyValue::new(semconv::AWS_S3_KEY, key.into()));
}
Self::client("S3", method, attributes)
}
}
macro_rules! s3_global_operation {
($op: ident) => {
impl S3SpanBuilder {
#[doc = concat!("Creates a span builder for the S3 ", stringify!($op), " global operation.")]
#[inline]
pub fn $op<'a>() -> AwsSpanBuilder<'a> {
AwsSpanBuilder::s3(
stringify_camel!($op),
None::<StringValue>,
None::<StringValue>,
)
}
}
};
}
macro_rules! s3_bucket_operation {
($op: ident) => {
impl S3SpanBuilder {
#[doc = concat!("Creates a span builder for the S3 ", stringify!($op), " bucket operation.")]
pub fn $op<'a>(bucket: impl Into<StringValue>) -> AwsSpanBuilder<'a> {
AwsSpanBuilder::s3(
stringify_camel!($op),
Some(bucket),
None::<StringValue>,
)
}
}
};
}
macro_rules! s3_object_operation {
($op: ident) => {
impl S3SpanBuilder {
#[doc = concat!("Creates a span builder for the S3 ", stringify!($op), " object operation.")]
pub fn $op<'a>(
bucket: impl Into<StringValue>,
key: impl Into<StringValue>,
) -> AwsSpanBuilder<'a> {
AwsSpanBuilder::s3(stringify_camel!($op), Some(bucket), Some(key))
}
}
};
}
s3_global_operation!(list_buckets);
s3_global_operation!(list_directory_buckets);
s3_bucket_operation!(create_bucket);
s3_bucket_operation!(delete_bucket);
s3_bucket_operation!(head_bucket);
s3_bucket_operation!(create_session);
s3_object_operation!(copy_object);
s3_object_operation!(delete_object);
s3_object_operation!(get_object);
s3_object_operation!(head_object);
s3_object_operation!(put_object);
s3_object_operation!(rename_object);
s3_object_operation!(restore_object);
s3_object_operation!(select_object_content);
s3_object_operation!(get_object_torrent);
s3_bucket_operation!(delete_objects);
s3_bucket_operation!(list_objects);
s3_bucket_operation!(list_objects_v2);
s3_bucket_operation!(list_object_versions);
s3_object_operation!(create_multipart_upload);
s3_object_operation!(upload_part);
s3_object_operation!(upload_part_copy);
s3_object_operation!(complete_multipart_upload);
s3_object_operation!(abort_multipart_upload);
s3_bucket_operation!(list_multipart_uploads);
s3_object_operation!(list_parts);
s3_object_operation!(get_object_acl);
s3_object_operation!(put_object_acl);
s3_object_operation!(get_object_attributes);
s3_object_operation!(get_object_tagging);
s3_object_operation!(put_object_tagging);
s3_object_operation!(delete_object_tagging);
s3_object_operation!(get_object_legal_hold);
s3_object_operation!(put_object_legal_hold);
s3_object_operation!(get_object_retention);
s3_object_operation!(put_object_retention);
s3_bucket_operation!(get_object_lock_configuration);
s3_bucket_operation!(put_object_lock_configuration);
s3_bucket_operation!(get_bucket_acl);
s3_bucket_operation!(put_bucket_acl);
s3_bucket_operation!(get_bucket_policy);
s3_bucket_operation!(put_bucket_policy);
s3_bucket_operation!(delete_bucket_policy);
s3_bucket_operation!(get_bucket_policy_status);
s3_bucket_operation!(get_bucket_cors);
s3_bucket_operation!(put_bucket_cors);
s3_bucket_operation!(delete_bucket_cors);
s3_bucket_operation!(get_bucket_encryption);
s3_bucket_operation!(put_bucket_encryption);
s3_bucket_operation!(delete_bucket_encryption);
s3_bucket_operation!(get_bucket_lifecycle_configuration);
s3_bucket_operation!(put_bucket_lifecycle_configuration);
s3_bucket_operation!(delete_bucket_lifecycle);
s3_bucket_operation!(get_bucket_replication);
s3_bucket_operation!(put_bucket_replication);
s3_bucket_operation!(delete_bucket_replication);
s3_bucket_operation!(get_bucket_tagging);
s3_bucket_operation!(put_bucket_tagging);
s3_bucket_operation!(delete_bucket_tagging);
s3_bucket_operation!(get_bucket_versioning);
s3_bucket_operation!(put_bucket_versioning);
s3_bucket_operation!(get_bucket_website);
s3_bucket_operation!(put_bucket_website);
s3_bucket_operation!(delete_bucket_website);
s3_bucket_operation!(get_bucket_logging);
s3_bucket_operation!(put_bucket_logging);
s3_bucket_operation!(get_bucket_notification_configuration);
s3_bucket_operation!(put_bucket_notification_configuration);
s3_bucket_operation!(get_bucket_location);
s3_bucket_operation!(get_bucket_accelerate_configuration);
s3_bucket_operation!(put_bucket_accelerate_configuration);
s3_bucket_operation!(get_bucket_request_payment);
s3_bucket_operation!(put_bucket_request_payment);
s3_bucket_operation!(get_bucket_ownership_controls);
s3_bucket_operation!(put_bucket_ownership_controls);
s3_bucket_operation!(delete_bucket_ownership_controls);
s3_bucket_operation!(get_bucket_analytics_configuration);
s3_bucket_operation!(put_bucket_analytics_configuration);
s3_bucket_operation!(delete_bucket_analytics_configuration);
s3_bucket_operation!(list_bucket_analytics_configurations);
s3_bucket_operation!(get_bucket_intelligent_tiering_configuration);
s3_bucket_operation!(put_bucket_intelligent_tiering_configuration);
s3_bucket_operation!(delete_bucket_intelligent_tiering_configuration);
s3_bucket_operation!(list_bucket_intelligent_tiering_configurations);
s3_bucket_operation!(get_bucket_inventory_configuration);
s3_bucket_operation!(put_bucket_inventory_configuration);
s3_bucket_operation!(delete_bucket_inventory_configuration);
s3_bucket_operation!(list_bucket_inventory_configurations);
s3_bucket_operation!(get_bucket_metrics_configuration);
s3_bucket_operation!(put_bucket_metrics_configuration);
s3_bucket_operation!(delete_bucket_metrics_configuration);
s3_bucket_operation!(list_bucket_metrics_configurations);
s3_bucket_operation!(get_public_access_block);
s3_bucket_operation!(put_public_access_block);
s3_bucket_operation!(delete_public_access_block);
s3_bucket_operation!(create_bucket_metadata_configuration);
s3_bucket_operation!(create_bucket_metadata_table_configuration);
s3_bucket_operation!(delete_bucket_metadata_configuration);
s3_bucket_operation!(delete_bucket_metadata_table_configuration);
s3_bucket_operation!(get_bucket_metadata_configuration);
s3_bucket_operation!(get_bucket_metadata_table_configuration);
s3_bucket_operation!(update_bucket_metadata_inventory_table_configuration);
s3_bucket_operation!(update_bucket_metadata_journal_table_configuration);
s3_global_operation!(write_get_object_response);