-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c988451
commit d0eb677
Showing
6 changed files
with
74 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
Sources/OversizeAppStoreServices/Auth/Keychain/AppStoreCertificatePropertyWrapper.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
.../Auth/Keychain/SecureStorageService.swift → ...vices/Auth/Keychain/KeychainService.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
Sources/OversizeAppStoreServices/Services/UsersService.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// Copyright © 2024 Alexander Romanov | ||
// UsersService.swift, created on 22.09.2024 | ||
// | ||
|
||
import AppStoreConnect | ||
import OversizeModels | ||
|
||
public actor UsersService { | ||
private let client: AppStoreConnectClient? | ||
|
||
public init() { | ||
do { | ||
client = try AppStoreConnectClient(authenticator: EnvAuthenticator()) | ||
} catch { | ||
client = nil | ||
} | ||
} | ||
|
||
public func fetchCustomerReviews(versionId _: String) async -> Result<[User], AppError> { | ||
guard let client = client else { return .failure(.network(type: .unauthorized)) } | ||
let request = Resources.v1.users.get() | ||
do { | ||
let data = try await client.send(request).data | ||
return .success(data) | ||
} catch { | ||
return .failure(.network(type: .noResponse)) | ||
} | ||
} | ||
} |