GalaxyMobile Client API

<back to all web services

PulsitProfileRequest

The following routes are available for this service:
GET/pulsit/profile
import Foundation
import ServiceStack

public class PulsitProfileRequest : ApiServiceRequest
{
    public var idNumber:String

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

    private enum CodingKeys : String, CodingKey {
        case idNumber
    }

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

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

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

    required public init(){}
}

public class PulsitProfileResponse : ApiServiceResponse
{
    public var products:[PulsitProfileProductItem] = []
    public var devices:[PulsitProfileDeviceItem] = []

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

    private enum CodingKeys : String, CodingKey {
        case products
        case devices
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        products = try container.decodeIfPresent([PulsitProfileProductItem].self, forKey: .products) ?? []
        devices = try container.decodeIfPresent([PulsitProfileDeviceItem].self, forKey: .devices) ?? []
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if products.count > 0 { try container.encode(products, forKey: .products) }
        if devices.count > 0 { try container.encode(devices, forKey: .devices) }
    }
}

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 PulsitProfileProductItem : Codable
{
    public var product:String
    public var make:String
    public var model:String
    public var year:String
    public var registrationNumber:String
    public var pulsitModuleId:String
    public var latestStatus:PulsitModuleStatusItem

    required public init(){}
}

public class PulsitModuleStatusItem : Codable
{
    public var pulsitModuleId:String
    public var latitude:Double
    public var longitude:Double
    public var eventDescription:String
    public var eventTime:Date
    public var status:String
    public var pulsitStartId:Int

    required public init(){}
}

public class PulsitProfileDeviceItem : Codable
{
    public var pulsitModuleId:String
    public var product:String
    public var Description:String
    public var type:DeviceType
    public var typeString:String

    required public init(){}
}

public enum DeviceType : Int, Codable
{
    case Lock = 0
    case HomeSecurity = 1
}


Swift PulsitProfileRequest DTOs

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

HTTP + OTHER

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

GET /pulsit/profile HTTP/1.1 
Host: galaxymobile.api.client.prod.86degrees.com 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Products":[{"Product":"String","Make":"String","Model":"String","Year":"String","RegistrationNumber":"String","PulsitModuleId":"String","LatestStatus":{"PulsitModuleId":"String","Latitude":0,"Longitude":0,"EventDescription":"String","EventTime":"0001-01-01T00:00:00.0000000","Status":"String","PulsitStartId":0}}],"Devices":[{"PulsitModuleId":"String","Product":"String","Description":"String","Type":0,"TypeString":"Lock"}],"Description":"String","Heading":"String","WasSuccessful":false,"ModelState":{}}