<back to all web services

MarkAndSendForTranslation

The following routes are available for this service:
POST/RestApi/translations/translate/markandsend
import Foundation
import ServiceStack

public class MarkAndSendForTranslation : MarkForTranslation
{
    public var projectData:CreateProject

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

    private enum CodingKeys : String, CodingKey {
        case projectData
    }

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

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

public class MarkForTranslation : Codable
{
    public var ids:[String]
    public var providerName:String
    public var itemType:String
    public var sourceLanguage:String
    public var targetLanguages:[String]
    public var actualSourceLanguage:String
    public var allowPartialSuccess:Bool

    required public init(){}
}

public class CreateProject : IProjectInfo, Codable
{
    public var title:String
    public var startDate:Date?
    public var endDate:Date?
    public var Description:String
    public var connector:String
    public var poReference:String
    public var actualSourceLanguage:String

    required public init(){}
}


Swift MarkAndSendForTranslation 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.

POST /RestApi/translations/translate/markandsend HTTP/1.1 
Host: www.imglobal.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"ProjectData":{"Title":"String","StartDate":"\/Date(-62135596800000-0000)\/","EndDate":"\/Date(-62135596800000-0000)\/","Description":"String","Connector":"String","PoReference":"String","ActualSourceLanguage":"String"},"Ids":["00000000-0000-0000-0000-000000000000"],"ProviderName":"String","ItemType":"String","SourceLanguage":"String","TargetLanguages":["String"],"ActualSourceLanguage":"String","AllowPartialSuccess":false}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{Unable to show example output for type 'IList`1' using the custom 'other' filter}Cannot create an instance of an interface.