Skip to content

Commit

Permalink
add support for edit_current_application endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ivinjabraham committed Nov 13, 2024
1 parent 57fdc2f commit 424af70
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/http/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ use reqwest::Url;
use reqwest::{Client, ClientBuilder, Response as ReqwestResponse, StatusCode};
use secrecy::{ExposeSecret, SecretString};
use serde::de::DeserializeOwned;
use serde::Serialize;
use serde_json::to_vec;
use tracing::{debug, instrument, warn};

use super::multipart::{Multipart, MultipartUpload};
Expand Down Expand Up @@ -3311,6 +3313,26 @@ impl Http {
.await
}

/// Modifies information about the current application.
///
/// **Note**: Only applications may use this endpoint.
pub async fn edit_current_application_info(
&self,
map: &impl Serialize,
) -> Result<CurrentApplicationInfo> {
let body = to_vec(map)?;

self.fire(Request {
body: Some(body),
multipart: None,
headers: None,
method: LightMethod::Patch,
route: Route::Oauth2ApplicationCurrent,
params: None,
})
.await
}

/// Gets information about the user we're connected with.
pub async fn get_current_user(&self) -> Result<CurrentUser> {
self.fire(Request {
Expand Down

0 comments on commit 424af70

Please sign in to comment.