private DeployData GetDeployData(Deploy deploy)
{
var res = DeployData.CreateBuilder()
.SetPath(deploy.Path);
if (deploy.Config != ConfigurationFactory.Empty)
res.SetConfig(Serialize(deploy.Config));
if (deploy.RouterConfig != RouterConfig.NoRouter)
res.SetRouterConfig(Serialize(deploy.RouterConfig));
if (deploy.Scope != Deploy.NoScopeGiven)
res.SetScope(Serialize(deploy.Scope));
if (deploy.Dispatcher != Deploy.NoDispatcherGiven)
res.SetDispatcher(deploy.Dispatcher);
return res.Build();
}