GroupsAPI
public enum GroupsAPI
Caseless enumeration with static methods to send Groups Requests.
-
Sends a request to get groups from the API.
Declaration
Swift
public static func getGroups(with parameters: Parameters? = nil, completion: ResponseCompletion<[Group]> = nil)
Parameters
parameters
The
Parameters
to apply.completion
The closure to be executed once the request has finished.
-
Sends a request to get groups joined from the API.
Declaration
Swift
public static func getGroupsJoined(with parameters: Parameters? = nil, completion: ResponseCompletion<[Group]> = nil)
Parameters
parameters
The
Parameters
to apply.completion
The closure to be executed once the request has finished.
-
Sends a request to get group classes from the API.
Declaration
Swift
public static func getGroupsClasses(with parameters: Parameters? = nil, completion: ResponseCompletion<[GroupClass]> = nil)
Parameters
parameters
The
Parameters
to apply.completion
The closure to be executed once the request has finished.
-
Sends a request to get members in a group from the API.
Declaration
Swift
public static func getGroupMembersInGroup(id: Int, with parameters: Parameters? = nil, completion: ResponseCompletion<[Member]> = nil)
Parameters
id
The id of the group.
parameters
The
Parameters
to apply.completion
The closure to be executed once the request has finished.
-
Sends a request to join a group from the API.
Declaration
Swift
public static func joinGroup(id: Int, with parameters: Parameters? = nil, completion: ResponseCompletion<Bool> = nil)
Parameters
id
The id of the group.
completion
The closure to be executed once the request has finished.
-
Sends a request to leave a group from the API.
Declaration
Swift
public static func leaveGroup(id: Int, with parameters: Parameters? = nil, completion: ResponseCompletion<Bool> = nil)
Parameters
id
The id of the group.
completion
The closure to be executed once the request has finished.