Field Squared API Services

<back to all web services

PublicDocument

The following routes are available for this service:
GET/{Workspace}/API/Document/Schema
GET, PUT, POST, DELETE/{Workspace}/API/Document/{Id}
GET, PUT, POST, DELETE/{Workspace}/API/Document
GET/{Workspace}/API/Document/Schema/{DocumentType}
import 'package:servicestack/servicestack.dart';

class ClassedItem implements IConvertible
{
    String? ObjectId;
    String? Class;
    String? VersionId;
    List<String>? Ancestors;
    String? Type;

    ClassedItem({this.ObjectId,this.Class,this.VersionId,this.Ancestors,this.Type});
    ClassedItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class Location implements IConvertible
{
    double? Latitude;
    double? Longitude;
    bool? HasValidLocation;

    Location({this.Latitude,this.Longitude,this.HasValidLocation});
    Location.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Latitude = JsonConverters.toDouble(json['Latitude']);
        Longitude = JsonConverters.toDouble(json['Longitude']);
        HasValidLocation = json['HasValidLocation'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Latitude': Latitude,
        'Longitude': Longitude,
        'HasValidLocation': HasValidLocation
    };

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

class RangeExceptionItem implements IConvertible
{
    String? Binding;
    String? Message;
    String? Type;
    String? ClassName;

    RangeExceptionItem({this.Binding,this.Message,this.Type,this.ClassName});
    RangeExceptionItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Binding = json['Binding'];
        Message = json['Message'];
        Type = json['Type'];
        ClassName = json['ClassName'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Binding': Binding,
        'Message': Message,
        'Type': Type,
        'ClassName': ClassName
    };

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

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;
}

class AddressBase implements IConvertible
{
    String? Id;
    String? AddressLine1;
    String? AddressLine2;
    String? City;
    String? State;
    String? Zip;
    Location? Location;
    String? Name;
    String? NameSingleLine;
    String? NameSingleLine5DigitZip;
    bool? HasValidLocation;
    bool? GeocodeFailed;
    String? GeocodeResultCode;
    String? Country;

    AddressBase({this.Id,this.AddressLine1,this.AddressLine2,this.City,this.State,this.Zip,this.Location,this.Name,this.NameSingleLine,this.NameSingleLine5DigitZip,this.HasValidLocation,this.GeocodeFailed,this.GeocodeResultCode,this.Country});
    AddressBase.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        AddressLine1 = json['AddressLine1'];
        AddressLine2 = json['AddressLine2'];
        City = json['City'];
        State = json['State'];
        Zip = json['Zip'];
        Location = JsonConverters.fromJson(json['Location'],'Location',context!);
        Name = json['Name'];
        NameSingleLine = json['NameSingleLine'];
        NameSingleLine5DigitZip = json['NameSingleLine5DigitZip'];
        HasValidLocation = json['HasValidLocation'];
        GeocodeFailed = json['GeocodeFailed'];
        GeocodeResultCode = json['GeocodeResultCode'];
        Country = json['Country'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'AddressLine1': AddressLine1,
        'AddressLine2': AddressLine2,
        'City': City,
        'State': State,
        'Zip': Zip,
        'Location': JsonConverters.toJson(Location,'Location',context!),
        'Name': Name,
        'NameSingleLine': NameSingleLine,
        'NameSingleLine5DigitZip': NameSingleLine5DigitZip,
        'HasValidLocation': HasValidLocation,
        'GeocodeFailed': GeocodeFailed,
        'GeocodeResultCode': GeocodeResultCode,
        'Country': Country
    };

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

class Address extends AddressBase implements IConvertible
{
    String? SiteName;
    String? ContactTitle;
    String? ContactName;
    String? ContactPhone;
    String? ContactEmail;

    Address({this.SiteName,this.ContactTitle,this.ContactName,this.ContactPhone,this.ContactEmail});
    Address.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        SiteName = json['SiteName'];
        ContactTitle = json['ContactTitle'];
        ContactName = json['ContactName'];
        ContactPhone = json['ContactPhone'];
        ContactEmail = json['ContactEmail'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'SiteName': SiteName,
        'ContactTitle': ContactTitle,
        'ContactName': ContactName,
        'ContactPhone': ContactPhone,
        'ContactEmail': ContactEmail
    });

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

class EventItem implements IConvertible
{
    String? ObjectId;
    String? Date;
    Location? Location;
    String? Barcode;
    String? Details;
    String? Type;
    bool? IsScan;
    String? User;
    String? SelectedBy;
    String? Status;
    String? StatusType;
    String? DateCreated;
    bool? Automatic;

    EventItem({this.ObjectId,this.Date,this.Location,this.Barcode,this.Details,this.Type,this.IsScan,this.User,this.SelectedBy,this.Status,this.StatusType,this.DateCreated,this.Automatic});
    EventItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ObjectId = json['ObjectId'];
        Date = json['Date'];
        Location = JsonConverters.fromJson(json['Location'],'Location',context!);
        Barcode = json['Barcode'];
        Details = json['Details'];
        Type = json['Type'];
        IsScan = json['IsScan'];
        User = json['User'];
        SelectedBy = json['SelectedBy'];
        Status = json['Status'];
        StatusType = json['StatusType'];
        DateCreated = json['DateCreated'];
        Automatic = json['Automatic'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ObjectId': ObjectId,
        'Date': Date,
        'Location': JsonConverters.toJson(Location,'Location',context!),
        'Barcode': Barcode,
        'Details': Details,
        'Type': Type,
        'IsScan': IsScan,
        'User': User,
        'SelectedBy': SelectedBy,
        'Status': Status,
        'StatusType': StatusType,
        'DateCreated': DateCreated,
        'Automatic': Automatic
    };

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

/**
* Represents a DTO for a team in a workspace. Calls without an ObjectId will retrieve an array of all team objects for the workspace.
*/
class Team implements IConvertible
{
    String? Workspace;
    String? TimeZone;
    String? ObjectId;
    String? ExternalId;
    String? VersionId;
    String? BasedOn;
    String? Name;
    bool? Enabled;
    List<DomainItem>? Members;
    DomainItem? Lead;
    DomainItem? Parent;
    Address? Address;
    Map<String,String?>? Data;
    List<String>? Teams;
    List<EventItem>? Events;
    String? CreatedBy;
    Map<String,dynamic?>? ActiveLaborTypes;

    Team({this.Workspace,this.TimeZone,this.ObjectId,this.ExternalId,this.VersionId,this.BasedOn,this.Name,this.Enabled,this.Members,this.Lead,this.Parent,this.Address,this.Data,this.Teams,this.Events,this.CreatedBy,this.ActiveLaborTypes});
    Team.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Workspace = json['Workspace'];
        TimeZone = json['TimeZone'];
        ObjectId = json['ObjectId'];
        ExternalId = json['ExternalId'];
        VersionId = json['VersionId'];
        BasedOn = json['BasedOn'];
        Name = json['Name'];
        Enabled = json['Enabled'];
        Members = JsonConverters.fromJson(json['Members'],'List<DomainItem>',context!);
        Lead = JsonConverters.fromJson(json['Lead'],'DomainItem',context!);
        Parent = JsonConverters.fromJson(json['Parent'],'DomainItem',context!);
        Address = JsonConverters.fromJson(json['Address'],'Address',context!);
        Data = JsonConverters.toStringMap(json['Data']);
        Teams = JsonConverters.fromJson(json['Teams'],'List<String>',context!);
        Events = JsonConverters.fromJson(json['Events'],'List<EventItem>',context!);
        CreatedBy = json['CreatedBy'];
        ActiveLaborTypes = JsonConverters.fromJson(json['ActiveLaborTypes'],'Map<String,dynamic?>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Workspace': Workspace,
        'TimeZone': TimeZone,
        'ObjectId': ObjectId,
        'ExternalId': ExternalId,
        'VersionId': VersionId,
        'BasedOn': BasedOn,
        'Name': Name,
        'Enabled': Enabled,
        'Members': JsonConverters.toJson(Members,'List<DomainItem>',context!),
        'Lead': JsonConverters.toJson(Lead,'DomainItem',context!),
        'Parent': JsonConverters.toJson(Parent,'DomainItem',context!),
        'Address': JsonConverters.toJson(Address,'Address',context!),
        'Data': Data,
        'Teams': JsonConverters.toJson(Teams,'List<String>',context!),
        'Events': JsonConverters.toJson(Events,'List<EventItem>',context!),
        'CreatedBy': CreatedBy,
        'ActiveLaborTypes': JsonConverters.toJson(ActiveLaborTypes,'Map<String,dynamic?>',context!)
    };

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

class CustomDataField implements IConvertible
{
    String? Binding;
    String? Label;
    dynamic? Value;
    String? DataType;
    bool? IsReadOnly;
    bool? IsHidden;
    String? Values;

    CustomDataField({this.Binding,this.Label,this.Value,this.DataType,this.IsReadOnly,this.IsHidden,this.Values});
    CustomDataField.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Binding = json['Binding'];
        Label = json['Label'];
        Value = JsonConverters.fromJson(json['Value'],'dynamic',context!);
        DataType = json['DataType'];
        IsReadOnly = json['IsReadOnly'];
        IsHidden = json['IsHidden'];
        Values = json['Values'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Binding': Binding,
        'Label': Label,
        'Value': JsonConverters.toJson(Value,'dynamic',context!),
        'DataType': DataType,
        'IsReadOnly': IsReadOnly,
        'IsHidden': IsHidden,
        'Values': Values
    };

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

class DocumentOwnerDataTask implements IConvertible
{
    String? ObjectId;
    String? Name;
    String? Status;
    String? TaskType;
    DateTime? LastUpdated;
    DateTime? Created;
    int? Priority;
    double? Rank;
    Team? FirstTeam;
    Address? Address;
    List<CustomDataField>? CustomDataFields;

    DocumentOwnerDataTask({this.ObjectId,this.Name,this.Status,this.TaskType,this.LastUpdated,this.Created,this.Priority,this.Rank,this.FirstTeam,this.Address,this.CustomDataFields});
    DocumentOwnerDataTask.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ObjectId = json['ObjectId'];
        Name = json['Name'];
        Status = json['Status'];
        TaskType = json['TaskType'];
        LastUpdated = JsonConverters.fromJson(json['LastUpdated'],'DateTime',context!);
        Created = JsonConverters.fromJson(json['Created'],'DateTime',context!);
        Priority = json['Priority'];
        Rank = JsonConverters.toDouble(json['Rank']);
        FirstTeam = JsonConverters.fromJson(json['FirstTeam'],'Team',context!);
        Address = JsonConverters.fromJson(json['Address'],'Address',context!);
        CustomDataFields = JsonConverters.fromJson(json['CustomDataFields'],'List<CustomDataField>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ObjectId': ObjectId,
        'Name': Name,
        'Status': Status,
        'TaskType': TaskType,
        'LastUpdated': JsonConverters.toJson(LastUpdated,'DateTime',context!),
        'Created': JsonConverters.toJson(Created,'DateTime',context!),
        'Priority': Priority,
        'Rank': Rank,
        'FirstTeam': JsonConverters.toJson(FirstTeam,'Team',context!),
        'Address': JsonConverters.toJson(Address,'Address',context!),
        'CustomDataFields': JsonConverters.toJson(CustomDataFields,'List<CustomDataField>',context!)
    };

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

class AddressBasic extends AddressBase implements IConvertible
{
    AddressBasic();
    AddressBasic.fromJson(Map<String, dynamic> json) : super.fromJson(json);
    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson();
    getTypeName() => "AddressBasic";
    TypeContext? context = _ctx;
}

class DocumentOwnerDataAsset implements IConvertible
{
    String? ObjectId;
    String? Name;
    String? AssetType;
    DateTime? LastUpdated;
    DateTime? Created;
    AddressBasic? Address;
    List<CustomDataField>? CustomDataFields;

    DocumentOwnerDataAsset({this.ObjectId,this.Name,this.AssetType,this.LastUpdated,this.Created,this.Address,this.CustomDataFields});
    DocumentOwnerDataAsset.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ObjectId = json['ObjectId'];
        Name = json['Name'];
        AssetType = json['AssetType'];
        LastUpdated = JsonConverters.fromJson(json['LastUpdated'],'DateTime',context!);
        Created = JsonConverters.fromJson(json['Created'],'DateTime',context!);
        Address = JsonConverters.fromJson(json['Address'],'AddressBasic',context!);
        CustomDataFields = JsonConverters.fromJson(json['CustomDataFields'],'List<CustomDataField>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ObjectId': ObjectId,
        'Name': Name,
        'AssetType': AssetType,
        'LastUpdated': JsonConverters.toJson(LastUpdated,'DateTime',context!),
        'Created': JsonConverters.toJson(Created,'DateTime',context!),
        'Address': JsonConverters.toJson(Address,'AddressBasic',context!),
        'CustomDataFields': JsonConverters.toJson(CustomDataFields,'List<CustomDataField>',context!)
    };

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

class DocumentOwnerData implements IConvertible
{
    String? OwnerType;
    DocumentOwnerDataTask? TaskData;
    DocumentOwnerDataAsset? AssetData;

    DocumentOwnerData({this.OwnerType,this.TaskData,this.AssetData});
    DocumentOwnerData.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        OwnerType = json['OwnerType'];
        TaskData = JsonConverters.fromJson(json['TaskData'],'DocumentOwnerDataTask',context!);
        AssetData = JsonConverters.fromJson(json['AssetData'],'DocumentOwnerDataAsset',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'OwnerType': OwnerType,
        'TaskData': JsonConverters.toJson(TaskData,'DocumentOwnerDataTask',context!),
        'AssetData': JsonConverters.toJson(AssetData,'DocumentOwnerDataAsset',context!)
    };

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

/**
* Represents a document associated with a task or user. To return multiple documents, call /{Workspace}/Document and pass in query parameter ids = comma separated list of document ids. 
*/
class Document implements IConvertible
{
    String? Workspace;
    String? AssignedWorkspace;
    String? ObjectId;
    String? VersionId;
    String? BasedOn;
    String? Created;
    String? ExternalId;
    String? LastUpdated;
    String? Type;
    String? Name;
    String? Title;
    Map<String,dynamic?>? Data;
    ClassedItem? Owner;
    List<ClassedItem>? SecondaryOwners;
    Location? Location;
    String? Date;
    String? CreatedBy;
    double? PercentComplete;
    int? PercentTotal;
    int? PercentDone;
    List<RangeExceptionItem>? RangeExceptions;
    bool? Submitted;
    String? Schema;
    DocumentOwnerData? OwnerData;

    Document({this.Workspace,this.AssignedWorkspace,this.ObjectId,this.VersionId,this.BasedOn,this.Created,this.ExternalId,this.LastUpdated,this.Type,this.Name,this.Title,this.Data,this.Owner,this.SecondaryOwners,this.Location,this.Date,this.CreatedBy,this.PercentComplete,this.PercentTotal,this.PercentDone,this.RangeExceptions,this.Submitted,this.Schema,this.OwnerData});
    Document.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Workspace = json['Workspace'];
        AssignedWorkspace = json['AssignedWorkspace'];
        ObjectId = json['ObjectId'];
        VersionId = json['VersionId'];
        BasedOn = json['BasedOn'];
        Created = json['Created'];
        ExternalId = json['ExternalId'];
        LastUpdated = json['LastUpdated'];
        Type = json['Type'];
        Name = json['Name'];
        Title = json['Title'];
        Data = JsonConverters.fromJson(json['Data'],'Map<String,dynamic?>',context!);
        Owner = JsonConverters.fromJson(json['Owner'],'ClassedItem',context!);
        SecondaryOwners = JsonConverters.fromJson(json['SecondaryOwners'],'List<ClassedItem>',context!);
        Location = JsonConverters.fromJson(json['Location'],'Location',context!);
        Date = json['Date'];
        CreatedBy = json['CreatedBy'];
        PercentComplete = JsonConverters.toDouble(json['PercentComplete']);
        PercentTotal = json['PercentTotal'];
        PercentDone = json['PercentDone'];
        RangeExceptions = JsonConverters.fromJson(json['RangeExceptions'],'List<RangeExceptionItem>',context!);
        Submitted = json['Submitted'];
        Schema = json['Schema'];
        OwnerData = JsonConverters.fromJson(json['OwnerData'],'DocumentOwnerData',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Workspace': Workspace,
        'AssignedWorkspace': AssignedWorkspace,
        'ObjectId': ObjectId,
        'VersionId': VersionId,
        'BasedOn': BasedOn,
        'Created': Created,
        'ExternalId': ExternalId,
        'LastUpdated': LastUpdated,
        'Type': Type,
        'Name': Name,
        'Title': Title,
        'Data': JsonConverters.toJson(Data,'Map<String,dynamic?>',context!),
        'Owner': JsonConverters.toJson(Owner,'ClassedItem',context!),
        'SecondaryOwners': JsonConverters.toJson(SecondaryOwners,'List<ClassedItem>',context!),
        'Location': JsonConverters.toJson(Location,'Location',context!),
        'Date': Date,
        'CreatedBy': CreatedBy,
        'PercentComplete': PercentComplete,
        'PercentTotal': PercentTotal,
        'PercentDone': PercentDone,
        'RangeExceptions': JsonConverters.toJson(RangeExceptions,'List<RangeExceptionItem>',context!),
        'Submitted': Submitted,
        'Schema': Schema,
        'OwnerData': JsonConverters.toJson(OwnerData,'DocumentOwnerData',context!)
    };

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

// @DataContract
class PublicDocument implements IConvertible
{
    // @DataMember
    String? Id;

    // @DataMember
    String? Workspace;

    // @DataMember
    String? DocumentType;

    // @DataMember
    Document? Document;

    // @DataMember
    List<Document>? Documents;

    PublicDocument({this.Id,this.Workspace,this.DocumentType,this.Document,this.Documents});
    PublicDocument.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Workspace = json['Workspace'];
        DocumentType = json['DocumentType'];
        Document = JsonConverters.fromJson(json['Document'],'Document',context!);
        Documents = JsonConverters.fromJson(json['Documents'],'List<Document>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Workspace': Workspace,
        'DocumentType': DocumentType,
        'Document': JsonConverters.toJson(Document,'Document',context!),
        'Documents': JsonConverters.toJson(Documents,'List<Document>',context!)
    };

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

class Location implements IConvertible
{
    double? y;
    double? x;

    Location({this.y,this.x});
    Location.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        y = JsonConverters.toDouble(json['y']);
        x = JsonConverters.toDouble(json['x']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'y': y,
        'x': x
    };

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

class Address implements IConvertible
{
    String? Street;
    String? Unit;
    String? City;
    String? State;
    String? Zip;
    String? ContactTitle;
    String? ContactName;
    String? ContactPhone;
    String? ContactEmail;
    Location? Location;
    String? SiteName;
    bool? GeocodeFailed;
    String? Country;

    Address({this.Street,this.Unit,this.City,this.State,this.Zip,this.ContactTitle,this.ContactName,this.ContactPhone,this.ContactEmail,this.Location,this.SiteName,this.GeocodeFailed,this.Country});
    Address.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Street = json['Street'];
        Unit = json['Unit'];
        City = json['City'];
        State = json['State'];
        Zip = json['Zip'];
        ContactTitle = json['ContactTitle'];
        ContactName = json['ContactName'];
        ContactPhone = json['ContactPhone'];
        ContactEmail = json['ContactEmail'];
        Location = JsonConverters.fromJson(json['Location'],'Location',context!);
        SiteName = json['SiteName'];
        GeocodeFailed = json['GeocodeFailed'];
        Country = json['Country'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Street': Street,
        'Unit': Unit,
        'City': City,
        'State': State,
        'Zip': Zip,
        'ContactTitle': ContactTitle,
        'ContactName': ContactName,
        'ContactPhone': ContactPhone,
        'ContactEmail': ContactEmail,
        'Location': JsonConverters.toJson(Location,'Location',context!),
        'SiteName': SiteName,
        'GeocodeFailed': GeocodeFailed,
        'Country': Country
    };

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

TypeContext _ctx = TypeContext(library: 'dev.fieldsquared.com', types: <String, TypeInfo> {
    'ClassedItem': TypeInfo(TypeOf.Class, create:() => ClassedItem()),
    'Location': TypeInfo(TypeOf.Class, create:() => Location()),
    'RangeExceptionItem': TypeInfo(TypeOf.Class, create:() => RangeExceptionItem()),
    'DomainItem': TypeInfo(TypeOf.Class, create:() => DomainItem()),
    'AddressBase': TypeInfo(TypeOf.Class, create:() => AddressBase()),
    'Address': TypeInfo(TypeOf.Class, create:() => Address()),
    'EventItem': TypeInfo(TypeOf.Class, create:() => EventItem()),
    'Team': TypeInfo(TypeOf.Class, create:() => Team()),
    'List<DomainItem>': TypeInfo(TypeOf.Class, create:() => <DomainItem>[]),
    'List<EventItem>': TypeInfo(TypeOf.Class, create:() => <EventItem>[]),
    'Map<String,dynamic?>': TypeInfo(TypeOf.Class, create:() => Map<String,dynamic?>()),
    'CustomDataField': TypeInfo(TypeOf.Class, create:() => CustomDataField()),
    'DocumentOwnerDataTask': TypeInfo(TypeOf.Class, create:() => DocumentOwnerDataTask()),
    'List<CustomDataField>': TypeInfo(TypeOf.Class, create:() => <CustomDataField>[]),
    'AddressBasic': TypeInfo(TypeOf.Class, create:() => AddressBasic()),
    'DocumentOwnerDataAsset': TypeInfo(TypeOf.Class, create:() => DocumentOwnerDataAsset()),
    'DocumentOwnerData': TypeInfo(TypeOf.Class, create:() => DocumentOwnerData()),
    'Document': TypeInfo(TypeOf.Class, create:() => Document()),
    'List<ClassedItem>': TypeInfo(TypeOf.Class, create:() => <ClassedItem>[]),
    'List<RangeExceptionItem>': TypeInfo(TypeOf.Class, create:() => <RangeExceptionItem>[]),
    'PublicDocument': TypeInfo(TypeOf.Class, create:() => PublicDocument()),
    'List<Document>': TypeInfo(TypeOf.Class, create:() => <Document>[]),
});

Dart PublicDocument 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}/API/Document/{Id} HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Id: String,
	Workspace: String,
	DocumentType: String,
	Document: 
	{
		Name: String,
		ExternalId: String,
		Type: String,
		OwnerId: String,
		OwnerClass: String,
		Lat: 0,
		Lon: 0,
		LastUpdated: String,
		Created: String,
		Date: String,
		PercentComplete: 0,
		PercentTotal: 0,
		PercentDone: 0,
		Data: 
		{
			String: {}
		}
	},
	Documents: 
	[
		{
			Name: String,
			ExternalId: String,
			Type: String,
			OwnerId: String,
			OwnerClass: String,
			Lat: 0,
			Lon: 0,
			LastUpdated: String,
			Created: String,
			Date: String,
			PercentComplete: 0,
			PercentTotal: 0,
			PercentDone: 0,
			Data: 
			{
				String: {}
			}
		}
	]
}