-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Charlie Fish <[email protected]>
- Loading branch information
1 parent
34fa165
commit 4920b24
Showing
13 changed files
with
131 additions
and
110 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
Sources/Lemmy-Swift-Client/Lemmy API/Requests/ApproveRegistrationApplication.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,32 @@ | ||
import Foundation | ||
|
||
public struct ApproveRegistrationApplicationRequest: APIRequest { | ||
public typealias Response = RegistrationApplicationResponse | ||
|
||
public static let httpMethod: HTTPMethod = .put | ||
public static let path: String = "/admin/registration_application/approve" | ||
|
||
public let id: Int? | ||
public let approve: Bool? | ||
public let deny_reason: String? | ||
|
||
public init( | ||
id: Int? = nil, | ||
approve: Bool? = nil, | ||
deny_reason: String? = nil | ||
) { | ||
self.id = id | ||
self.approve = approve | ||
self.deny_reason = deny_reason | ||
} | ||
} | ||
|
||
public struct RegistrationApplicationResponse: APIResponse { | ||
public let registration_application: RegistrationApplicationView? | ||
|
||
public init( | ||
registration_application: RegistrationApplicationView? = nil | ||
) { | ||
self.registration_application = registration_application | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
Sources/Lemmy-Swift-Client/Lemmy API/Requests/CreatePrivateMessageReport.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,29 @@ | ||
import Foundation | ||
|
||
public struct CreatePrivateMessageReportRequest: APIRequest { | ||
public typealias Response = PrivateMessageReportResponse | ||
|
||
public static let httpMethod: HTTPMethod = .post | ||
public static let path: String = "/private_message/report" | ||
|
||
public let private_message_id: PrivateMessageId? | ||
public let reason: String? | ||
|
||
public init( | ||
private_message_id: PrivateMessageId? = nil, | ||
reason: String? = nil | ||
) { | ||
self.private_message_id = private_message_id | ||
self.reason = reason | ||
} | ||
} | ||
|
||
public struct PrivateMessageReportResponse: APIResponse { | ||
public let private_message_report_view: PrivateMessageReportView? | ||
|
||
public init( | ||
private_message_report_view: PrivateMessageReportView? = nil | ||
) { | ||
self.private_message_report_view = private_message_report_view | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
Sources/Lemmy-Swift-Client/Lemmy API/Requests/ListPrivateMessageReports.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,32 @@ | ||
import Foundation | ||
|
||
public struct ListPrivateMessageReportsRequest: APIRequest { | ||
public typealias Response = ListPrivateMessageReportsResponse | ||
|
||
public static let httpMethod: HTTPMethod = .get | ||
public static let path: String = "/private_message/report/list" | ||
|
||
public let page: Int? | ||
public let limit: Int? | ||
public let unresolved_only: Bool? | ||
|
||
public init( | ||
page: Int? = nil, | ||
limit: Int? = nil, | ||
unresolved_only: Bool? = nil | ||
) { | ||
self.page = page | ||
self.limit = limit | ||
self.unresolved_only = unresolved_only | ||
} | ||
} | ||
|
||
public struct ListPrivateMessageReportsResponse: APIResponse { | ||
public let private_message_reports: [PrivateMessageReportView]? | ||
|
||
public init( | ||
private_message_reports: [PrivateMessageReportView]? = nil | ||
) { | ||
self.private_message_reports = private_message_reports | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
Sources/Lemmy-Swift-Client/Lemmy API/Requests/ListRegistrationApplications.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,32 @@ | ||
import Foundation | ||
|
||
public struct ListRegistrationApplicationsRequest: APIRequest { | ||
public typealias Response = ListRegistrationApplicationsResponse | ||
|
||
public static let httpMethod: HTTPMethod = .get | ||
public static let path: String = "/admin/registration_application/list" | ||
|
||
public let unread_only: Bool? | ||
public let page: Int? | ||
public let limit: Int? | ||
|
||
public init( | ||
unread_only: Bool? = nil, | ||
page: Int? = nil, | ||
limit: Int? = nil | ||
) { | ||
self.unread_only = unread_only | ||
self.page = page | ||
self.limit = limit | ||
} | ||
} | ||
|
||
public struct ListRegistrationApplicationsResponse: APIResponse { | ||
public let registration_applications: [RegistrationApplicationView]? | ||
|
||
public init( | ||
registration_applications: [RegistrationApplicationView]? = nil | ||
) { | ||
self.registration_applications = registration_applications | ||
} | ||
} |
7 changes: 6 additions & 1 deletion
7
...Structs/ResolvePrivateMessageReport.swift → ...equests/ResolvePrivateMessageReport.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
17 changes: 0 additions & 17 deletions
17
Sources/Lemmy-Swift-Client/Lemmy API/Structs/ApproveRegistrationApplication.swift
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
Sources/Lemmy-Swift-Client/Lemmy API/Structs/CreatePrivateMessageReport.swift
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
Sources/Lemmy-Swift-Client/Lemmy API/Structs/ListPrivateMessageReports.swift
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
Sources/Lemmy-Swift-Client/Lemmy API/Structs/ListPrivateMessageReportsResponse.swift
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
Sources/Lemmy-Swift-Client/Lemmy API/Structs/ListRegistrationApplications.swift
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
Sources/Lemmy-Swift-Client/Lemmy API/Structs/ListRegistrationApplicationsResponse.swift
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
Sources/Lemmy-Swift-Client/Lemmy API/Structs/PrivateMessageReportResponse.swift
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
Sources/Lemmy-Swift-Client/Lemmy API/Structs/RegistrationApplicationResponse.swift
This file was deleted.
Oops, something went wrong.