| GET | /user/meetings |
|---|
import Foundation
import ServiceStack
public class GetAllMeetings : ApiServiceRequest
{
// @ApiMember(IsRequired=true)
public var date:String
public var dashboard:Bool
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case date
case dashboard
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
date = try container.decodeIfPresent(String.self, forKey: .date)
dashboard = try container.decodeIfPresent(Bool.self, forKey: .dashboard)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if date != nil { try container.encode(date, forKey: .date) }
if dashboard != nil { try container.encode(dashboard, forKey: .dashboard) }
}
}
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 GetAllMeetingsResponse : ApiServiceResponse
{
public var startLatitude:Double
public var startLongitude:Double
public var endLatitude:Double
public var endLongitude:Double
public var meetingGroups:[MeetingGroupData] = []
public var nextMeeting:MeetingData
public var arrivalStatusEnum:ArrivalStatusEnum
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case startLatitude
case startLongitude
case endLatitude
case endLongitude
case meetingGroups
case nextMeeting
case arrivalStatusEnum
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
startLatitude = try container.decodeIfPresent(Double.self, forKey: .startLatitude)
startLongitude = try container.decodeIfPresent(Double.self, forKey: .startLongitude)
endLatitude = try container.decodeIfPresent(Double.self, forKey: .endLatitude)
endLongitude = try container.decodeIfPresent(Double.self, forKey: .endLongitude)
meetingGroups = try container.decodeIfPresent([MeetingGroupData].self, forKey: .meetingGroups) ?? []
nextMeeting = try container.decodeIfPresent(MeetingData.self, forKey: .nextMeeting)
arrivalStatusEnum = try container.decodeIfPresent(ArrivalStatusEnum.self, forKey: .arrivalStatusEnum)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if startLatitude != nil { try container.encode(startLatitude, forKey: .startLatitude) }
if startLongitude != nil { try container.encode(startLongitude, forKey: .startLongitude) }
if endLatitude != nil { try container.encode(endLatitude, forKey: .endLatitude) }
if endLongitude != nil { try container.encode(endLongitude, forKey: .endLongitude) }
if meetingGroups.count > 0 { try container.encode(meetingGroups, forKey: .meetingGroups) }
if nextMeeting != nil { try container.encode(nextMeeting, forKey: .nextMeeting) }
if arrivalStatusEnum != nil { try container.encode(arrivalStatusEnum, forKey: .arrivalStatusEnum) }
}
}
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 MeetingGroupData : Codable
{
public var time:String
public var meetings:[MeetingData] = []
required public init(){}
}
public class MeetingData : Codable
{
public var meetingId:Int
public var startTime:String
public var arrivalTime:String
public var leftTime:String
public var duration:String
public var showTimeFields:Bool
public var arrivalStatus:String
public var email:String
public var hasEmail:Bool
public var contactName:String
public var latitude:Double
public var longitude:Double
public var location:String
public var address:String
public var subject:String
public var Description:String
public var endTime:String
public var company:String
public var contactNumber:String
public var hasContactNumber:Bool
public var hasLocation:Bool
public var setBy:String
public var virtualOrInPerson:String
required public init(){}
}
public enum ArrivalStatusEnum : Int, Codable
{
case Unknown = 0
case OnTime = 1
case Late = 2
}
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
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /user/meetings HTTP/1.1 Host: cochraneplus-api-dev.happen.zone Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"startLatitude":0,"startLongitude":0,"endLatitude":0,"endLongitude":0,"meetingGroups":[{}],"nextMeeting":{"meetingId":0,"startTime":"String","arrivalTime":"String","leftTime":"String","duration":"String","showTimeFields":false,"arrivalStatus":"String","email":"String","hasEmail":true,"contactName":"String","latitude":0,"longitude":0,"location":"String","address":"String","subject":"String","description":"String","endTime":"String","company":"String","contactNumber":"String","hasContactNumber":true,"hasLocation":false,"setBy":"String","virtualOrInPerson":"String"},"arrivalStatusEnum":0,"description":"String","heading":"String","wasSuccessful":false,"modelState":{}}