Skip to main content

pib_client/client/requests/body/by_id/organization/
post.rs

1// SPDX-FileCopyrightText: Politik im Blick developers
2// SPDX-FileCopyrightText: Wolfgang Silbermayr <wolfgang@silbermayr.at>
3//
4// SPDX-License-Identifier: AGPL-3.0-or-later OR EUPL-1.2
5
6use http_request_derive_client_reqwest::ReqwestClientError;
7use pib_client_requests::body::by_id::organization::post::Request;
8use pib_service_api_types::body::by_id::organization::{
9    by_id::get::ResponseBody, post::RequestBody,
10};
11use pib_service_core_types::BodyId;
12
13use crate::{Authorization, Client};
14
15impl Client {
16    pub async fn body_by_id_organization_post<A: Authorization + Sync>(
17        &self,
18        authorization: A,
19        body_id: BodyId,
20        payload: RequestBody,
21    ) -> Result<ResponseBody, ReqwestClientError> {
22        Ok(self
23            .execute_authorized(Request { body_id, payload }, authorization)
24            .await?
25            .0)
26    }
27}