public override string ToString()
        {
            StringBuilder __sb    = new StringBuilder("MNMessagesSyncAttachment(");
            bool          __first = true;

            if (Id != null && __isset.Id)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Id: ");
                __sb.Append(Id);
            }
            if (Mimetype != null && __isset.Mimetype)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Mimetype: ");
                __sb.Append(Mimetype);
            }
            if (Filename != null && __isset.Filename)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Filename: ");
                __sb.Append(Filename);
            }
            if (__isset.Fbid)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Fbid: ");
                __sb.Append(Fbid);
            }
            if (__isset.Filesize)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Filesize: ");
                __sb.Append(Filesize);
            }
            if (Attributioninfo != null && __isset.Attributioninfo)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Attributioninfo: ");
                __sb.Append(Attributioninfo == null ? "<null>" : Attributioninfo.ToString());
            }
            if (Xmagraphql != null && __isset.Xmagraphql)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Xmagraphql: ");
                __sb.Append(Xmagraphql);
            }
            if (Imagemetadata != null && __isset.Imagemetadata)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Imagemetadata: ");
                __sb.Append(Imagemetadata == null ? "<null>" : Imagemetadata.ToString());
            }
            if (Videometadata != null && __isset.Videometadata)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Videometadata: ");
                __sb.Append(Videometadata == null ? "<null>" : Videometadata.ToString());
            }
            __sb.Append(")");
            return(__sb.ToString());
        }
 public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("MNMessagesSyncAttachment");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (Id != null && __isset.Id)
         {
             field.Name = "Id";
             field.Type = TType.String;
             field.ID   = 1;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Id);
             oprot.WriteFieldEnd();
         }
         if (Mimetype != null && __isset.Mimetype)
         {
             field.Name = "Mimetype";
             field.Type = TType.String;
             field.ID   = 2;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Mimetype);
             oprot.WriteFieldEnd();
         }
         if (Filename != null && __isset.Filename)
         {
             field.Name = "Filename";
             field.Type = TType.String;
             field.ID   = 3;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Filename);
             oprot.WriteFieldEnd();
         }
         if (__isset.Fbid)
         {
             field.Name = "Fbid";
             field.Type = TType.I64;
             field.ID   = 4;
             oprot.WriteFieldBegin(field);
             oprot.WriteI64(Fbid);
             oprot.WriteFieldEnd();
         }
         if (__isset.Filesize)
         {
             field.Name = "Filesize";
             field.Type = TType.I64;
             field.ID   = 5;
             oprot.WriteFieldBegin(field);
             oprot.WriteI64(Filesize);
             oprot.WriteFieldEnd();
         }
         if (Attributioninfo != null && __isset.Attributioninfo)
         {
             field.Name = "Attributioninfo";
             field.Type = TType.Struct;
             field.ID   = 6;
             oprot.WriteFieldBegin(field);
             Attributioninfo.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (Xmagraphql != null && __isset.Xmagraphql)
         {
             field.Name = "Xmagraphql";
             field.Type = TType.String;
             field.ID   = 7;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Xmagraphql);
             oprot.WriteFieldEnd();
         }
         if (Imagemetadata != null && __isset.Imagemetadata)
         {
             field.Name = "Imagemetadata";
             field.Type = TType.Struct;
             field.ID   = 8;
             oprot.WriteFieldBegin(field);
             Imagemetadata.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (Videometadata != null && __isset.Videometadata)
         {
             field.Name = "Videometadata";
             field.Type = TType.Struct;
             field.ID   = 9;
             oprot.WriteFieldBegin(field);
             Videometadata.Write(oprot);
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }