use openlark_core::constants::{
APP_ACCESS_TOKEN_INTERNAL_URL_PATH, APP_ACCESS_TOKEN_URL_PATH, APPLY_APP_TICKET_PATH,
TENANT_ACCESS_TOKEN_INTERNAL_URL_PATH, TENANT_ACCESS_TOKEN_URL_PATH,
};
#[derive(Debug, Clone)]
pub enum AuthApiV3 {
AppAccessTokenInternal,
TenantAccessTokenInternal,
AppTicketResend,
AppAccessToken,
TenantAccessToken,
}
impl AuthApiV3 {
pub fn path(&self) -> &'static str {
match self {
AuthApiV3::AppAccessTokenInternal => APP_ACCESS_TOKEN_INTERNAL_URL_PATH,
AuthApiV3::TenantAccessTokenInternal => TENANT_ACCESS_TOKEN_INTERNAL_URL_PATH,
AuthApiV3::AppTicketResend => APPLY_APP_TICKET_PATH,
AuthApiV3::AppAccessToken => APP_ACCESS_TOKEN_URL_PATH,
AuthApiV3::TenantAccessToken => TENANT_ACCESS_TOKEN_URL_PATH,
}
}
}
#[derive(Debug, Clone)]
pub enum AuthenApiV1 {
UserInfo,
AccessToken,
RefreshAccessToken,
OidcAccessToken,
OidcRefreshAccessToken,
}
impl AuthenApiV1 {
pub fn path(&self) -> &'static str {
match self {
AuthenApiV1::UserInfo => "/open-apis/authen/v1/user_info",
AuthenApiV1::AccessToken => "/open-apis/authen/v1/access_token",
AuthenApiV1::RefreshAccessToken => "/open-apis/authen/v1/refresh_access_token",
AuthenApiV1::OidcAccessToken => "/open-apis/authen/v1/oidc/access_token",
AuthenApiV1::OidcRefreshAccessToken => "/open-apis/authen/v1/oidc/refresh_access_token",
}
}
}
#[derive(Debug, Clone)]
pub enum OAuthApiOld {
Index,
}
impl OAuthApiOld {
pub fn path(&self) -> &'static str {
match self {
OAuthApiOld::Index => "/open-apis/authen/v1/index",
}
}
}
#[derive(Debug, Clone)]
pub enum HumanAuthenticationApiV1 {
IdentityCreate,
}
impl HumanAuthenticationApiV1 {
pub fn path(&self) -> &'static str {
match self {
HumanAuthenticationApiV1::IdentityCreate => {
"/open-apis/human_authentication/v1/identities"
}
}
}
}
pub mod prelude {
pub use super::{AuthApiV3, AuthenApiV1, HumanAuthenticationApiV1, OAuthApiOld, PassportApiV1};
}
#[derive(Debug, Clone)]
pub enum PassportApiV1 {
SessionQuery,
SessionLogout,
}
impl PassportApiV1 {
pub fn path(&self) -> &'static str {
match self {
PassportApiV1::SessionQuery => "/open-apis/passport/v1/sessions/query",
PassportApiV1::SessionLogout => "/open-apis/passport/v1/sessions/logout",
}
}
}