using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;

namespace minimalist_oauth_rp.Models
{
    //[DataContract]
    //public class SignatureRequest
    //{
    //    [DataMember]
    //    public string process_type { get; set; }
    //    [DataMember]
    //    public Signer signer { get; set; }
    //    [DataMember]
    //    public List<string> ui_locales { get; set; }
    //    [DataMember]
    //    public string finish_callback_url { get; set; }
    //    [DataMember]
    //    public List<List<string>> labels { get; set; }
    //}

    //[DataContract]
    //public class Signer
    //{
    //    [DataMember]
    //    public string signature_policy_id { get; set; }
    //    [DataMember]
    //    public Parameters parameters { get; set; }
    //}

    //[DataContract]
    //public class Parameters
    //{
    //    [DataMember]
    //    public string type { get; set; }
    //    [DataMember]
    //    public string default_digest_algorithm { get; set; }
    //    [DataMember]
    //    public string location { get; set; }
    //    [DataMember]
    //    public SignatureField signature_field { get; set; }
    //}

    //[DataContract]
    //public class SignatureField
    //{
    //    [DataMember]
    //    public string name { get; set; }
    //    [DataMember]
    //    public Location location { get; set; }
    //    [DataMember]
    //    public Appearance appearance { get; set; }
    //}

    //[DataContract]
    //public class Location
    //{
    //    [DataMember]
    //    public Page page { get; set; }
    //    [DataMember]
    //    public Rectangle rectangle { get; set; }
    //}

    //[DataContract]
    //public class Appearance
    //{
    //    [DataMember]
    //    public SignatureDetails signature_details { get; set; }
    //}

    //[DataContract]
    //public class Page
    //{
    //    [DataMember]
    //    public string number { get; set; }
    //}

    //[DataContract]
    //public class Rectangle
    //{
    //    [DataMember]
    //    public int x { get; set; }
    //    [DataMember]
    //    public int y { get; set; }
    //    [DataMember]
    //    public int height { get; set; }
    //    [DataMember]
    //    public int width { get; set; }
    //}

    //[DataContract]
    //public class SignatureDetails
    //{
    //    [DataMember]
    //    public List<Detail> details { get; set; }
    //}

    //[DataContract]
    //public class Detail
    //{
    //    [DataMember]
    //    public string type { get; set; }
    //    [DataMember]
    //    public string title { get; set; }

    //    public Detail(string type, string title)
    //    {
    //        this.type = type;
    //        this.title = title;
    //    }
    //}

    [DataContract]
    public class SignatureRequest
    {
        [DataMember(EmitDefaultValue = false)]
        public string process_type { get; set; }
        [DataMember(EmitDefaultValue = false)]
        public Signer signer { get; set; }
        [DataMember(EmitDefaultValue = false)]
        public List<string> ui_locales { get; set; }
        [DataMember(EmitDefaultValue = false)]
        public Timestamp timestamp { get; set; }
        [DataMember(EmitDefaultValue = false)]
        public string finish_callback_url { get; set; }
    }

    [DataContract]
    public class Signer
    {
        [DataMember(EmitDefaultValue = false)]
        public string signature_policy_id { get; set; }
        [DataMember(EmitDefaultValue = false)]
        public Parameters parameters { get; set; }
    }

    [DataContract]
    public class Parameters
    {
        [DataMember(EmitDefaultValue = false)]
        public string type { get; set; }
        [DataMember(EmitDefaultValue = false)]
        public string default_digest_algorithm { get; set; }
        [DataMember(EmitDefaultValue = false)]
        public string location { get; set; }
        [DataMember(EmitDefaultValue = false)]
        public SignatureField signature_field { get; set; }
    }

    [DataContract]
    public class SignatureField
    {
        [DataMember(EmitDefaultValue = false)]
        public string name { get; set; }
        [DataMember(EmitDefaultValue = false)]
        public Location location { get; set; }
        [DataMember(EmitDefaultValue = false)]
        public Appearance appearance { get; set; }
    }

    [DataContract]
    public class Location
    {
        [DataMember(EmitDefaultValue = false)]
        public Page page { get; set; }
        [DataMember(EmitDefaultValue = false)]
        public Rectangle rectangle { get; set; }
    }

    [DataContract]
    public class Page
    {
        [DataMember(EmitDefaultValue = false)]
        public string number { get; set; }
    }

    [DataContract]
    public class Rectangle
    {
        [DataMember(EmitDefaultValue = false)]
        public int x { get; set; }
        [DataMember(EmitDefaultValue = false)]
        public int y { get; set; }
        [DataMember(EmitDefaultValue = false)]
        public int height { get; set; }
        [DataMember(EmitDefaultValue = false)]
        public int width { get; set; }
    }

    [DataContract]
    public class Appearance
    {
        [DataMember(EmitDefaultValue = false)]
        public BackgroundImage background_image { get; set; }
        [DataMember(EmitDefaultValue = false)]
        public SignatureDetails signature_details { get; set; }
    }

    [DataContract]
    public class BackgroundImage
    {
        [DataMember(EmitDefaultValue = false)]
        public string binary { get; set; }
    }

    [DataContract]
    public class SignatureDetails
    {
        [DataMember(EmitDefaultValue = false)]
        public List<Detail> details { get; set; }
    }

    [DataContract]
    public class Detail
    {
        [DataMember(EmitDefaultValue = false)]
        public string type { get; set; }
        [DataMember(EmitDefaultValue = false)]
        public string value { get; set; }
        [DataMember(EmitDefaultValue = false)]
        public string title { get; set; }
        [DataMember(EmitDefaultValue = false)]
        public string timezone { get; set; }

        //public Detail(string type, string value, string title, string timezone)
        //{
        //    this.type = type;
        //    this.value = value;
        //    this.title = title;
        //    this.timezone = timezone;
        //}
    }

    [DataContract]
    public class Timestamp
    {
        [DataMember(EmitDefaultValue = false)]
        public string provider_id { get; set; }
    }
}