import Foundation
import ServiceStack
public class GetSideStepDetails : Codable
{
public var processID:Int?
public var workflowTaskID:Int?
required public init(){}
}
public class SideStepDetails : AdhocTransitionDetails
{
public var coordinator:User?
public var comment:WorkflowTaskActionComment?
public var urgent:Bool?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case coordinator
case comment
case urgent
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
coordinator = try container.decodeIfPresent(User.self, forKey: .coordinator)
comment = try container.decodeIfPresent(WorkflowTaskActionComment.self, forKey: .comment)
urgent = try container.decodeIfPresent(Bool.self, forKey: .urgent)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if coordinator != nil { try container.encode(coordinator, forKey: .coordinator) }
if comment != nil { try container.encode(comment, forKey: .comment) }
if urgent != nil { try container.encode(urgent, forKey: .urgent) }
}
}
public class AdhocTransitionDetails : Codable
{
public var adhocTransitions:[WorkflowTaskAdhocTransition] = []
required public init(){}
}
public class WorkflowTaskAdhocTransition : Codable
{
public var id:String?
public var title:String?
public var assignmentAllowed:Bool?
public var assignmentRequired:Bool?
public var userEnvironment:Int?
public var users:[User] = []
public var groups:[Group] = []
public var delay:WorkflowTaskDelay?
public var reason:WorkflowTaskReason?
public var usersOrGroups:[UserOrGroup] = []
public var value:String?
required public init(){}
}
public class User : UserOrGroup
{
public var image:String?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case image
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
image = try container.decodeIfPresent(String.self, forKey: .image)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if image != nil { try container.encode(image, forKey: .image) }
}
}
public class UserOrGroup : Codable
{
public var id:Int?
public var title:String?
public var isChecked:Bool?
public var image:String?
required public init(){}
}
public class Group : UserOrGroup
{
public var image:String?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case image
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
image = try container.decodeIfPresent(String.self, forKey: .image)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if image != nil { try container.encode(image, forKey: .image) }
}
}
public class WorkflowTaskDelay : Codable
{
public var delayDate:Date?
public var reason:String?
required public init(){}
}
public class WorkflowTaskReason : Codable
{
public var reason:String?
public var required:Bool?
required public init(){}
}
public class WorkflowTaskActionComment : Codable
{
public var comment:String?
public var required:Bool?
required public init(){}
}
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 /jsv/reply/GetSideStepDetails HTTP/1.1
Host: digiofficeapigateway.deltares.nl
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ProcessID: 0,
WorkflowTaskID: 0
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Coordinator: { Image: Icons/User, ID: 0, Title: String, IsChecked: False }, Comment: { Comment: String, Required: False }, Urgent: False, AdhocTransitions: [ { Title: String, AssignmentAllowed: False, AssignmentRequired: False, UserEnvironment: 0, Users: [ { Image: Icons/User, ID: 0, Title: String, IsChecked: False } ], Groups: [ { Image: Icons/Group, ID: 0, Title: String, IsChecked: False } ], Delay: { DelayDate: 0001-01-01, Reason: String }, Reason: { Reason: String, Required: False }, UsersOrGroups: [ { __type: "IDB.API.DTO.User, IDB.API.DTO", Image: Icons/User, ID: 0, Title: String, IsChecked: False }, { __type: "IDB.API.DTO.Group, IDB.API.DTO", Image: Icons/Group, ID: 0, Title: String, IsChecked: False } ], Value: "String String" } ] }