| GET,PUT,POST,DELETE,OPTIONS | /v1/SiteContent/{Category} | ||
|---|---|---|---|
| GET,PUT,POST,DELETE,OPTIONS | /v1/SiteContent | ||
| GET,PUT,DELETE,POST,OPTIONS | /v1/SiteContent/{Category}/{SortOrder} |
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class SiteContent implements IConvertible
{
int? Id;
String? ContentHeader;
String? ContentBody;
DateTime? BeginDate;
DateTime? EndDate;
int? SortOrder;
String? Category;
SiteContent({this.Id,this.ContentHeader,this.ContentBody,this.BeginDate,this.EndDate,this.SortOrder,this.Category});
SiteContent.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
ContentHeader = json['ContentHeader'];
ContentBody = json['ContentBody'];
BeginDate = JsonConverters.fromJson(json['BeginDate'],'DateTime',context!);
EndDate = JsonConverters.fromJson(json['EndDate'],'DateTime',context!);
SortOrder = json['SortOrder'];
Category = json['Category'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'ContentHeader': ContentHeader,
'ContentBody': ContentBody,
'BeginDate': JsonConverters.toJson(BeginDate,'DateTime',context!),
'EndDate': JsonConverters.toJson(EndDate,'DateTime',context!),
'SortOrder': SortOrder,
'Category': Category
};
getTypeName() => "SiteContent";
TypeContext? context = _ctx;
}
class SiteContentRequest implements IConvertible
{
String? Category;
String? SortOrder;
SiteContent? SiteContent;
SiteContentRequest({this.Category,this.SortOrder,this.SiteContent});
SiteContentRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Category = json['Category'];
SortOrder = json['SortOrder'];
SiteContent = JsonConverters.fromJson(json['SiteContent'],'SiteContent',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Category': Category,
'SortOrder': SortOrder,
'SiteContent': JsonConverters.toJson(SiteContent,'SiteContent',context!)
};
getTypeName() => "SiteContentRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'SiteContent': TypeInfo(TypeOf.Class, create:() => SiteContent()),
'SiteContentRequest': TypeInfo(TypeOf.Class, create:() => SiteContentRequest()),
});
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 /v1/SiteContent/{Category} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"Category":"String","SortOrder":"String","SiteContent":{"Id":0,"ContentHeader":"String","ContentBody":"String","BeginDate":"0001-01-01T00:00:00.0000000","EndDate":"0001-01-01T00:00:00.0000000","SortOrder":0,"Category":"String"}}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"Id":0,"ContentHeader":"String","ContentBody":"String","BeginDate":"0001-01-01T00:00:00.0000000","EndDate":"0001-01-01T00:00:00.0000000","SortOrder":0,"Category":"String"}