pub struct TmcClient {
client: Client,
admin_access_token: SecretString,
ratelimit_api_key: SecretString,
}Fields§
§client: Client§admin_access_token: SecretString§ratelimit_api_key: SecretStringImplementations§
Source§impl TmcClient
impl TmcClient
fn check_if_tmc_error_response(response_text: &str) -> Option<UtilError>
async fn deserialize_response_with_tmc_error_check<T: DeserializeOwned>( &self, response: Response, error_context: &str, ) -> UtilResult<T>
pub fn new_from_env() -> UtilResult<Self>
async fn request_with_headers( &self, method: Method, url: &str, tmc_request_auth: TMCRequestAuth, body: Option<Value>, ) -> UtilResult<Response>
pub async fn update_user_information( &self, first_name: String, last_name: String, email: Option<String>, user_upstream_id: String, ) -> UtilResult<()>
pub async fn post_new_user_to_tmc( &self, user_info: NewUserInfo, app_conf: &ApplicationConfiguration, ) -> UtilResult<i32>
pub async fn set_user_password_managed_by_courses_mooc_fi( &self, user_upstream_id: String, user_id: Uuid, ) -> UtilResult<()>
pub async fn get_user_from_tmc_with_email( &self, email: String, ) -> UtilResult<TmcUserInfo>
pub async fn delete_user_from_tmc( &self, user_upstream_id: String, ) -> UtilResult<bool>
pub async fn get_user_from_tmc_mooc_fi_by_tmc_access_token( &self, tmc_access_token: &SecretString, ) -> UtilResult<TMCUser>
pub async fn get_user_from_tmc_mooc_fi_by_tmc_access_token_and_upstream_id( &self, upstream_id: &i32, ) -> UtilResult<TMCUser>
pub fn mock_for_test() -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TmcClient
impl !RefUnwindSafe for TmcClient
impl Send for TmcClient
impl Sync for TmcClient
impl Unpin for TmcClient
impl !UnwindSafe for TmcClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more