public IEnumerable <Build> GetAllBuildsForApp(string appId)
        {
            var       xml      = _wrapper.GetBuildList(appId);
            BuildList response = XmlParseHelper.Parse <BuildList>(xml);

            return(response.Builds);
        }
        public IEnumerable <BuildType> GetAllBuildsForApp(string appId)
        {
            var builds = new List <BuildType>();

            var xml = _wrapper.GetBuildList(appId);

            try
            {
                if (!string.IsNullOrWhiteSpace(xml))
                {
                    if (XmlParseHelper.Parse <buildlist>(xml).build != null)
                    {
                        builds.AddRange(XmlParseHelper.Parse <buildlist>(xml).build);
                    }
                }
            } catch (XmlParseError e)
            {
                if (!e.Message.ToLower().Contains("could not find"))
                {
                    throw e;
                }
            }

            var sandboxXml = _wrapper.GetSandboxes(appId);

            if (!string.IsNullOrWhiteSpace(sandboxXml))
            {
                var sandboxes = XmlParseHelper.Parse <sandboxlist>(sandboxXml);
                if (sandboxes.sandbox != null)
                {
                    foreach (var sandbox in sandboxes.sandbox)
                    {
                        var sandboxBuildXml = _wrapper.GetBuildListForSandbox(appId, $"{sandbox.sandbox_id}");

                        try
                        {
                            if (!string.IsNullOrWhiteSpace(sandboxBuildXml))
                            {
                                builds.AddRange(XmlParseHelper.Parse <buildlist>(sandboxBuildXml).build);
                            }
                        } catch (XmlParseError e)
                        {
                            if (!e.Message.ToLower().Contains("could not find"))
                            {
                                throw e;
                            }
                        }
                    }
                }
            }

            return(builds.GroupBy(p => p.build_id)
                   .Select(g => g.First())
                   .ToList());
        }
Beispiel #3
0
        public IEnumerable <Build> GetAllBuildsForApp(string appId)
        {
            var       xml      = _wrapper.GetBuildList(appId);
            BuildList response = XmlParseHelper.Parse <BuildList>(xml);

            if (string.IsNullOrWhiteSpace(xml))
            {
                return(new Build[0]);
            }

            return(response.Builds);
        }