Trendsic Platform Service

<back to all web services

FormVersionRequest

Requires Authentication
The following routes are available for this service:
GET/v1/forms/{FormUID}/versions/{VersionNo}
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 FormVersionDetail extends FormVersionRow implements IConvertible
{
    String? DefinitionJson;
    String? DefinitionHash;

    FormVersionDetail({this.DefinitionJson,this.DefinitionHash});
    FormVersionDetail.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        DefinitionJson = json['DefinitionJson'];
        DefinitionHash = json['DefinitionHash'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'DefinitionJson': DefinitionJson,
        'DefinitionHash': DefinitionHash
    });

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

class FormVersionResponse implements IConvertible
{
    FormVersionDetail? Version;
    ResponseStatus? ResponseStatus;

    FormVersionResponse({this.Version,this.ResponseStatus});
    FormVersionResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Version = JsonConverters.fromJson(json['Version'],'FormVersionDetail',context!);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Version': JsonConverters.toJson(Version,'FormVersionDetail',context!),
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

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

class FormVersionRequest implements IConvertible
{
    String? FormUID;
    int? VersionNo;

    FormVersionRequest({this.FormUID,this.VersionNo});
    FormVersionRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        FormUID = json['FormUID'];
        VersionNo = json['VersionNo'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'FormUID': FormUID,
        'VersionNo': VersionNo
    };

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'FormVersionRow': TypeInfo(TypeOf.Class, create:() => FormVersionRow()),
    'FormVersionDetail': TypeInfo(TypeOf.Class, create:() => FormVersionDetail()),
    'FormVersionResponse': TypeInfo(TypeOf.Class, create:() => FormVersionResponse()),
    'FormVersionRequest': TypeInfo(TypeOf.Class, create:() => FormVersionRequest()),
});

Dart FormVersionRequest DTOs

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

HTTP + CSV

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

GET /v1/forms/{FormUID}/versions/{VersionNo} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Version":{"DefinitionJson":"String","DefinitionHash":"String","VersionNo":0,"PublishedAt":"0001-01-01T00:00:00.0000000","PublishedBy":"String","Notes":"String","Changes":["String"],"IsLive":false,"Submissions":0},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}