Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
PUT | /articles/{Id} | Updates article | Updates article for the currently logged in user |
---|
import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*
open class UpdateArticle : ICompany
{
/**
*
*/
@ApiMember(Description="", IsRequired=true, ParameterType="query")
open var Id:Int? = null
/**
*
*/
@ApiMember(Description="")
override var CompanyId:UUID? = null
/**
*
*/
@ApiMember(Description="")
open var Name:String? = null
/**
*
*/
@ApiMember(Description="")
open var ArticleTypeId:Int? = null
/**
*
*/
@ApiMember(Description="")
open var Description:String? = null
/**
*
*/
@ApiMember(Description="")
open var ImageUrl:Uri? = null
/**
*
*/
@ApiMember(Description="")
open var Active:Boolean? = null
/**
*
*/
@ApiMember(Description="")
open var Amount:Int? = null
/**
* The updated price of the article.
*/
@ApiMember(Description="The updated price of the article.")
open var Price:Double? = null
/**
* The payment currency id
*/
@ApiMember(Description="The payment currency id")
open var CurrencyId:String? = null
/**
* The price VAT in percent
*/
@ApiMember(Description="The price VAT in percent")
open var VAT:BigDecimal? = null
/**
* Query for specific services.
*/
@ApiMember(Description="Query for specific services.", ParameterType="query")
open var ServiceIds:ArrayList<Int>? = null
}
open class ArticleResponse
{
open var CompanyId:UUID? = null
open var Id:Int? = null
open var Name:String? = null
open var ArticleTypeId:Int? = null
open var Description:String? = null
open var ImageUrl:String? = null
open var Active:Boolean? = null
open var Amount:Int? = null
open var Price:Double? = null
open var CurrencyId:String? = null
open var UpdatedDate:Date? = null
open var CreatedDate:Date? = null
open var Services:ArrayList<ArticleServiceRelation>? = null
open var ServiceIds:ArrayList<Int>? = null
open var PriceSign:String? = null
open var VAT:BigDecimal? = null
}
open class ArticleServiceRelation : BaseModel()
{
@Required()
open var CompanyId:UUID? = null
open var Id:Int? = null
@Required()
open var ServiceId:Int? = null
@Required()
open var ArticleId:Int? = null
}
open class BaseModel
{
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /articles/{Id} HTTP/1.1
Host: api.bookmore.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"Id":0,"CompanyId":"00000000-0000-0000-0000-000000000000","Name":"String","ArticleTypeId":0,"Description":"String","Active":false,"Amount":0,"Price":0,"CurrencyId":"String","VAT":0,"ServiceIds":[0]}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"Id":0,"Name":"String","ArticleTypeId":0,"Description":"String","ImageUrl":"String","Active":false,"Amount":0,"Price":0,"CurrencyId":"String","Services":[{"Id":0,"ServiceId":0,"ArticleId":0}],"ServiceIds":[0],"PriceSign":"String","VAT":0}