diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Enums/ListingType.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Enums/ListingType.swift index c299eb9..0106644 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Enums/ListingType.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Enums/ListingType.swift @@ -4,7 +4,6 @@ public enum ListingType: String, Codable, CustomStringConvertible, CaseIterable case all = "All" case local = "Local" case subscribed = "Subscribed" - case community = "Community" public var description: String { return rawValue diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Enums/SortType.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Enums/SortType.swift index f39eb73..a7879b5 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Enums/SortType.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Enums/SortType.swift @@ -6,24 +6,30 @@ public enum SortType: String, Codable, CustomStringConvertible, CaseIterable { case active = "Active" /// Posts sorted by a decaying rank. case hot = "Hot" - /// Posts sorted by the most comments. - case mostComments = "MostComments" /// Posts sorted by the published time. case new = "New" - /// Posts sorted by the newest comments, with no necrobumping. IE a forum sort. - case newComments = "NewComments" /// Posts sorted by the published time ascending case old = "Old" - /// The top posts of all time. - case topAll = "TopAll" /// The top posts for this last day. case topDay = "TopDay" - /// The top posts for this last month. - case topMonth = "TopMonth" /// The top posts for this last week. case topWeek = "TopWeek" + /// The top posts for this last month. + case topMonth = "TopMonth" /// The top posts for this last year. case topYear = "TopYear" + /// The top posts of all time. + case topAll = "TopAll" + /// Posts sorted by the most comments. + case mostComments = "MostComments" + /// Posts sorted by the newest comments, with no necrobumping. IE a forum sort. + case newComments = "NewComments" + /// The top posts for this last hour. + case topHour = "TopHour" + /// The top posts for this last six hour. + case topSixHour = "TopSixHour" + /// The top posts for this last six hour. + case topTwelveHour = "TopTwelveHour" public var description: String { return rawValue diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Requests/SaveUserSettings.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Requests/SaveUserSettings.swift index 01f7dc0..2a3dfa4 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Requests/SaveUserSettings.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Requests/SaveUserSettings.swift @@ -11,8 +11,8 @@ public struct SaveUserSettingsRequest: APIRequest { public let banner: String? public let bio: String? public let bot_account: Bool? - public let default_listing_type: Int? - public let default_sort_type: Int? + public let default_listing_type: ListingType? + public let default_sort_type: SortType? public let discussion_languages: [Int]? public let display_name: String? public let email: String? @@ -33,8 +33,8 @@ public struct SaveUserSettingsRequest: APIRequest { banner: String? = nil, bio: String? = nil, bot_account: Bool? = nil, - default_listing_type: Int? = nil, - default_sort_type: Int? = nil, + default_listing_type: ListingType? = nil, + default_sort_type: SortType? = nil, discussion_languages: [Int]? = nil, display_name: String? = nil, email: String? = nil, diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/AdminPurgeCommentView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/AdminPurgeCommentView.swift index 6b5d927..ba1f486 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/AdminPurgeCommentView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/AdminPurgeCommentView.swift @@ -1,11 +1,11 @@ import Foundation public struct AdminPurgeCommentView: Codable { - public let admin: PersonSafe? + public let admin: Person? public let admin_purge_comment: AdminPurgeComment public let post: Post - public init(admin: PersonSafe? = nil, admin_purge_comment: AdminPurgeComment, post: Post) { + public init(admin: Person? = nil, admin_purge_comment: AdminPurgeComment, post: Post) { self.admin = admin self.admin_purge_comment = admin_purge_comment self.post = post diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/AdminPurgeCommunityView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/AdminPurgeCommunityView.swift index 425aa38..f77712d 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/AdminPurgeCommunityView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/AdminPurgeCommunityView.swift @@ -1,10 +1,10 @@ import Foundation public struct AdminPurgeCommunityView: Codable { - public let admin: PersonSafe? + public let admin: Person? public let admin_purge_community: AdminPurgeCommunity - public init(admin: PersonSafe? = nil, admin_purge_community: AdminPurgeCommunity) { + public init(admin: Person? = nil, admin_purge_community: AdminPurgeCommunity) { self.admin = admin self.admin_purge_community = admin_purge_community } diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/AdminPurgePersonView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/AdminPurgePersonView.swift index f35f51c..2454ad0 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/AdminPurgePersonView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/AdminPurgePersonView.swift @@ -1,10 +1,10 @@ import Foundation public struct AdminPurgePersonView: Codable { - public let admin: PersonSafe? + public let admin: Person? public let admin_purge_person: AdminPurgePerson - public init(admin: PersonSafe? = nil, admin_purge_person: AdminPurgePerson) { + public init(admin: Person? = nil, admin_purge_person: AdminPurgePerson) { self.admin = admin self.admin_purge_person = admin_purge_person } diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/AdminPurgePostView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/AdminPurgePostView.swift index 1c179ca..bfba34e 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/AdminPurgePostView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/AdminPurgePostView.swift @@ -1,11 +1,11 @@ import Foundation public struct AdminPurgePostView: Codable { - public let admin: PersonSafe? + public let admin: Person? public let admin_purge_post: AdminPurgePost public let community: CommunitySafe - public init(admin: PersonSafe? = nil, admin_purge_post: AdminPurgePost, community: CommunitySafe) { + public init(admin: Person? = nil, admin_purge_post: AdminPurgePost, community: CommunitySafe) { self.admin = admin self.admin_purge_post = admin_purge_post self.community = community diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommentReplyView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommentReplyView.swift index c7162c1..4fe0d4a 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommentReplyView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommentReplyView.swift @@ -5,12 +5,12 @@ public struct CommentReplyView: Codable { public let comment_reply: CommentReply public let community: CommunitySafe public let counts: CommentAggregates - public let creator: PersonSafe + public let creator: Person public let creator_banned_from_community: Bool public let creator_blocked: Bool public let my_vote: Int? public let post: Post - public let recipient: PersonSafe + public let recipient: Person public let saved: Bool public let subscribed: SubscribedType @@ -19,12 +19,12 @@ public struct CommentReplyView: Codable { comment_reply: CommentReply, community: CommunitySafe, counts: CommentAggregates, - creator: PersonSafe, + creator: Person, creator_banned_from_community: Bool, creator_blocked: Bool, my_vote: Int? = nil, post: Post, - recipient: PersonSafe, + recipient: Person, saved: Bool, subscribed: SubscribedType ) { diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommentReportView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommentReportView.swift index f9e4e3b..be00032 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommentReportView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommentReportView.swift @@ -2,27 +2,27 @@ import Foundation public struct CommentReportView: Codable { public let comment: Comment - public let comment_creator: PersonSafe + public let comment_creator: Person public let comment_report: CommentReport public let community: CommunitySafe public let counts: CommentAggregates - public let creator: PersonSafe + public let creator: Person public let creator_banned_from_community: Bool public let my_vote: Int? public let post: Post - public let resolver: PersonSafe? + public let resolver: Person? public init( comment: Comment, - comment_creator: PersonSafe, + comment_creator: Person, comment_report: CommentReport, community: CommunitySafe, counts: CommentAggregates, - creator: PersonSafe, + creator: Person, creator_banned_from_community: Bool, my_vote: Int? = nil, post: Post, - resolver: PersonSafe? = nil + resolver: Person? = nil ) { self.comment = comment self.comment_creator = comment_creator diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommentView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommentView.swift index e64ac6c..2ec5c05 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommentView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommentView.swift @@ -4,7 +4,7 @@ public struct CommentView: Codable { public let comment: Comment public let community: CommunitySafe public let counts: CommentAggregates - public let creator: PersonSafe + public let creator: Person public let creator_banned_from_community: Bool public let creator_blocked: Bool public let my_vote: Int? @@ -16,7 +16,7 @@ public struct CommentView: Codable { comment: Comment, community: CommunitySafe, counts: CommentAggregates, - creator: PersonSafe, + creator: Person, creator_banned_from_community: Bool, creator_blocked: Bool, my_vote: Int? = nil, diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommunityBlockView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommunityBlockView.swift index 50d5752..edefc70 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommunityBlockView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommunityBlockView.swift @@ -2,9 +2,9 @@ import Foundation public struct CommunityBlockView: Codable { public let community: CommunitySafe - public let person: PersonSafe + public let person: Person - public init(community: CommunitySafe, person: PersonSafe) { + public init(community: CommunitySafe, person: Person) { self.community = community self.person = person } diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommunityFolowerView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommunityFolowerView.swift index d1aaf50..d00af69 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommunityFolowerView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommunityFolowerView.swift @@ -2,9 +2,9 @@ import Foundation public struct CommunityFolowerView: Codable { public let community: CommunitySafe - public let follower: PersonSafe + public let follower: Person - public init(community: CommunitySafe, follower: PersonSafe) { + public init(community: CommunitySafe, follower: Person) { self.community = community self.follower = follower } diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommunityModeratorView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommunityModeratorView.swift index 6195b44..540810e 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommunityModeratorView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/CommunityModeratorView.swift @@ -2,9 +2,9 @@ import Foundation public struct CommunityModeratorView: Codable { public let community: CommunitySafe - public let moderator: PersonSafe + public let moderator: Person - public init(community: CommunitySafe, moderator: PersonSafe) { + public init(community: CommunitySafe, moderator: Person) { self.community = community self.moderator = moderator } diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/LocalUserSettings.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/LocalUser.swift similarity index 89% rename from Sources/Lemmy-Swift-Client/Lemmy API/Structs/LocalUserSettings.swift rename to Sources/Lemmy-Swift-Client/Lemmy API/Structs/LocalUser.swift index 7edc367..476e8a5 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/LocalUserSettings.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/LocalUser.swift @@ -1,9 +1,9 @@ import Foundation -public struct LocalUserSettings: Codable { +public struct LocalUser: Codable { public let accepted_application: Bool - public let default_listing_type: Int - public let default_sort_type: Int + public let default_listing_type: ListingType + public let default_sort_type: SortType public let email: String? public let email_verified: Bool public let id: Int @@ -21,8 +21,8 @@ public struct LocalUserSettings: Codable { public init( accepted_application: Bool, - default_listing_type: Int, - default_sort_type: Int, + default_listing_type: ListingType, + default_sort_type: SortType, email: String? = nil, email_verified: Bool, id: Int, diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/LocalUserSettingsView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/LocalUserSettingsView.swift deleted file mode 100644 index 3ed8001..0000000 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/LocalUserSettingsView.swift +++ /dev/null @@ -1,13 +0,0 @@ -import Foundation - -public struct LocalUserSettingsView: Codable { - public let counts: PersonAggregates - public let local_user: LocalUserSettings - public let person: PersonSafe - - public init(counts: PersonAggregates, local_user: LocalUserSettings, person: PersonSafe) { - self.counts = counts - self.local_user = local_user - self.person = person - } -} diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/LocalUserView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/LocalUserView.swift new file mode 100644 index 0000000..00c076f --- /dev/null +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/LocalUserView.swift @@ -0,0 +1,13 @@ +import Foundation + +public struct LocalUserView: Codable { + public let counts: PersonAggregates + public let local_user: LocalUser + public let person: Person + + public init(counts: PersonAggregates, local_user: LocalUser, person: Person) { + self.counts = counts + self.local_user = local_user + self.person = person + } +} diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModAddCommunityView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModAddCommunityView.swift index 224bb23..f39528e 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModAddCommunityView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModAddCommunityView.swift @@ -3,14 +3,14 @@ import Foundation public struct ModAddCommunityView: Codable { public let community: CommunitySafe public let mod_add_community: ModAddCommunity - public let modded_person: PersonSafe - public let moderator: PersonSafe + public let modded_person: Person + public let moderator: Person public init( community: CommunitySafe, mod_add_community: ModAddCommunity, - modded_person: PersonSafe, - moderator: PersonSafe + modded_person: Person, + moderator: Person ) { self.community = community self.mod_add_community = mod_add_community diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModAddView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModAddView.swift index 85d21a2..04ccc6d 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModAddView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModAddView.swift @@ -2,10 +2,10 @@ import Foundation public struct ModAddView: Codable { public let mod_add: ModAdd - public let modded_person: PersonSafe - public let moderator: PersonSafe? + public let modded_person: Person + public let moderator: Person? - public init(mod_add: ModAdd, modded_person: PersonSafe, moderator: PersonSafe? = nil) { + public init(mod_add: ModAdd, modded_person: Person, moderator: Person? = nil) { self.mod_add = mod_add self.modded_person = modded_person self.moderator = moderator diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModBanFromCommunityView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModBanFromCommunityView.swift index 9f0fbf8..99797e9 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModBanFromCommunityView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModBanFromCommunityView.swift @@ -1,16 +1,16 @@ import Foundation public struct ModBanFromCommunityView: Codable { - public let banned_person: PersonSafe + public let banned_person: Person public let community: CommunitySafe public let mod_ban_from_community: ModBanFromCommunity - public let moderator: PersonSafe? + public let moderator: Person? public init( - banned_person: PersonSafe, + banned_person: Person, community: CommunitySafe, mod_ban_from_community: ModBanFromCommunity, - moderator: PersonSafe? = nil + moderator: Person? = nil ) { self.banned_person = banned_person self.community = community diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModBanView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModBanView.swift index ba1a5ab..dde11ea 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModBanView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModBanView.swift @@ -1,11 +1,11 @@ import Foundation public struct ModBanView: Codable { - public let banned_person: PersonSafe + public let banned_person: Person public let mod_ban: ModBan - public let moderator: PersonSafe? + public let moderator: Person? - public init(banned_person: PersonSafe, mod_ban: ModBan, moderator: PersonSafe? = nil) { + public init(banned_person: Person, mod_ban: ModBan, moderator: Person? = nil) { self.banned_person = banned_person self.mod_ban = mod_ban self.moderator = moderator diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModFeaturePostView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModFeaturePostView.swift index d61968a..7ed3ff2 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModFeaturePostView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModFeaturePostView.swift @@ -3,13 +3,13 @@ import Foundation public struct ModFeaturePostView: Codable { public let community: CommunitySafe public let mod_feature_post: ModFeaturePost - public let moderator: PersonSafe? + public let moderator: Person? public let post: Post public init( community: CommunitySafe, mod_feature_post: ModFeaturePost, - moderator: PersonSafe? = nil, + moderator: Person? = nil, post: Post ) { self.community = community diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModLockPostView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModLockPostView.swift index 7499c03..f55d1e2 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModLockPostView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModLockPostView.swift @@ -3,13 +3,13 @@ import Foundation public struct ModLockPostView: Codable { public let community: CommunitySafe public let mod_lock_post: ModLockPost - public let moderator: PersonSafe? + public let moderator: Person? public let post: Post public init( community: CommunitySafe, mod_lock_post: ModLockPost, - moderator: PersonSafe? = nil, + moderator: Person? = nil, post: Post ) { self.community = community diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModRemoveCommentView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModRemoveCommentView.swift index ec1d207..d62d81c 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModRemoveCommentView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModRemoveCommentView.swift @@ -2,18 +2,18 @@ import Foundation public struct ModRemoveCommentView: Codable { public let comment: Comment - public let commenter: PersonSafe + public let commenter: Person public let community: CommunitySafe public let mod_remove_comment: ModRemoveComment - public let moderator: PersonSafe? + public let moderator: Person? public let post: Post public init( comment: Comment, - commenter: PersonSafe, + commenter: Person, community: CommunitySafe, mod_remove_comment: ModRemoveComment, - moderator: PersonSafe? = nil, + moderator: Person? = nil, post: Post ) { self.comment = comment diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModRemoveCommunityView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModRemoveCommunityView.swift index 2cd1d87..124098e 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModRemoveCommunityView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModRemoveCommunityView.swift @@ -3,12 +3,12 @@ import Foundation public struct ModRemoveCommunityView: Codable { public let community: CommunitySafe public let mod_remove_community: ModRemoveCommunity - public let moderator: PersonSafe? + public let moderator: Person? public init( community: CommunitySafe, mod_remove_community: ModRemoveCommunity, - moderator: PersonSafe? = nil + moderator: Person? = nil ) { self.community = community self.mod_remove_community = mod_remove_community diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModRemovePostView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModRemovePostView.swift index 8e35aa7..2511229 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModRemovePostView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModRemovePostView.swift @@ -3,13 +3,13 @@ import Foundation public struct ModRemovePostView: Codable { public let community: CommunitySafe public let mod_remove_post: ModRemovePost - public let moderator: PersonSafe? + public let moderator: Person? public let post: Post public init( community: CommunitySafe, mod_remove_post: ModRemovePost, - moderator: PersonSafe? = nil, + moderator: Person? = nil, post: Post ) { self.community = community diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModTransferCommunityView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModTransferCommunityView.swift index 9a87603..0d0af4c 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModTransferCommunityView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/ModTransferCommunityView.swift @@ -3,14 +3,14 @@ import Foundation public struct ModTransferCommunityView: Codable { public let community: CommunitySafe public let mod_transfer_community: ModTransferCommunity - public let modded_person: PersonSafe - public let moderator: PersonSafe? + public let modded_person: Person + public let moderator: Person? public init( community: CommunitySafe, mod_transfer_community: ModTransferCommunity, - modded_person: PersonSafe, - moderator: PersonSafe? = nil + modded_person: Person, + moderator: Person? = nil ) { self.community = community self.mod_transfer_community = mod_transfer_community diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/MyUserInfo.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/MyUserInfo.swift index 7eaf865..8c3b8ff 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/MyUserInfo.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/MyUserInfo.swift @@ -4,7 +4,7 @@ public struct MyUserInfo: Codable { public let community_blocks: [CommunityBlockView] public let discussion_languages: [Int] public let follows: [CommunityFolowerView] - public let local_user_view: LocalUserSettingsView + public let local_user_view: LocalUserView public let moderates: [CommunityModeratorView] public let person_blocks: [PersonBlockView] @@ -12,7 +12,7 @@ public struct MyUserInfo: Codable { community_blocks: [CommunityBlockView], discussion_languages: [Int], follows: [CommunityFolowerView], - local_user_view: LocalUserSettingsView, + local_user_view: LocalUserView, moderates: [CommunityModeratorView], person_blocks: [PersonBlockView] ) { diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PersonBlockView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PersonBlockView.swift index 2398181..531f0a9 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PersonBlockView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PersonBlockView.swift @@ -1,10 +1,10 @@ import Foundation public struct PersonBlockView: Codable { - public let person: PersonSafe - public let target: PersonSafe + public let person: Person + public let target: Person - public init(person: PersonSafe, target: PersonSafe) { + public init(person: Person, target: Person) { self.person = person self.target = target } diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PersonMentionView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PersonMentionView.swift index f9dae40..5a638a8 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PersonMentionView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PersonMentionView.swift @@ -4,13 +4,13 @@ public struct PersonMentionView: Codable { public let comment: Comment public let community: CommunitySafe public let counts: CommentAggregates - public let creator: PersonSafe + public let creator: Person public let creator_banned_from_community: Bool public let creator_blocked: Bool public let my_vote: Int? public let person_mention: PersonMention public let post: Post - public let recipient: PersonSafe + public let recipient: Person public let saved: Bool public let subscribed: SubscribedType @@ -18,13 +18,13 @@ public struct PersonMentionView: Codable { comment: Comment, community: CommunitySafe, counts: CommentAggregates, - creator: PersonSafe, + creator: Person, creator_banned_from_community: Bool, creator_blocked: Bool, my_vote: Int? = nil, person_mention: PersonMention, post: Post, - recipient: PersonSafe, + recipient: Person, saved: Bool, subscribed: SubscribedType ) { diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PersonSafe.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PersonSafe.swift index c977c34..beb9dad 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PersonSafe.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PersonSafe.swift @@ -1,6 +1,6 @@ import Foundation -public struct PersonSafe: Codable { +public struct Person: Codable { public let actor_id: String public let admin: Bool public let avatar: String? diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PersonViewSafe.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PersonViewSafe.swift index b0a1d8c..297d7c9 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PersonViewSafe.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PersonViewSafe.swift @@ -2,9 +2,9 @@ import Foundation public struct PersonViewSafe: Codable { public let counts: PersonAggregates - public let person: PersonSafe + public let person: Person - public init(counts: PersonAggregates, person: PersonSafe) { + public init(counts: PersonAggregates, person: Person) { self.counts = counts self.person = person } diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PostReportView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PostReportView.swift index 5a26576..aa17209 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PostReportView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PostReportView.swift @@ -3,24 +3,24 @@ import Foundation public struct PostReportView: Codable { public let community: CommunitySafe public let counts: PostAggregates - public let creator: PersonSafe + public let creator: Person public let creator_banned_from_community: Bool public let my_vote: Int? public let post: Post - public let post_creator: PersonSafe + public let post_creator: Person public let post_report: PostReport - public let resolver: PersonSafe? + public let resolver: Person? public init( community: CommunitySafe, counts: PostAggregates, - creator: PersonSafe, + creator: Person, creator_banned_from_community: Bool, my_vote: Int? = nil, post: Post, - post_creator: PersonSafe, + post_creator: Person, post_report: PostReport, - resolver: PersonSafe? = nil + resolver: Person? = nil ) { self.community = community self.counts = counts diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PostView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PostView.swift index b2ca010..9071e0a 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PostView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PostView.swift @@ -3,7 +3,7 @@ import Foundation public struct PostView: Codable { public let community: CommunitySafe public let counts: PostAggregates - public let creator: PersonSafe + public let creator: Person public let creator_banned_from_community: Bool public let creator_blocked: Bool public let my_vote: Int? @@ -16,7 +16,7 @@ public struct PostView: Codable { public init( community: CommunitySafe, counts: PostAggregates, - creator: PersonSafe, + creator: Person, creator_banned_from_community: Bool, creator_blocked: Bool, my_vote: Int? = nil, diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PrivateMessageReportView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PrivateMessageReportView.swift index 8791ff4..8022a6c 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PrivateMessageReportView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PrivateMessageReportView.swift @@ -1,18 +1,18 @@ import Foundation public struct PrivateMessageReportView: Codable { - public let creator: PersonSafe + public let creator: Person public let private_message: PrivateMessage - public let private_message_creator: PersonSafe + public let private_message_creator: Person public let private_message_report: PrivateMessageReport - public let resolver: PersonSafe? + public let resolver: Person? public init( - creator: PersonSafe, + creator: Person, private_message: PrivateMessage, - private_message_creator: PersonSafe, + private_message_creator: Person, private_message_report: PrivateMessageReport, - resolver: PersonSafe? = nil + resolver: Person? = nil ) { self.creator = creator self.private_message = private_message diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PrivateMessageView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PrivateMessageView.swift index 7c2a71e..2e19239 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PrivateMessageView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/PrivateMessageView.swift @@ -1,11 +1,11 @@ import Foundation public struct PrivateMessageView: Codable { - public let creator: PersonSafe + public let creator: Person public let private_message: PrivateMessage - public let recipient: PersonSafe + public let recipient: Person - public init(creator: PersonSafe, private_message: PrivateMessage, recipient: PersonSafe) { + public init(creator: Person, private_message: PrivateMessage, recipient: Person) { self.creator = creator self.private_message = private_message self.recipient = recipient diff --git a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/RegistrationApplicationView.swift b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/RegistrationApplicationView.swift index 03c24b9..fe8afd5 100644 --- a/Sources/Lemmy-Swift-Client/Lemmy API/Structs/RegistrationApplicationView.swift +++ b/Sources/Lemmy-Swift-Client/Lemmy API/Structs/RegistrationApplicationView.swift @@ -1,15 +1,15 @@ import Foundation public struct RegistrationApplicationView: Codable { - public let admin: PersonSafe? - public let creator: PersonSafe - public let creator_local_user: LocalUserSettings + public let admin: Person? + public let creator: Person + public let creator_local_user: LocalUser public let registration_application: RegistrationApplication public init( - admin: PersonSafe? = nil, - creator: PersonSafe, - creator_local_user: LocalUserSettings, + admin: Person? = nil, + creator: Person, + creator_local_user: LocalUser, registration_application: RegistrationApplication ) { self.admin = admin