| GET | /venue/check | ||
|---|---|---|---|
| GET | /venue/check/{venuecode} |
import Foundation
import ServiceStack
public class CheckVenue : 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 CheckVenueResponse : ApiServiceResponse
{
public var venueId:Int
public var name:String
public var customFields:[UserCustomFieldData] = []
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case venueId
case name
case customFields
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
venueId = try container.decodeIfPresent(Int.self, forKey: .venueId)
name = try container.decodeIfPresent(String.self, forKey: .name)
customFields = try container.decodeIfPresent([UserCustomFieldData].self, forKey: .customFields) ?? []
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if venueId != nil { try container.encode(venueId, forKey: .venueId) }
if name != nil { try container.encode(name, forKey: .name) }
if customFields.count > 0 { try container.encode(customFields, forKey: .customFields) }
}
}
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 UserCustomFieldData : Codable
{
public var id:String
public var value:String
public var name:String
public var optional:Bool
required public init(){}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /venue/check HTTP/1.1 Host: reservation.api.dev.86degrees.com Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"venueId":0,"name":"String","customFields":[{"id":"00000000-0000-0000-0000-000000000000","value":"String","name":"String","optional":false}],"description":"String","heading":"String","wasSuccessful":false,"modelState":{}}