| POST | /{Brand}/question/{TemplateGuid}/{QuestionGuid}/{PickListGuid}/listCheck | ||
|---|---|---|---|
| All Verbs | /{Brand}/question/{TemplateGuid}/{QuestionGuid}/{PickListGuid}/{listCount} | ||
| All Verbs | /{Brand}/question/{TemplateGuid}/{QuestionGuid}/{PickListGuid}/{listCount}/{searchString} |
import Foundation
import ServiceStack
public class QuestionPickListValue : QuestionPickList
{
public var pickListSelectedValue:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case pickListSelectedValue
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
pickListSelectedValue = try container.decodeIfPresent(String.self, forKey: .pickListSelectedValue)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if pickListSelectedValue != nil { try container.encode(pickListSelectedValue, forKey: .pickListSelectedValue) }
}
}
public class QuestionPickList : QuestionRequestDto
{
public var pickListGuid:String
public var listCount:String
public var searchString:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case pickListGuid
case listCount
case searchString
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
pickListGuid = try container.decodeIfPresent(String.self, forKey: .pickListGuid)
listCount = try container.decodeIfPresent(String.self, forKey: .listCount)
searchString = try container.decodeIfPresent(String.self, forKey: .searchString)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if pickListGuid != nil { try container.encode(pickListGuid, forKey: .pickListGuid) }
if listCount != nil { try container.encode(listCount, forKey: .listCount) }
if searchString != nil { try container.encode(searchString, forKey: .searchString) }
}
}
public class QuestionRequestDto : RequestBase
{
public var templateGuid:String
public var questionGuid:String
public var parent:String
public var folderBrowser:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case templateGuid
case questionGuid
case parent
case folderBrowser
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
templateGuid = try container.decodeIfPresent(String.self, forKey: .templateGuid)
questionGuid = try container.decodeIfPresent(String.self, forKey: .questionGuid)
parent = try container.decodeIfPresent(String.self, forKey: .parent)
folderBrowser = try container.decodeIfPresent(String.self, forKey: .folderBrowser)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if templateGuid != nil { try container.encode(templateGuid, forKey: .templateGuid) }
if questionGuid != nil { try container.encode(questionGuid, forKey: .questionGuid) }
if parent != nil { try container.encode(parent, forKey: .parent) }
if folderBrowser != nil { try container.encode(folderBrowser, forKey: .folderBrowser) }
}
}
public class RequestBase : DtoBase
{
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 DtoBase : Codable
{
public var brand:Brand
required public init(){}
}
public enum Brand : String, Codable
{
case Desktop
case Hp
case Kyocera
case NeaScan
case Samsung
case FujiXerox
case Ta
case Utax
case Epson
case ScanFront400
case Sharp
case Ricoh
case FujiFilm
}
Swift QuestionPickListValue DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /{Brand}/question/{TemplateGuid}/{QuestionGuid}/{PickListGuid}/listCheck HTTP/1.1
Host: buildmax.org
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
PickListSelectedValue: String,
PickListGuid: String,
listCount: String,
searchString: String,
TemplateGuid: String,
QuestionGuid: String,
Parent: String,
FolderBrowser: String,
Brand: Desktop
}