Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Sources/NextcloudKit/NextcloudKit+ShareDownloadLimit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ public extension NextcloudKit {
}

func getDownloadLimit(account: String, token: String, completion: @escaping (NKDownloadLimit?, NKError) -> Void) {
guard token.isEmpty == false else {
self.nkCommonInstance.writeLog("[ERROR] Attempt to get share download limit with empty token!")
return
}

let endpoint = makeEndpoint(with: token)
let options = NKRequestOptions()

Expand Down Expand Up @@ -81,6 +86,11 @@ public extension NextcloudKit {
}

func removeShareDownloadLimit(account: String, token: String, completion: @escaping (_ error: NKError) -> Void) {
guard token.isEmpty == false else {
self.nkCommonInstance.writeLog("[ERROR] Attempt to remove share download limit with empty token!")
return
}

let endpoint = makeEndpoint(with: token)
let options = NKRequestOptions()

Expand Down Expand Up @@ -117,6 +127,11 @@ public extension NextcloudKit {
}

func setShareDownloadLimit(account: String, token: String, limit: Int, completion: @escaping (_ error: NKError) -> Void) {
guard token.isEmpty == false else {
self.nkCommonInstance.writeLog("[ERROR] Attempt to set share download limit with empty token!")
return
}

let endpoint = makeEndpoint(with: token)
let options = NKRequestOptions()
options.contentType = "application/json"
Expand Down
Loading