EventsAPI
public enum EventsAPI
Caseless enumeration with static methods to send Events Requests
-
Sends a request to get lists of events.
Declaration
Swift
public static func getEvents(with parameters: Parameters? = nil, completion: ResponseCompletion<[Event]> = nil)
Parameters
parameters
The
Parameters
to apply. Commonly used parameter keys are:completion
The closure to be executed once the request has finished.
-
Sends a request that gets an event with ID.
Declaration
Swift
public static func getEvent(id: Int, with parameters: Parameters? = nil, completion: ResponseCompletion<Event> = nil)
Parameters
id
The id of the event.
parameters
The
Parameters
to apply. A commonly used parameter key is:completion
The closure to be executed once the request has finished.
-
Sends a request that gets an event with name.
Declaration
Swift
public static func getEvent(name: String, with parameters: Parameters? = nil, completion: ResponseCompletion<Event> = nil)
Parameters
name
Name of the event that will be fetched.
parameters
The
Parameters
to apply.completion
The closure to be executed once the request has finished.
-
Sends a request that favorites an event.
Declaration
Swift
public static func favoriteEvent(id: Int, completion: ResponseCompletion<Bool> = nil)
Parameters
id
The id of the event.
completion
The closure to be executed once the request has finished.
-
Sends a request that unfavorites an event.
Declaration
Swift
public static func unfavoriteEvent(id: Int, completion: ResponseCompletion<Bool> = nil)
Parameters
id
The id of the event.
completion
The closure to be executed once the request has finished.
-
Sends a request that responds to an event.
Declaration
Swift
public static func respondToEvent(id: Int, latitude: Double, longitude: Double, completion: ResponseCompletion<Event.Response> = nil)
Parameters
id
The id of the event that will be responded to.
location
Current location of the user.
completion
The closure to be executed once the request has finished.
-
Sends a request that cancels an event.
Declaration
Swift
public static func cancelEvent(responseId: String, with parameters: Parameters? = nil, completion: ResponseCompletion<Event.Response> = nil)
Parameters
responseId
The
Event.Response
ID.parameters
The
Parameters
to apply.completion
The closure to be executed once the request has finished.
-
Sends a request to get lists of event responses.
Declaration
Swift
public static func getEventResponses(with parameters: Parameters? = nil, completion: ResponseCompletion<[Event.Response]> = nil)
Parameters
parameters
The
Parameters
to apply.completion
The closure to be executed once the request has finished.
-
Sends a request to get an event response with ID.
Declaration
Swift
public static func getEventResponse(id: String, with parameters: Parameters? = nil, completion: ResponseCompletion<Event.Response> = nil)
Parameters
id
ID of the event response that will be fetched.
parameters
The
Parameters
to apply.completion
The closure to be executed once the request has finished.
-
Sends a request to get lists of event categories.
Declaration
Swift
public static func getCategories(with parameters: Parameters? = nil, completion: ResponseCompletion<[Event.Category]> = nil)
Parameters
parameters
The
Parameters
to apply.completion
The closure to be executed once the request has finished.
-
Sends a request to get lists of event dates for page.
Declaration
Swift
public static func getEventDates(with parameters: Parameters? = nil, completion: ResponseCompletion<[Event.Date]> = nil)
Parameters
parameters
The
Parameters
to apply. Commonly used parameter keys are:completion
The closure to be executed once the request has finished.