BokaMera.API.Host

<back to all web services

NewsletterFieldTranslationsQuery

Requires Authentication
The following routes are available for this service:
GET/newsletter/fieldtranslationsGet field translations that could be used in messagesGet field translations that could be used in messages.
import Foundation
import ServiceStack

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ValidateRequest(Validator="IsAuthenticated")
public class NewsletterFieldTranslationsQuery : QueryDb2<FieldTranslation, NewsletterFieldTranslationResponse>
{
    /**
    * The field translation id.
    */
    // @ApiMember(Description="The field translation id.")
    public var id:Int?

    /**
    * The field translation group
    */
    // @ApiMember(Description="The field translation group")
    public var group:String

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

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

    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)
        group = try container.decodeIfPresent(String.self, forKey: .group)
    }

    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 group != nil { try container.encode(group, forKey: .group) }
    }
}

public class FieldTranslation : BaseModel
{
    // @Required()
    public var code:String?

    // @Required()
    public var name:String?

    // @Required()
    public var Description:String?

    // @Required()
    public var group:String?

    public var modifiedDate:Date?
    public var id:Int

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

    private enum CodingKeys : String, CodingKey {
        case code
        case name
        case Description
        case group
        case modifiedDate
        case id
    }

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

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

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

public class NewsletterFieldTranslationResponse : Codable
{
    /**
    * The field translation id
    */
    // @ApiMember(Description="The field translation id")
    public var id:Int

    /**
    * The field translation code.
    */
    // @ApiMember(Description="The field translation code.")
    public var code:String

    /**
    * The field translation name.
    */
    // @ApiMember(Description="The field translation name.")
    public var name:String

    /**
    * The field translation description.
    */
    // @ApiMember(Description="The field translation description.")
    public var Description:String

    /**
    * The field translation group.
    */
    // @ApiMember(Description="The field translation group.")
    public var group:String

    required public init(){}
}

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

    required public init(){}
}


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

GET /newsletter/fieldtranslations HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

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