GET | /voss/products | gets voss products |
---|
import Foundation
import ServiceStack
// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
public class GetVossProducts : ICompany, Codable
{
/**
* The company id, if empty will use the company id for the user you are logged in with.
*/
// @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
public var companyId:String?
required public init(){}
}
// @DataContract(Name="SearchProductsResult")
public class SearchProductsResult : Codable
{
// @DataMember(Name="items", EmitDefaultValue=false)
public var items:[ProductResult] = []
// @DataMember(Name="totalCount", EmitDefaultValue=false)
public var totalCount:Int
// @DataMember(Name="pageIndex", EmitDefaultValue=false)
public var pageIndex:Int
// @DataMember(Name="pageSize", EmitDefaultValue=false)
public var pageSize:Int
// @DataMember(Name="totalPages", EmitDefaultValue=false)
public var totalPages:Int
required public init(){}
}
// @DataContract(Name="ProductResult")
public class ProductResult : Codable
{
// @DataMember(Name="type", IsRequired=true)
public var type:TypeEnum
// @DataMember(Name="status", IsRequired=true)
public var status:StatusEnum
// @DataMember(Name="id", IsRequired=true)
public var id:String
// @DataMember(Name="name", IsRequired=true)
public var name:String
// @DataMember(Name="externalId")
public var externalId:String
// @DataMember(Name="articleNumber", IsRequired=true)
public var articleNumber:String
// @DataMember(Name="productFamily", IsRequired=true)
public var productFamily:ProductResultProductFamilyDto
required public init(){}
}
public enum TypeEnum : Int, Codable
{
case Main = 1
case Addon = 2
case License = 3
case Usage = 4
}
public enum StatusEnum : Int, Codable
{
case Published = 1
case Disabled = 2
}
// @DataContract(Name="ProductResultProductFamilyDto")
public class ProductResultProductFamilyDto : Codable
{
// @DataMember(Name="id", IsRequired=true)
public var id:String
// @DataMember(Name="externalId")
public var externalId:String
required public init(){}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /voss/products HTTP/1.1 Host: testapi.bokamera.se Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <SearchProductsResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/VossIntegration.ApiTools.Model"> <items> <ProductResult i:nil="true" /> </items> </SearchProductsResult>