BokaMera.API.Host

<back to all web services

LicenseInformationTypeQuery

The following routes are available for this service:
GET/licenses/informationtypes/Get all license information typesThis service is used to get get all license information types that exists.
import Foundation
import ServiceStack

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
public class LicenseInformationTypeQuery : QueryDb2<LicenseInformationType, LicenseInformationTypeQueryResponse>
{
    public var responseStatus:ResponseStatus

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

    private enum CodingKeys : String, CodingKey {
        case responseStatus
    }

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

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

public class LicenseInformationType : BaseModel
{
    public var id:Int
    // @Required()
    public var name:String?

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

    private enum CodingKeys : String, CodingKey {
        case id
        case name
    }

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

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

public class BaseModel : Codable
{
    required public init(){}
}

public class LicenseInformationTypeQueryResponse : Codable
{
    /**
    * The license information type id
    */
    // @ApiMember(Description="The license information type id")
    public var id:Int

    /**
    * The license information type name
    */
    // @ApiMember(Description="The license information type name")
    public var name:String

    required public init(){}
}

public class AccessKeyTypeResponse : Codable
{
    public var id:Int
    public var keyType:String
    public var Description:String

    required public init(){}
}


Swift LicenseInformationTypeQuery DTOs

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

HTTP + JSV

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

GET /licenses/informationtypes/ HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Offset: 0,
	Total: 0,
	Results: 
	[
		{
			Id: 0,
			Name: String
		}
	],
	Meta: 
	{
		String: String
	},
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}