PlacesAPI
public enum PlacesAPI
Caseless enumeration with static methods to send Places Requests
-
Sends a request to get the list of places.
Declaration
Swift
public static func getPlaces(with parameters: Parameters?, completion: ResponseCompletion<[Place]> = nil)
Parameters
parameters
The
Parameters
to apply.completion
The closure to be executed once the request has finished.
-
Sends a request to get the list of places given a query string.
Declaration
Swift
public static func getPlaces(query: String, with parameters: Parameters?, completion: ResponseCompletion<[Place]> = nil)
Parameters
query
The string to search for.
parameters
The
Parameters
to apply.completion
The closure to be executed once the request has finished.
-
Sends a request to get the list of places given a place Integration ID.
Declaration
Swift
public static func getPlaces(integrationId: String, with parameters: Parameters?, completion: ResponseCompletion<[Place]> = nil)
Parameters
integrationId
The integration ID of the place.
parameters
The
Parameters
to apply.completion
The closure to be executed once the request has finished.
-
Sends a request to get the list of places nearby based on given coordinates.
Declaration
Swift
public static func getPlacesNearby(coordinates: (latitude: Double, longitude: Double), onlyWithClientEvents: Bool, with parameters: Parameters?, completion: ResponseCompletion<[Place]> = nil)
Parameters
coordinates
The coordinates to base the search on.
onlyWithClientEvents
The boolean value to check if user wants to display places with client events only.
parameters
The
Parameters
to apply.completion
The closure to be executed once the request has finished.
-
Sends a request to get the list of places nearby based on address.
Declaration
Swift
public static func getPlacesNearby(address: String, onlyWithClientEvents: Bool, with parameters: Parameters?, completion: ResponseCompletion<[Place]> = nil)
Parameters
address
The address to base the search on.
onlyWithClientEvents
The boolean value to check if user wants to display places with client events only.
parameters
The
Parameters
to apply.completion
The closure to be executed once the request has finished.
-
Sends a request to get the list of offers related to a place given client event type.
Declaration
Swift
public static func getOffers(placeId: Int, clientEventType: Place.ClientEventType, with parameters: Parameters?, completion: ResponseCompletion<[Offer]> = nil)
Parameters
placeId
The id of the place.
clientEventType
The
ClientEventType
to apply.parameters
The
Parameters
to apply.completion
The closure to be executed once the request has finished.
-
Sends a request to get the place detail given a place ID.
Declaration
Swift
public static func getPlace(id: Int, with parameters: Parameters?, completion: ResponseCompletion<Place> = nil)
Parameters
id
The id of the place.
parameters
The
Parameters
to apply.completion
The closure to be executed once the request has finished.
-
Sends a request to get the list of place categories.
Declaration
Swift
public static func getPlaceCategories(with parameters: Parameters?, completion: ResponseCompletion<[Place.Category]> = nil)
Parameters
parameters
The
Parameters
to apply.completion
The closure to be executed once the request has finished.
-
Sends a request to get the radius, centerpoint, and list of places
Declaration
Swift
public static func getPlacesNearby(with parameters: Parameters?, completion: ResponseCompletion<NearbyPlaces> = nil)
Parameters
parameters
The
Parameters
to apply.completion
The closure to be executed once the request has finished.