| GET | /v1/forms/{FormUID}/versions |
|---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class FormVersionRow implements IConvertible
{
int? VersionNo;
DateTime? PublishedAt;
String? PublishedBy;
String? Notes;
List<String>? Changes = [];
bool? IsLive;
int? Submissions;
FormVersionRow({this.VersionNo,this.PublishedAt,this.PublishedBy,this.Notes,this.Changes,this.IsLive,this.Submissions});
FormVersionRow.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
VersionNo = json['VersionNo'];
PublishedAt = JsonConverters.fromJson(json['PublishedAt'],'DateTime',context!);
PublishedBy = json['PublishedBy'];
Notes = json['Notes'];
Changes = JsonConverters.fromJson(json['Changes'],'List<String>',context!);
IsLive = json['IsLive'];
Submissions = json['Submissions'];
return this;
}
Map<String, dynamic> toJson() => {
'VersionNo': VersionNo,
'PublishedAt': JsonConverters.toJson(PublishedAt,'DateTime',context!),
'PublishedBy': PublishedBy,
'Notes': Notes,
'Changes': JsonConverters.toJson(Changes,'List<String>',context!),
'IsLive': IsLive,
'Submissions': Submissions
};
getTypeName() => "FormVersionRow";
TypeContext? context = _ctx;
}
class FormVersionsResponse implements IConvertible
{
List<FormVersionRow>? Versions = [];
List<String>? DraftChanges = [];
ResponseStatus? ResponseStatus;
FormVersionsResponse({this.Versions,this.DraftChanges,this.ResponseStatus});
FormVersionsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Versions = JsonConverters.fromJson(json['Versions'],'List<FormVersionRow>',context!);
DraftChanges = JsonConverters.fromJson(json['DraftChanges'],'List<String>',context!);
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Versions': JsonConverters.toJson(Versions,'List<FormVersionRow>',context!),
'DraftChanges': JsonConverters.toJson(DraftChanges,'List<String>',context!),
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "FormVersionsResponse";
TypeContext? context = _ctx;
}
class FormVersionsRequest implements IConvertible
{
String? FormUID;
FormVersionsRequest({this.FormUID});
FormVersionsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
FormUID = json['FormUID'];
return this;
}
Map<String, dynamic> toJson() => {
'FormUID': FormUID
};
getTypeName() => "FormVersionsRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'FormVersionRow': TypeInfo(TypeOf.Class, create:() => FormVersionRow()),
'FormVersionsResponse': TypeInfo(TypeOf.Class, create:() => FormVersionsResponse()),
'List<FormVersionRow>': TypeInfo(TypeOf.Class, create:() => <FormVersionRow>[]),
'FormVersionsRequest': TypeInfo(TypeOf.Class, create:() => FormVersionsRequest()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/forms/{FormUID}/versions HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
Versions:
[
{
VersionNo: 0,
PublishedAt: 0001-01-01,
PublishedBy: String,
Notes: String,
Changes:
[
String
],
IsLive: False,
Submissions: 0
}
],
DraftChanges:
[
String
],
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
}
}