| POST | /v1/forms/{FormUID}/versions/{VersionNo}/rollback |
|---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class FormStats implements IConvertible
{
int? Total;
int? NeedDecision;
int? Waiting;
int? Overdue;
FormStats({this.Total,this.NeedDecision,this.Waiting,this.Overdue});
FormStats.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Total = json['Total'];
NeedDecision = json['NeedDecision'];
Waiting = json['Waiting'];
Overdue = json['Overdue'];
return this;
}
Map<String, dynamic> toJson() => {
'Total': Total,
'NeedDecision': NeedDecision,
'Waiting': Waiting,
'Overdue': Overdue
};
getTypeName() => "FormStats";
TypeContext? context = _ctx;
}
class FormCard implements IConvertible
{
String? FormUID;
String? Name;
String? Slug;
String? Noun;
String? NumberPrefix;
String? Description;
String? Tone;
String? Status;
int? PublishedVersionNo;
DateTime? PublishedAt;
String? PublishedBy;
bool? DraftDirty;
DateTime? DraftUpdatedAt;
String? DraftUpdatedBy;
String? PackLabel;
String? SettingsJson;
FormStats? Stats;
List<String>? Offered = [];
String? CreatedBy;
DateTime? CreatedAt;
DateTime? UpdatedAt;
FormCard({this.FormUID,this.Name,this.Slug,this.Noun,this.NumberPrefix,this.Description,this.Tone,this.Status,this.PublishedVersionNo,this.PublishedAt,this.PublishedBy,this.DraftDirty,this.DraftUpdatedAt,this.DraftUpdatedBy,this.PackLabel,this.SettingsJson,this.Stats,this.Offered,this.CreatedBy,this.CreatedAt,this.UpdatedAt});
FormCard.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
FormUID = json['FormUID'];
Name = json['Name'];
Slug = json['Slug'];
Noun = json['Noun'];
NumberPrefix = json['NumberPrefix'];
Description = json['Description'];
Tone = json['Tone'];
Status = json['Status'];
PublishedVersionNo = json['PublishedVersionNo'];
PublishedAt = JsonConverters.fromJson(json['PublishedAt'],'DateTime',context!);
PublishedBy = json['PublishedBy'];
DraftDirty = json['DraftDirty'];
DraftUpdatedAt = JsonConverters.fromJson(json['DraftUpdatedAt'],'DateTime',context!);
DraftUpdatedBy = json['DraftUpdatedBy'];
PackLabel = json['PackLabel'];
SettingsJson = json['SettingsJson'];
Stats = JsonConverters.fromJson(json['Stats'],'FormStats',context!);
Offered = JsonConverters.fromJson(json['Offered'],'List<String>',context!);
CreatedBy = json['CreatedBy'];
CreatedAt = JsonConverters.fromJson(json['CreatedAt'],'DateTime',context!);
UpdatedAt = JsonConverters.fromJson(json['UpdatedAt'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'FormUID': FormUID,
'Name': Name,
'Slug': Slug,
'Noun': Noun,
'NumberPrefix': NumberPrefix,
'Description': Description,
'Tone': Tone,
'Status': Status,
'PublishedVersionNo': PublishedVersionNo,
'PublishedAt': JsonConverters.toJson(PublishedAt,'DateTime',context!),
'PublishedBy': PublishedBy,
'DraftDirty': DraftDirty,
'DraftUpdatedAt': JsonConverters.toJson(DraftUpdatedAt,'DateTime',context!),
'DraftUpdatedBy': DraftUpdatedBy,
'PackLabel': PackLabel,
'SettingsJson': SettingsJson,
'Stats': JsonConverters.toJson(Stats,'FormStats',context!),
'Offered': JsonConverters.toJson(Offered,'List<String>',context!),
'CreatedBy': CreatedBy,
'CreatedAt': JsonConverters.toJson(CreatedAt,'DateTime',context!),
'UpdatedAt': JsonConverters.toJson(UpdatedAt,'DateTime',context!)
};
getTypeName() => "FormCard";
TypeContext? context = _ctx;
}
class FormDetail extends FormCard implements IConvertible
{
String? DraftJson;
int? DraftRev;
String? SourceTemplateUID;
List<String>? Warnings = [];
List<String>? AlwaysHidden = [];
FormDetail({this.DraftJson,this.DraftRev,this.SourceTemplateUID,this.Warnings,this.AlwaysHidden});
FormDetail.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
DraftJson = json['DraftJson'];
DraftRev = json['DraftRev'];
SourceTemplateUID = json['SourceTemplateUID'];
Warnings = JsonConverters.fromJson(json['Warnings'],'List<String>',context!);
AlwaysHidden = JsonConverters.fromJson(json['AlwaysHidden'],'List<String>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'DraftJson': DraftJson,
'DraftRev': DraftRev,
'SourceTemplateUID': SourceTemplateUID,
'Warnings': JsonConverters.toJson(Warnings,'List<String>',context!),
'AlwaysHidden': JsonConverters.toJson(AlwaysHidden,'List<String>',context!)
});
getTypeName() => "FormDetail";
TypeContext? context = _ctx;
}
class FormResponse implements IConvertible
{
FormDetail? Form;
ResponseStatus? ResponseStatus;
FormResponse({this.Form,this.ResponseStatus});
FormResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Form = JsonConverters.fromJson(json['Form'],'FormDetail',context!);
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Form': JsonConverters.toJson(Form,'FormDetail',context!),
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "FormResponse";
TypeContext? context = _ctx;
}
class FormRollbackRequest implements IConvertible
{
String? FormUID;
int? VersionNo;
int? DraftRev;
FormRollbackRequest({this.FormUID,this.VersionNo,this.DraftRev});
FormRollbackRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
FormUID = json['FormUID'];
VersionNo = json['VersionNo'];
DraftRev = json['DraftRev'];
return this;
}
Map<String, dynamic> toJson() => {
'FormUID': FormUID,
'VersionNo': VersionNo,
'DraftRev': DraftRev
};
getTypeName() => "FormRollbackRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'FormStats': TypeInfo(TypeOf.Class, create:() => FormStats()),
'FormCard': TypeInfo(TypeOf.Class, create:() => FormCard()),
'FormDetail': TypeInfo(TypeOf.Class, create:() => FormDetail()),
'FormResponse': TypeInfo(TypeOf.Class, create:() => FormResponse()),
'FormRollbackRequest': TypeInfo(TypeOf.Class, create:() => FormRollbackRequest()),
});
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/forms/{FormUID}/versions/{VersionNo}/rollback HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"FormUID":"00000000000000000000000000000000","VersionNo":0,"DraftRev":0}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"Form":{"DraftJson":"String","DraftRev":0,"SourceTemplateUID":"00000000000000000000000000000000","Warnings":["String"],"AlwaysHidden":["String"],"FormUID":"00000000000000000000000000000000","Name":"String","Slug":"String","Noun":"String","NumberPrefix":"String","Description":"String","Tone":"String","Status":"String","PublishedVersionNo":0,"PublishedAt":"0001-01-01T00:00:00.0000000","PublishedBy":"String","DraftDirty":false,"DraftUpdatedAt":"0001-01-01T00:00:00.0000000","DraftUpdatedBy":"String","PackLabel":"String","SettingsJson":"String","Stats":{"Total":0,"NeedDecision":0,"Waiting":0,"Overdue":0},"Offered":["String"],"CreatedBy":"String","CreatedAt":"0001-01-01T00:00:00.0000000","UpdatedAt":"0001-01-01T00:00:00.0000000"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}