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 .xml suffix or ?format=xml

HTTP + XML

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: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<FormVersionResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <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>
  <Version>
    <Changes xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </Changes>
    <IsLive>false</IsLive>
    <Notes>String</Notes>
    <PublishedAt>0001-01-01T00:00:00</PublishedAt>
    <PublishedBy>String</PublishedBy>
    <Submissions>0</Submissions>
    <VersionNo>0</VersionNo>
    <DefinitionHash>String</DefinitionHash>
    <DefinitionJson>String</DefinitionJson>
  </Version>
</FormVersionResponse>