using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using Newtonsoft.Json;

{{#models}}
{{#model}}
namespace {{packageName}}.Model {

  /// <summary>
  /// {{description}}
  /// </summary>
  [DataContract]
  public class {{classname}}{{#parent}} : {{{parent}}}{{/parent}} {
    {{#vars}}
    /// <summary>
    /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}}
    /// </summary>{{#description}}
    /// <value>{{{description}}}</value>{{/description}}
    [DataMember(Name="{{baseName}}", EmitDefaultValue=false)]
    [JsonProperty(PropertyName = "{{baseName}}")]
    public {{{datatype}}} {{name}} { get; set; }

    {{/vars}}

    /// <summary>
    /// Get the string presentation of the object
    /// </summary>
    /// <returns>String presentation of the object</returns>
    public override string ToString()  {
      var sb = new StringBuilder();
      sb.Append("class {{classname}} {\n");
      {{#vars}}
      sb.Append("  {{name}}: ").Append({{name}}).Append("\n");
      {{/vars}}
      sb.Append("}\n");
      return sb.ToString();
    }

    /// <summary>
    /// Get the JSON string presentation of the object
    /// </summary>
    /// <returns>JSON string presentation of the object</returns>
    public {{#parent}} new {{/parent}}string ToJson() {
      return JsonConvert.SerializeObject(this, Formatting.Indented);
    }

}
{{/model}}
{{/models}}
}
