| 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 .xml suffix or ?format=xml
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: application/xml
Content-Type: application/xml
Content-Length: length
<FormRollbackRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<DraftRev>0</DraftRev>
<FormUID>00000000-0000-0000-0000-000000000000</FormUID>
<VersionNo>0</VersionNo>
</FormRollbackRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<FormResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Form>
<CreatedAt>0001-01-01T00:00:00</CreatedAt>
<CreatedBy>String</CreatedBy>
<Description>String</Description>
<DraftDirty>false</DraftDirty>
<DraftUpdatedAt>0001-01-01T00:00:00</DraftUpdatedAt>
<DraftUpdatedBy>String</DraftUpdatedBy>
<FormUID>00000000-0000-0000-0000-000000000000</FormUID>
<Name>String</Name>
<Noun>String</Noun>
<NumberPrefix>String</NumberPrefix>
<Offered xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:string>String</d3p1:string>
</Offered>
<PackLabel>String</PackLabel>
<PublishedAt>0001-01-01T00:00:00</PublishedAt>
<PublishedBy>String</PublishedBy>
<PublishedVersionNo>0</PublishedVersionNo>
<SettingsJson>String</SettingsJson>
<Slug>String</Slug>
<Stats>
<NeedDecision>0</NeedDecision>
<Overdue>0</Overdue>
<Total>0</Total>
<Waiting>0</Waiting>
</Stats>
<Status>String</Status>
<Tone>String</Tone>
<UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
<AlwaysHidden xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:string>String</d3p1:string>
</AlwaysHidden>
<DraftJson>String</DraftJson>
<DraftRev>0</DraftRev>
<SourceTemplateUID>00000000-0000-0000-0000-000000000000</SourceTemplateUID>
<Warnings xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:string>String</d3p1:string>
</Warnings>
</Form>
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
</FormResponse>