/**
 * Autogenerated by Thrift Compiler (0.9.2)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.IO;
using Thrift;
using Thrift.Collections;
using System.Runtime.Serialization;
using Thrift.Protocol;
using Thrift.Transport;


#if !SILVERLIGHT
[Serializable]
#endif
public partial class Dependencies : TBase
{
  private long _start_ts;
  private long _end_ts;
  private List<DependencyLink> _links;

  /// <summary>
  /// milliseconds from epoch
  /// </summary>
  public long Start_ts
  {
    get
    {
      return _start_ts;
    }
    set
    {
      __isset.start_ts = true;
      this._start_ts = value;
    }
  }

  /// <summary>
  /// milliseconds from epoch
  /// </summary>
  public long End_ts
  {
    get
    {
      return _end_ts;
    }
    set
    {
      __isset.end_ts = true;
      this._end_ts = value;
    }
  }

  public List<DependencyLink> Links
  {
    get
    {
      return _links;
    }
    set
    {
      __isset.links = true;
      this._links = value;
    }
  }


  public Isset __isset;
  #if !SILVERLIGHT
  [Serializable]
  #endif
  public struct Isset {
    public bool start_ts;
    public bool end_ts;
    public bool links;
  }

  public Dependencies() {
  }

  public void Read (TProtocol iprot)
  {
    TField field;
    iprot.ReadStructBegin();
    while (true)
    {
      field = iprot.ReadFieldBegin();
      if (field.Type == TType.Stop) { 
        break;
      }
      switch (field.ID)
      {
        case 1:
          if (field.Type == TType.I64) {
            Start_ts = iprot.ReadI64();
          } else { 
            TProtocolUtil.Skip(iprot, field.Type);
          }
          break;
        case 2:
          if (field.Type == TType.I64) {
            End_ts = iprot.ReadI64();
          } else { 
            TProtocolUtil.Skip(iprot, field.Type);
          }
          break;
        case 3:
          if (field.Type == TType.List) {
            {
              Links = new List<DependencyLink>();
              TList _list0 = iprot.ReadListBegin();
              for( int _i1 = 0; _i1 < _list0.Count; ++_i1)
              {
                DependencyLink _elem2;
                _elem2 = new DependencyLink();
                _elem2.Read(iprot);
                Links.Add(_elem2);
              }
              iprot.ReadListEnd();
            }
          } else { 
            TProtocolUtil.Skip(iprot, field.Type);
          }
          break;
        default: 
          TProtocolUtil.Skip(iprot, field.Type);
          break;
      }
      iprot.ReadFieldEnd();
    }
    iprot.ReadStructEnd();
  }

  public void Write(TProtocol oprot) {
    TStruct struc = new TStruct("Dependencies");
    oprot.WriteStructBegin(struc);
    TField field = new TField();
    if (__isset.start_ts) {
      field.Name = "start_ts";
      field.Type = TType.I64;
      field.ID = 1;
      oprot.WriteFieldBegin(field);
      oprot.WriteI64(Start_ts);
      oprot.WriteFieldEnd();
    }
    if (__isset.end_ts) {
      field.Name = "end_ts";
      field.Type = TType.I64;
      field.ID = 2;
      oprot.WriteFieldBegin(field);
      oprot.WriteI64(End_ts);
      oprot.WriteFieldEnd();
    }
    if (Links != null && __isset.links) {
      field.Name = "links";
      field.Type = TType.List;
      field.ID = 3;
      oprot.WriteFieldBegin(field);
      {
        oprot.WriteListBegin(new TList(TType.Struct, Links.Count));
        foreach (DependencyLink _iter3 in Links)
        {
          _iter3.Write(oprot);
        }
        oprot.WriteListEnd();
      }
      oprot.WriteFieldEnd();
    }
    oprot.WriteFieldStop();
    oprot.WriteStructEnd();
  }

  public override string ToString() {
    StringBuilder __sb = new StringBuilder("Dependencies(");
    bool __first = true;
    if (__isset.start_ts) {
      if(!__first) { __sb.Append(", "); }
      __first = false;
      __sb.Append("Start_ts: ");
      __sb.Append(Start_ts);
    }
    if (__isset.end_ts) {
      if(!__first) { __sb.Append(", "); }
      __first = false;
      __sb.Append("End_ts: ");
      __sb.Append(End_ts);
    }
    if (Links != null && __isset.links) {
      if(!__first) { __sb.Append(", "); }
      __first = false;
      __sb.Append("Links: ");
      __sb.Append(Links);
    }
    __sb.Append(")");
    return __sb.ToString();
  }

}

