2023-02-17 12:21:09 +01:00
|
|
|
//
|
|
|
|
// https://mczachurski.dev
|
|
|
|
// Copyright © 2023 Marcin Czachurski and the repository contributors.
|
2023-03-28 10:35:38 +02:00
|
|
|
// Licensed under the Apache License 2.0.
|
2023-02-17 12:21:09 +01:00
|
|
|
//
|
2023-04-01 12:10:59 +02:00
|
|
|
|
2023-02-17 12:21:09 +01:00
|
|
|
import Foundation
|
2023-02-19 10:32:38 +01:00
|
|
|
import PixelfedKit
|
2023-02-17 12:21:09 +01:00
|
|
|
|
|
|
|
extension Client {
|
|
|
|
public class Media: BaseClient {
|
2023-02-17 14:47:59 +01:00
|
|
|
func upload(data: Data, fileName: String, mimeType: String) async throws -> UploadedAttachment? {
|
2023-02-19 10:43:37 +01:00
|
|
|
return try await pixelfedClient.upload(data: data, fileName: fileName, mimeType: mimeType)
|
2023-02-17 14:47:59 +01:00
|
|
|
}
|
2023-04-01 12:10:59 +02:00
|
|
|
|
2023-02-17 14:47:59 +01:00
|
|
|
func update(id: String, description: String?, focus: CGPoint?) async throws -> UploadedAttachment? {
|
2023-02-19 10:43:37 +01:00
|
|
|
return try await pixelfedClient.update(id: id, description: description, focus: focus)
|
2023-02-17 12:21:09 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|