Reservation Station API

<back to all web services

GetVenue

Requires Authentication
The following routes are available for this service:
GET/venue/
GET/venue/{venuecode}
import Foundation
import ServiceStack

public class GetVenue : ApiServiceRequest
{
    public var venueCode:String

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case venueCode
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        venueCode = try container.decodeIfPresent(String.self, forKey: .venueCode)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if venueCode != nil { try container.encode(venueCode, forKey: .venueCode) }
    }
}

public class ApiServiceRequest : IServiceRequest, IHasApiKey, IHasDeviceInfo, Codable
{
    /**
    * The API Key required for authentication
    */
    // @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
    public var apiKey:String

    /**
    * Latitude of the user making this request
    */
    // @ApiMember(DataType="double", Description="Latitude of the user making this request")
    public var latitude:Double

    /**
    * Longitude of the user making this request
    */
    // @ApiMember(DataType="double", Description="Longitude of the user making this request")
    public var longitude:Double

    required public init(){}
}

public class GetVenueResponse : ApiServiceResponse
{
    public var venue:VenueData

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case venue
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        venue = try container.decodeIfPresent(VenueData.self, forKey: .venue)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if venue != nil { try container.encode(venue, forKey: .venue) }
    }
}

public class ApiServiceResponse : IServiceResponse, Codable
{
    public var Description:String
    public var heading:String
    public var wasSuccessful:Bool
    //modelState:Object ignored. Type could not be extended in Swift

    required public init(){}
}

public class VenueData : Codable
{
    public var venueId:Int
    public var name:String
    public var registeredDate:String
    public var venueCode:String
    public var isCoordinator:Bool
    public var facilities:[FacilityData] = []
    public var latitude:Double
    public var longitude:Double
    public var hasLocation:Bool
    public var logoUrl:String
    public var leadTime:Int
    public var venueInfo:String
    public var allowGuests:Bool
    public var contactNumber:String

    required public init(){}
}

public class FacilityData : Codable
{
    public var facilityId:Int
    public var facilityGuid:String
    public var name:String
    public var Description:String
    public var nextAvailable:String
    public var hasNextAvailable:Bool
    public var rates:[RatesItem] = []
    public var themeColor:String
    public var bookingNotes:String
    public var leadTime:Int
    public var venueId:Int
    public var allowExtraRequirements:Bool

    required public init(){}
}

public class RatesItem : Codable
{
    public var rate:Double
    public var minutes:Int

    required public init(){}
}


Swift GetVenue DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /venue/ HTTP/1.1 
Host: reservation.api.dev.86degrees.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"description":"String","heading":"String","wasSuccessful":false,"modelState":{}}