DELETE | /api/coupons/{id} | Delete a coupon |
---|
import 'package:servicestack/servicestack.dart';
class DeleteCouponResponse implements IConvertible
{
String? message;
HttpStatusCode? status;
DeleteCouponResponse({this.message,this.status});
DeleteCouponResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
message = json['message'];
status = JsonConverters.fromJson(json['status'],'HttpStatusCode',context!);
return this;
}
Map<String, dynamic> toJson() => {
'message': message,
'status': JsonConverters.toJson(status,'HttpStatusCode',context!)
};
getTypeName() => "DeleteCouponResponse";
TypeContext? context = _ctx;
}
class DeleteCoupon implements IConvertible
{
int? id;
DeleteCoupon({this.id});
DeleteCoupon.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id
};
getTypeName() => "DeleteCoupon";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'accounts.dev.healthmonix.com', types: <String, TypeInfo> {
'DeleteCouponResponse': TypeInfo(TypeOf.Class, create:() => DeleteCouponResponse()),
'HttpStatusCode': TypeInfo(TypeOf.Class, create:() => HttpStatusCode()),
'DeleteCoupon': TypeInfo(TypeOf.Class, create:() => DeleteCoupon()),
});
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.
DELETE /api/coupons/{id} HTTP/1.1 Host: accounts.dev.healthmonix.com Accept: text/csv
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"message":"String","status":"Continue"}