All Verbs | /cached/customers/{Id} |
---|
import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*
open class CachedGetCustomerDetails : IGet
{
open var id:String? = null
}
@DataContract
open class CustomerDetailsResponse
{
@DataMember
open var customer:Customer? = null
@DataMember
open var orders:ArrayList<CustomerOrder> = ArrayList<CustomerOrder>()
@DataMember
open var responseStatus:ResponseStatus? = null
}
@DataContract
open class Customer
{
@DataMember
open var id:String? = null
@DataMember
open var companyName:String? = null
@DataMember
open var contactName:String? = null
@DataMember
open var contactTitle:String? = null
@DataMember
open var address:String? = null
@DataMember
open var city:String? = null
@DataMember
open var region:String? = null
@DataMember
open var postalCode:String? = null
@DataMember
open var country:String? = null
@DataMember
open var phone:String? = null
@DataMember
open var fax:String? = null
}
@DataContract
open class CustomerOrder
{
@DataMember
open var order:Order? = null
@DataMember
open var orderDetails:ArrayList<OrderDetail> = ArrayList<OrderDetail>()
}
@DataContract
open class Order
{
@DataMember
open var id:Int? = null
@DataMember
open var customerId:String? = null
@DataMember
open var employeeId:Int? = null
@DataMember
open var orderDate:Date? = null
@DataMember
open var requiredDate:Date? = null
@DataMember
open var shippedDate:Date? = null
@DataMember
open var shipVia:Int? = null
@DataMember
open var freight:BigDecimal? = null
@DataMember
open var shipName:String? = null
@DataMember
open var shipAddress:String? = null
@DataMember
open var shipCity:String? = null
@DataMember
open var shipRegion:String? = null
@DataMember
open var shipPostalCode:String? = null
@DataMember
open var shipCountry:String? = null
}
@DataContract
open class OrderDetail
{
@DataMember
open var orderId:Int? = null
@DataMember
open var productId:Int? = null
@DataMember
open var unitPrice:BigDecimal? = null
@DataMember
open var quantity:Short? = null
@DataMember
open var discount:Double? = null
}
Kotlin CachedGetCustomerDetails DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /cached/customers/{Id} HTTP/1.1
Host: northwind.netcore.io
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"id":"String"}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"customer":{"id":"String","companyName":"String","contactName":"String","contactTitle":"String","address":"String","city":"String","region":"String","postalCode":"String","country":"String","phone":"String","fax":"String"},"orders":[{"order":{"id":0,"customerId":"String","employeeId":0,"orderDate":"\/Date(-62135596800000-0000)\/","requiredDate":"\/Date(-62135596800000-0000)\/","shippedDate":"\/Date(-62135596800000-0000)\/","shipVia":0,"freight":0,"shipName":"String","shipAddress":"String","shipCity":"String","shipRegion":"String","shipPostalCode":"String","shipCountry":"String"},"orderDetails":[{"orderId":0,"productId":0,"unitPrice":0,"quantity":0,"discount":0}]}],"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}