Interline, SPA and code-share

How to negotiate a good interline agreement, SPA and code-share agreement