use crate::framework::endpoint::EndpointSpec;
use crate::framework::endpoint::Method;
use crate::framework::response::{ApiResult, ApiSuccess};
#[derive(Debug)]
pub struct ReadKeyMetadata<'a> {
pub account_identifier: &'a str,
pub namespace_identifier: &'a str,
pub key: &'a str,
}
impl ApiResult for Option<serde_json::Value> {}
impl EndpointSpec for ReadKeyMetadata<'_> {
type JsonResponse = Option<serde_json::Value>;
type ResponseType = ApiSuccess<Self::JsonResponse>;
fn method(&self) -> Method {
Method::GET
}
fn path(&self) -> String {
format!(
"accounts/{}/storage/kv/namespaces/{}/metadata/{}",
self.account_identifier,
self.namespace_identifier,
super::url_encode_key(self.key)
)
}
}