Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #275 from technicat/relationship-with-suspended
added optional withSuspended param to TootClient.getRelationships (specifies whether to ignore suspended accounts)
- Loading branch information
Showing
2 changed files
with
30 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// RelationshipParams.swift | ||
// | ||
// | ||
// Created by Philip Chu on 4/5/24. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct RelationshipParams: Codable, Sendable { | ||
|
||
/// Whether relationships should be returned for suspended users, defaults to false. | ||
public var withSuspended: Bool? | ||
|
||
public init(withSuspended: Bool? = nil) { | ||
self.withSuspended = withSuspended | ||
} | ||
} | ||
|
||
extension RelationshipParams { | ||
var queryItems: [URLQueryItem] { | ||
[ | ||
URLQueryItem( | ||
name: "with_suspended", | ||
value: withSuspended?.description) | ||
].filter { $0.value != nil } | ||
} | ||
} |
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