<ProgramFilesX64>\Microsoft SDKs\Azure\.NET SDK\v2.9\bin\plugins\Diagnostics\Newtonsoft.Json.dll Amazon.Lambda.S3Events AWSSDK.Core AWSSDK.S3 RestSharp Amazon Amazon.Auth.AccessControlPolicy Amazon.Auth.AccessControlPolicy.ActionIdentifiers Amazon.Internal Amazon.Lambda.S3Events Amazon.MissingTypes Amazon.Runtime Amazon.Runtime.CredentialManagement Amazon.Runtime.CredentialManagement.Internal Amazon.Runtime.EventStreams Amazon.Runtime.EventStreams.Internal Amazon.Runtime.Internal Amazon.Runtime.Internal.Auth Amazon.Runtime.Internal.Settings Amazon.Runtime.Internal.Transform Amazon.Runtime.Internal.Util Amazon.Runtime.SharedInterfaces Amazon.Runtime.SharedInterfaces.Internal Amazon.S3 Amazon.S3.Encryption Amazon.S3.Encryption.Internal Amazon.S3.Internal Amazon.S3.IO Amazon.S3.Model Amazon.S3.Model.Internal.MarshallTransformations Amazon.S3.Transfer Amazon.S3.Util Amazon.Util Amazon.Util.Internal Amazon.Util.Internal.PlatformServices Newtonsoft.Json Newtonsoft.Json.Converters Newtonsoft.Json.Linq Newtonsoft.Json.Schema Newtonsoft.Json.Serialization System System.Diagnostics System.Diagnostics.Tracing System.IO.Compression ThirdParty.BouncyCastle.Asn1 ThirdParty.BouncyCastle.Asn1.Utilities ThirdParty.BouncyCastle.Math ThirdParty.BouncyCastle.OpenSsl ThirdParty.BouncyCastle.Utilities.IO.Pem ThirdParty.Ionic.Zlib ThirdParty.Json.LitJson ThirdParty.MD5 RestSharp System.Dynamic private string BaseUrl = "https://api-prod.sdt.local/StrataSphere.Web.API.Service/api/v1/"; void Main() { RestClient client = new RestClient(); var reports = GetList(client, "Reports"); var setups = reports.ToList() .Select(rpt => GetList(client, $"Reports\\{rpt.Id}\\Setup")); var attributes = setups.SelectMany(s => (s.Sections as List).Select(x => (x.Attributes as List))); //attributes.Dump(); var results = attributes .SelectMany(a => a.Select(x => new AttributeInfo { DimensionId = x.DimensionId, AttributeId = x.AttributeId, Name = x.Name, Parameters = (x.Parameters as List) .ConvertAll(p => new AttributeInfo { DimensionId = p.DimensionId, AttributeId = p.AttributeId, MeasureId = p.MeasureId, DisplayOrder = p.DisplayOrder, Name = p.Name }).OrderBy(p => p.DisplayOrder) })).GroupBy(x => x.ToString(), (grp, data) => data.First()) .OrderBy(a => a.Name); results.Dump(); } public class AttributeInfo { public string DimensionId { get; set; } public string AttributeId { get; set; } public string MeasureId { get; set; } public long DisplayOrder { get; set; } = 0; public string Name { get; set; } public IEnumerable Parameters { get; set; } public override bool Equals(object obj) { var test = obj as AttributeInfo; if (test == null) return false; return test.Name == Name && test.DimensionId == DimensionId && test.AttributeId == AttributeId; } public override int GetHashCode() { return base.GetHashCode(); } public override string ToString() { return $"{Name} {DimensionId} {AttributeId} {DisplayOrder} {(Parameters?.Aggregate("", (x, y) => $"{x} {y.ToString()}") ?? "")}"; } } dynamic GetList(RestClient client, string something) { client.BaseUrl = new Uri(BaseUrl + something); RestRequest request = new RestRequest(); request.Method = Method.GET; var converter = new ExpandoObjectConverter(); return JsonConvert.DeserializeObject(client.Execute(request).Content, converter); } IEnumerable GetList(RestClient client, string something) { return Get>(client, something); } T Get(RestClient client, string something) { client.BaseUrl = new Uri(BaseUrl + something); RestRequest request = new RestRequest(); request.Method = Method.GET; return JsonConvert.DeserializeObject(client.Execute(request).Content); } public enum eStrataSphereItemCategory { Report, Dashboard } public enum StrataSphereReportEnum { Report, DSCubeReport, SQLReport, ClientReport } public class ReportDto { public Guid Id { get; set; } public string Name { get; set; } public string Description { get; set; } public string Author { get; set; } public eStrataSphereItemCategory Category => eStrataSphereItemCategory.Report; public string Tagline => $"Report | {Module} | {DateCreated.ToString("MMM-dd-YYYY")} | {DownloadCount} downloads"; public StrataSphereReportEnum ReportType { get; set; } public string Module { get; set; } public string MinJazzVersion { get; set; } public string MaxJazzVersion { get; set; } public string ReportSetupJson { get; set; } public List DefinitionIds { get; set; } public DateTime DateCreated { get; set; } public DateTime DateLastModified { get; set; } public int DownloadCount { get; set; } public ReportDto() { ReportSetupJson = "{}"; DefinitionIds = new List(); } }