Unico3.Link.API

<back to all web services

VoceListino

Magazzino
The following routes are available for this service:
PUT,GET/magazzino/articoli/listini
import Foundation
import ServiceStack

public class VoceListino : Codable
{
    public var listino:FK_Listino?
    public var articolo:FK_Articolo?
    public var codiceOrdine:String?
    public var barcode:String?
    public var prezzoAcquisto:Double?
    public var prezzoVendita:Double?

    required public init(){}
}

public class FK_Listino : FK, IUniqueCodice, IUniqueDescrizione
{
    public var codice:String?
    public var descrizione:String?

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

    private enum CodingKeys : String, CodingKey {
        case codice
        case descrizione
    }

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

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

public class FK : Codable
{
    public var id:Int?

    required public init(){}
}

public class FK_Articolo : FK, IUniqueCodice
{
    public var codice:String?

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

    private enum CodingKeys : String, CodingKey {
        case codice
    }

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

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


Swift VoceListino DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

PUT /magazzino/articoli/listini HTTP/1.1 
Host: unico3.link.api 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"Listino":{"Codice":"String","Descrizione":"String","Id":0},"Articolo":{"Codice":"String","Id":0},"CodiceOrdine":"String","Barcode":"String","PrezzoAcquisto":0,"PrezzoVendita":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"Listino":{"Codice":"String","Descrizione":"String","Id":0},"Articolo":{"Codice":"String","Id":0},"CodiceOrdine":"String","Barcode":"String","PrezzoAcquisto":0,"PrezzoVendita":0}