PipefyProspUpdate/Models/GraphQLResponse.cs

88 lines
2.6 KiB
C#

using System.Collections.Generic;
using System.Linq;
namespace PipefyProspUpdate.Models
{
public class GraphQLResponse
{
public Data? data { get; set; }
}
public class Data
{
public Table_Records? table_records { get; set; }
public Pipe? pipe { get; set; }
public FindCards? findCards { get; set; }
}
public class FindCards
{
public Pageinfo? pageinfo { get; set; }
public int totalCount { get; set; }
public Node[]? nodes { get; set; }
}
public class Pipe
{
public List<Users>? users { get; set; }
public string? name { get; set; }
}
public class Users
{
public string? id { get; set; }
public string? name { get; set; }
public string? email { get; set; }
}
public class Table_Records
{
public int matchCount { get; set; }
public int totalCount { get; set; }
public Pageinfo? pageInfo { get; set; }
public Node[]? nodes { get; set; }
}
public class Pageinfo
{
public bool hasNextPage { get; set; }
public string? endCursor { get; set; }
}
public class Node
{
public string? id { get; set; }
public string? title { get; set; }
public Pipe? pipe { get; set; }
public string Url { get { return @$"https://app.pipefy.com/open-cards/{id}"; } }
public bool success { get; set; }
public Record_Fields[]? record_fields { get; set; }
public Record_Fields[]? fields { get; set; }
public Current_phase? current_phase { get; set; }
public Field? field { get; set; }
public List<Models.Users>? assignees { get; set; }
public List<string?> prosp { get { return this.fields!.Where(x => x.field?.id == "respons_vel").SelectMany(x => x.array_value ?? new string[] { "" }).ToList()!; } }
public List<string?> others { get { return this.fields!.Where(x => x.field?.id == "demais_envolvidos").SelectMany(x => x.array_value ?? new string[] { "" }).ToList()!; } }
}
public class Current_phase
{
public string? id { get; set; }
public string? name { get; set; }
}
public class Record_Fields
{
public Field? field { get; set; }
public string? value { get; set; }
public string[]? array_value { get; set; }
}
public class Field
{
public string? id { get; set; }
public string? label { get; set; }
public string[]? value { get; set; }
}
public class Fields
{
public string? id { get; set; }
public string[]? value { get; set; }
}
}