Field Squared API Services

<back to all web services

Rollback

Returns a list of previous versions for a given object and allows rollback to that version.

The following routes are available for this service:
GET/{Workspace}/Rollback/{Class}/{ObjectId}
POST/{Workspace}/Rollback/{Class}/{ObjectId}/{VersionId}
import 'package:servicestack/servicestack.dart';

class DomainItem implements IConvertible
{
    String? Workspace;
    String? ObjectId;
    String? VersionId;
    String? LastUpdated;

    DomainItem({this.Workspace,this.ObjectId,this.VersionId,this.LastUpdated});
    DomainItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Workspace = json['Workspace'];
        ObjectId = json['ObjectId'];
        VersionId = json['VersionId'];
        LastUpdated = json['LastUpdated'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Workspace': Workspace,
        'ObjectId': ObjectId,
        'VersionId': VersionId,
        'LastUpdated': LastUpdated
    };

    getTypeName() => "DomainItem";
    TypeContext? context = _ctx;
}

/**
* Returns a list of previous versions for a given object and allows rollback to that version.
*/
class Rollback implements IConvertible
{
    String? ObjectId;
    String? VersionId;
    String? Class;
    String? Workspace;
    List<DomainItem>? Items;

    Rollback({this.ObjectId,this.VersionId,this.Class,this.Workspace,this.Items});
    Rollback.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ObjectId = json['ObjectId'];
        VersionId = json['VersionId'];
        Class = json['Class'];
        Workspace = json['Workspace'];
        Items = JsonConverters.fromJson(json['Items'],'List<DomainItem>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ObjectId': ObjectId,
        'VersionId': VersionId,
        'Class': Class,
        'Workspace': Workspace,
        'Items': JsonConverters.toJson(Items,'List<DomainItem>',context!)
    };

    getTypeName() => "Rollback";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'dev.fieldsquared.com', types: <String, TypeInfo> {
    'DomainItem': TypeInfo(TypeOf.Class, create:() => DomainItem()),
    'Rollback': TypeInfo(TypeOf.Class, create:() => Rollback()),
    'List<DomainItem>': TypeInfo(TypeOf.Class, create:() => <DomainItem>[]),
});

Dart Rollback DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /{Workspace}/Rollback/{Class}/{ObjectId}/{VersionId} HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	ObjectId: String,
	VersionId: String,
	Class: String,
	Workspace: String,
	Items: 
	[
		{
			Workspace: String,
			ObjectId: String,
			VersionId: String,
			LastUpdated: String
		}
	]
}