1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use crate::{prelude::*, resources::permission::PermissionResponse as GetPermissionResponse};

operation! {
    GetPermission,
    client: PermissionClient,
    ?consistency_level: ConsistencyLevel
}

impl GetPermissionBuilder {
    pub fn into_future(self) -> GetPermission {
        Box::pin(async move {
            let mut request = self.client.permission_request(azure_core::Method::Get);

            if let Some(cl) = &self.consistency_level {
                request.insert_headers(cl);
            }

            let response = self
                .client
                .pipeline()
                .send(
                    self.context.clone().insert(ResourceType::Permissions),
                    &mut request,
                )
                .await?;

            GetPermissionResponse::try_from(response).await
        })
    }
}