async fn send(
            &self,
            client: &Client,
        ) -> Result<ResponseWrapper<Self::Output, Self>, ApiError<Client::Response>> {
            let resp = self.send_raw(client).await?;
            let media = resp.media_type();
            if let Some(ty) = media {
                if media_types::M_0.matches(&ty) {
                    return ResponseWrapper::wrap(resp, |r| async {
                        let bytes = r.body_bytes().await?;
                        serde_json::from_reader(bytes.as_ref()).map_err(ApiError::from)
                    })
                    .await;
                } else if media_types::M_1.matches(&ty) {
                    return ResponseWrapper::wrap(resp, |r| async {
                        let bytes = r.body_bytes().await?;
                        serde_yaml::from_reader(bytes.as_ref()).map_err(ApiError::from)
                    })
                    .await;
                }
            }

            let ty = resp
                .header(http::header::CONTENT_TYPE.as_str())
                .map(|v| String::from_utf8_lossy(v.as_bytes()).into_owned())
                .unwrap_or_default();
            Err(ApiError::UnsupportedMediaType(ty, Mutex::new(resp)))
        }
/// Sends the request and returns a future for the response object.
Sends the request and returns a future for the response object.
Sends the request and returns a future for the response object .
async fn send(
            &self,
            client: &Client,
        ) -> Result<ResponseWrapper<Self::Output, Self>, ApiError<Client::Response>> {
            let resp = self.send_raw(client).await?;
            let media = resp.media_type();
            if let Some(ty) = media {
                if media_types::M_0.matches(&ty) {
                    return ResponseWrapper::wrap(resp, |r| async {
                        let bytes = r.body_bytes().await?;
                        serde_json::from_reader(bytes.as_ref()).map_err(ApiError::from)
                    })
                    .await;
                } else if media_types::M_1.matches(&ty) {
                    return ResponseWrapper::wrap(resp, |r| async {
                        let bytes = r.body_bytes().await?;
                        serde_yaml::from_reader(bytes.as_ref()).map_err(ApiError::from)
                    })
                    .await;
                }
            }
            let ty = resp
                .header(http::header::CONTENT_TYPE.as_str())
                .map(|v| String::from_utf8_lossy(v.as_bytes()).into_owned())
                .unwrap_or_default();
            Err(ApiError::UnsupportedMediaType(ty, Mutex::new(resp)))
        }
async fn send ( & self , client : & Client , ) -> Result < ResponseWrapper < Self :: Output , Self > , ApiError < Client :: Response > > { let resp = self . send_raw ( client ) . await ? ; let media = resp . media_type ( ) ; if let Some ( ty ) = media { if media_types :: M_0 . matches ( & ty ) { return ResponseWrapper :: wrap ( resp , | r | async { let bytes = r . body_bytes ( ) . await ? ; serde_json :: from_reader ( bytes . as_ref ( ) ) . map_err ( ApiError :: from ) } ) . await ; } else if media_types :: M_1 . matches ( & ty ) { return ResponseWrapper :: wrap ( resp , | r | async { let bytes = r . body_bytes ( ) . await ? ; serde_yaml :: from_reader ( bytes . as_ref ( ) ) . map_err ( ApiError :: from ) } ) . await ; } } let ty = resp . header ( http :: header :: CONTENT_TYPE . as_str ( ) ) . map ( | v | String :: from_utf8_lossy ( v . as_bytes ( ) ) . into_owned ( ) ) . unwrap_or_default ( ) ; Err ( ApiError :: UnsupportedMediaType ( ty , Mutex :: new ( resp ) ) ) }
Sends the request and returns a future for the response object.
Sends the request and returns a future for the response object .
&self
client
&Client