import Foundation
import ServiceStack
public class GetWorkflowTaskActionDetails : Codable
{
public var connectionID:String?
public var taskID:Int?
required public init(){}
}
public class WorkflowTaskActionDetails : AdhocTransitionDetails
{
public var title:String?
public var comment:WorkflowTaskActionComment?
public var reason:WorkflowTaskReason?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case title
case comment
case reason
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
title = try container.decodeIfPresent(String.self, forKey: .title)
comment = try container.decodeIfPresent(WorkflowTaskActionComment.self, forKey: .comment)
reason = try container.decodeIfPresent(WorkflowTaskReason.self, forKey: .reason)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if title != nil { try container.encode(title, forKey: .title) }
if comment != nil { try container.encode(comment, forKey: .comment) }
if reason != nil { try container.encode(reason, forKey: .reason) }
}
}
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(){}
}
Swift GetWorkflowTaskActionDetails 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 /jsv/reply/GetWorkflowTaskActionDetails HTTP/1.1
Host: digiofficeapigateway.deltares.nl
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ConnectionID: 00000000-0000-0000-0000-000000000000,
TaskID: 0
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Title: String, Comment: { Comment: String, Required: False }, Reason: { Reason: String, Required: 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" } ] }