import Foundation
import ServiceStack
public class GetDashboardInfo : ApiServiceRequest
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
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 GetDashboardInfoResponse : ApiServiceResponse
{
public var bookings:[DashBookingInfo] = []
public var venues:[VenueData] = []
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case bookings
case venues
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
bookings = try container.decodeIfPresent([DashBookingInfo].self, forKey: .bookings) ?? []
venues = try container.decodeIfPresent([VenueData].self, forKey: .venues) ?? []
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if bookings.count > 0 { try container.encode(bookings, forKey: .bookings) }
if venues.count > 0 { try container.encode(venues, forKey: .venues) }
}
}
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 DashBookingInfo : Codable
{
public var bookingId:Int
public var start:String
public var end:String
public var facilityName:String
public var venueName:String
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(){}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /jsonl/reply/GetDashboardInfo HTTP/1.1
Host: reservation.api.dev.86degrees.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"apiKey":"String","latitude":0,"longitude":0}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{Unable to show example output for type 'GetDashboardInfoResponse' using the custom 'other' filter}Cannot dynamically create an instance of type 'WebService.ServiceModel.GetDashboardInfoResponse'. Reason: No parameterless constructor defined.