From 03ea48eedcb37468a4cf31012edb720553a72a20 Mon Sep 17 00:00:00 2001 From: TheMoonThatRises <58153205+TheMoonThatRises@users.noreply.github.com> Date: Tue, 20 Aug 2024 01:23:13 -0600 Subject: [PATCH] move `checkCredentials` to `StudentVue` --- Sources/StudentVue/SOAPApi/StudentVueApi.swift | 2 +- Sources/StudentVue/StudentVue.swift | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Sources/StudentVue/SOAPApi/StudentVueApi.swift b/Sources/StudentVue/SOAPApi/StudentVueApi.swift index 168ccdc..1b6463f 100644 --- a/Sources/StudentVue/SOAPApi/StudentVueApi.swift +++ b/Sources/StudentVue/SOAPApi/StudentVueApi.swift @@ -187,7 +187,7 @@ public class StudentVueApi { /// - Throws: `Error` some other error has occured when api request was sent /// /// - Returns: Success or not - public func checkCredentials() async throws -> Bool { + internal func checkCredentials() async throws -> Bool { do { _ = try await xmlServiceRequest(methodName: .getSoundFileData) diff --git a/Sources/StudentVue/StudentVue.swift b/Sources/StudentVue/StudentVue.swift index 22b884f..d036364 100644 --- a/Sources/StudentVue/StudentVue.swift +++ b/Sources/StudentVue/StudentVue.swift @@ -48,4 +48,13 @@ public class StudentVue { self.api.updateCredentials(domain: domain, username: username, password: password) self.scraper.updateCredentials(domain: domain, username: username, password: password) } + + /// Checks validity of user credentials quickly + /// + /// - Throws: `Error` some other error has occured when api request was sent + /// + /// - Returns: Success or not + public func checkCredentials() async throws -> Bool { + return try await api.checkCredentials() + } }