Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
breakoutModewide
languagec#
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;

namespace com.doforms.rest.client
{
    public class TokenRequest
    {
        public string username { get; set; }
        public string password { get; set; }
        public string account { get; set; }
        public string code { get; set;}
        public string webservice { get; set; }
    }
    public class TokenResult
    {
        public string token { get; set; }
        public string code { get; set; }
        public string[] accounts { get; set; }
        public string message { get; set; }
    }
    public class Error
    {
        public string code { get; set; }
        public string request { get; set; }
        public string exception { get; set; }
        public string message { get; set; }
    }
    public class Project
    {
        public string key { get; set; }
        public string name { get; set; }
    }
    public class Team
    {
        public string key { get; set; }
        public string name { get; set; }     
    }
    public class Device
    {
        public string key { get; set; }
        public string name { get; set; }        
        public string carrier { get; set; }
        public DateTimeOffset createTime { get; set; }
        public DateTimeOffset formTime { get; set; }
        public string model { get; set; }        
        public string number { get; set; }
        public string os { get; set; }
        public string teamKey { get; set; }
        public DateTimeOffset updateTime { get; set; }
        public string version { get; set; }
    }
    public class Form
    {
        public string key { get; set; }
        public string id { get; set; }
        public string name { get; set; }
        public string displayName { get; set; }
        public DateTimeOffset createTime { get; set; }
        public string createUser { get; set; }
        public DateTimeOffset updateTime { get; set; }
        public string updateUser { get; set; }
        public double version { get; set; }
        public List<Field> fields { get; set; }
    }
    public class Submission
    {
        public string key { get; set; }
        public string id { get; set; }
        public string name { get; set; }
        public string formKey { get; set; }
        public string formName { get; set; }
        public double formVersion { get; set; }
        public string projectKey { get; set; }
        public int offset { get; set; }
        public string timezone { get; set; }        
        public DateTimeOffset receiveTime { get; set; }
        public List<Field> fields { get; set; }
    }
    public class Field
    {
        public string name { get; set; }
        [JsonProperty("data")]
        [JsonConverter(typeof(StringEnumConverter))]
        public DataType data { get; set; }
        [JsonProperty("type")]
        [JsonConverter(typeof(StringEnumConverter))]
        public ControlType type { get; set; }
        //Begin data fields
        public Blob blob { get; set; }
        public string comment { get; set; }
        public DateTimeOffset? date { get; set; } //Ignore the time value which will always be 00:00:00Z
        public DateTimeOffset? datetime { get; set; }
        public Email email { get; set; }
        public Fax fax { get; set; }
        public long? integer { get; set; }
        public Location location { get; set; }
        public double? number { get; set; }
        public List<string> strings { get; set; }
        public string text { get; set; }        
        public DateTimeOffset? time { get; set; } //Ignore date value which will always be Jan 1, 1970
        public string value { get; set; }
        //End data fields
        public Options options { get; set; }
        public List<Choice> choices { get; set; }
        public List<Field> fields { get; set; }
        public List<Row> rows { get; set; }
    }
    public class Blob
    {
        public string key { get; set; }
        public string id { get; set; }
        public string type { get; set; }
    }
    public class Email
    {
        public List<string> addresses { get; set; }
        public string message { get; set; }
    }
    public class Fax
    {
        public List<string> addresses { get; set; }
        public string message { get; set; }
    }
    public class Location
    {
        public double? latitude { get; set; }
        public double? longitude { get; set; }
        public double? altitude { get; set; }
        public double? accuracy { get; set; }
    }
    public class Options
    {
        public bool comment { get; set; }
        public string format { get; set; }
        public Label label { get; set; }
        public int level { get; set; }        
        public string prefix { get; set; }
        public long? rows { get; set; }
    }
    public class Choice
    {
        public string text { get; set; }
        public Label label { get; set; }
    }
    public class Label
    {
        public string en { get; set; }
    }
    public class Row
    {
        public long index { get; set; }
        public List<Field> fields { get; set; }
    }
    public enum ControlType
    {
        action,
        approval,
        audio,
        autonumber,
        barcode,
        bluetooth_le,
        button,
        button_grid,
        calculation,
        choose_one,
        choose_multiple,
        counter,
        date_time,
        email,
        fax,
        forward,
        grid,
        image,
        instruction,
        label,
        location,
        lookup,
        nfc,
        numeric,
        page,
        payment,
        pod,
        questionnaire,
        repeat,
        retrieve,
        schedule,
        score,
        score_summary,
        signature,
        sketch,
        table,
        text,
        trends,
        video
    }

    public enum DataType
    {
        blob,
        date,
        datetime,
        email,
        fax,
        fields,
        integer,
        location,
        number,
        rows,
        strings,
        text,
        time
    }
}

...