atlassian_rust_api/jira/endpoints/attachments/
get_attachment_meta.rs1use std::sync::Arc;
2
3use crate::{Jira, Result, rest_client::RestClient, web::Endpoint};
4
5#[derive(Debug, Clone)]
6pub struct GetAttachmentMetaBuilder {
7 client: Arc<RestClient>,
8 request: GetAttachmentMetaRequest,
9}
10
11#[derive(Debug, Clone, Default)]
12struct GetAttachmentMetaRequest;
13
14impl Endpoint for GetAttachmentMetaRequest {
15 fn endpoint(&self) -> std::borrow::Cow<'static, str> {
16 "attachment/meta".into()
17 }
18}
19
20impl GetAttachmentMetaBuilder {
21 fn new(client: Arc<RestClient>) -> GetAttachmentMetaBuilder {
22 GetAttachmentMetaBuilder { client, request: GetAttachmentMetaRequest::default() }
23 }
24
25 pub async fn send(self) -> Result<serde_json::Value> {
26 self.client.get(self.request).await
27 }
28}
29
30impl Jira {
31 pub fn get_attachment_meta(&self) -> GetAttachmentMetaBuilder {
33 GetAttachmentMetaBuilder::new(Arc::clone(&self.client))
34 }
35}