use crate::client::Client;
#[allow(unused_imports)]
use crate::enums::*;
use crate::error::Error;
#[allow(unused_imports)]
use crate::models::*;
#[allow(unused_imports)]
use serde::Serialize;
pub struct OAuthManagementApi<'a> {
pub(crate) client: &'a Client,
}
impl<'a> OAuthManagementApi<'a> {
pub async fn get_oauth_installation(
&self,
) -> Result<SdkGetOAuthInstallationResponseValue200ApplicationJson, Error> {
self.get_oauth_installation_with_options(None).await
}
pub async fn get_oauth_installation_with_options(
&self,
options: Option<&crate::RequestOptions>,
) -> Result<SdkGetOAuthInstallationResponseValue200ApplicationJson, Error> {
self.get_oauth_installation_raw(options)
.await
.map(|response| response.data)
}
pub async fn get_oauth_installation_raw(
&self,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkGetOAuthInstallationResponseValue200ApplicationJson>, Error>
{
let path = "/v2/oauth/installation".to_string();
let method = http::Method::GET;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("getOAuthInstallation".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(
method,
&path,
&(),
options,
"GET /v2/oauth/installation",
)
.await
}
pub async fn delete_oauth_installation(&self) -> Result<(), Error> {
self.delete_oauth_installation_with_options(None).await
}
pub async fn delete_oauth_installation_with_options(
&self,
options: Option<&crate::RequestOptions>,
) -> Result<(), Error> {
self.delete_oauth_installation_raw(options)
.await
.map(|response| response.data)
}
pub async fn delete_oauth_installation_raw(
&self,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<()>, Error> {
let path = "/v2/oauth/installation".to_string();
let method = http::Method::DELETE;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("deleteOAuthInstallation".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(
method,
&path,
&(),
options,
"DELETE /v2/oauth/installation",
)
.await
}
}