From d24a43507e7a9b479bbee4d1795fc0dcfc6e1850 Mon Sep 17 00:00:00 2001 From: Taylor Lafrinere Date: Tue, 4 Jul 2017 10:23:57 -0400 Subject: [PATCH] Adding new properties to the Member and MemberSummary objects --- ProPublicaCongressAPI.Contracts/Member.cs | 14 ++++-- .../MemberSummary.cs | 19 ++++++- .../InternalModels/Member.cs | 10 ++-- .../InternalModels/MemberSummary.cs | 49 +++++++++++++++++-- 4 files changed, 79 insertions(+), 13 deletions(-) diff --git a/ProPublicaCongressAPI.Contracts/Member.cs b/ProPublicaCongressAPI.Contracts/Member.cs index 96708a6..9c674db 100644 --- a/ProPublicaCongressAPI.Contracts/Member.cs +++ b/ProPublicaCongressAPI.Contracts/Member.cs @@ -6,10 +6,13 @@ namespace ProPublicaCongressAPI.Contracts { public class Member { - public string MemberId { get; set; } - + public string MemberId { get; set; } + + [Obsolete("This property is no longer returned by the API and should not be used")] public int ThomasId { get; set; } + public string CrpId { get; set; } + public string FirstName { get; set; } public string MiddleName { get; set; } @@ -34,8 +37,9 @@ public class Member public string TwitterAccount { get; set; } - public string FacebookAccount { get; set; } - + public string FacebookAccount { get; set; } + + [Obsolete("This property is no longer returned by the API and should not be used")] public long? FacebookId { get; set; } public string YoutubeAccount { get; set; } @@ -51,5 +55,7 @@ public class Member public DateTime MostRecentVoteDate { get; set; } public IReadOnlyCollection Roles { get; set; } + + public int VotesmartId { get; set; } } } \ No newline at end of file diff --git a/ProPublicaCongressAPI.Contracts/MemberSummary.cs b/ProPublicaCongressAPI.Contracts/MemberSummary.cs index 8995ae3..e2102a3 100644 --- a/ProPublicaCongressAPI.Contracts/MemberSummary.cs +++ b/ProPublicaCongressAPI.Contracts/MemberSummary.cs @@ -1,32 +1,49 @@ using Newtonsoft.Json; - +using System; + namespace ProPublicaCongressAPI.Contracts { public class MemberSummary { public string Id { get; set; } public string MemberDetailUrl { get; set; } + public string ContactForm { get; set; } + public string CrpId { get; set; } + public int CspanId { get; set; } + public DateTime DateOfBirth { get; set; } public string FirstName { get; set; } public string MiddleName { get; set; } public string LastName { get; set; } public string Party { get; set; } public string TwitterAccount { get; set; } public string FacebookAccount { get; set; } + [Obsolete("This property is no longer returned by the API and should not be used")] public long? FacebookId { get; set; } + public string Fax { get; set; } + public string GeoId { get; set; } public string GoogleEntityId { get; set; } + public string GovTrackId { get; set; } + public int IcpsrId { get; set; } public string HomeUrl { get; set; } public string RssUrl { get; set; } public string HomeDomain { get; set; } public string DwNominate { get; set; } public string IdealPoint { get; set; } + public bool InOffice { get; set; } + public string LeadershipRole { get; set; } public int Seniority { get; set; } public int NextElection { get; set; } + public string OcdId { get; set; } + public string Office { get; set; } + public string Phone { get; set; } public int? TotalVotes { get; set; } public int? MissedVotes { get; set; } public int? TotalPresent { get; set; } public string State { get; set; } public int District { get; set; } + public int VotesmartId { get; set; } public double PercentageOfVotesMissed { get; set; } public double PercentageOVotesWithParty { get; set; } + public string YoutubeAccount { get; set; } } } \ No newline at end of file diff --git a/ProPublicaCongressAPI/InternalModels/Member.cs b/ProPublicaCongressAPI/InternalModels/Member.cs index 354be46..3d08bd1 100644 --- a/ProPublicaCongressAPI/InternalModels/Member.cs +++ b/ProPublicaCongressAPI/InternalModels/Member.cs @@ -9,8 +9,8 @@ internal class Member [JsonProperty("member_id")] public string MemberId { get; set; } - [JsonProperty("thomas_id")] - public int ThomasId { get; set; } + [JsonProperty("crp_id")] + public string CrpId { get; set; } [JsonProperty("first_name")] public string FirstName { get; set; } @@ -51,9 +51,6 @@ internal class Member [JsonProperty("facebook_account")] public string FacebookAccount { get; set; } - [JsonProperty("facebook_id")] - public long? FacebookId { get; set; } - [JsonProperty("youtube_account")] public string YoutubeAccount { get; set; } @@ -74,5 +71,8 @@ internal class Member [JsonProperty("roles")] public IReadOnlyCollection Roles { get; set; } + + [JsonProperty("votesmart_id")] + public int VotesmartId { get; set; } } } \ No newline at end of file diff --git a/ProPublicaCongressAPI/InternalModels/MemberSummary.cs b/ProPublicaCongressAPI/InternalModels/MemberSummary.cs index a1f2827..b78cd43 100644 --- a/ProPublicaCongressAPI/InternalModels/MemberSummary.cs +++ b/ProPublicaCongressAPI/InternalModels/MemberSummary.cs @@ -1,5 +1,6 @@ using Newtonsoft.Json; - +using System; + namespace ProPublicaCongressAPI.InternalModels { internal class MemberSummary @@ -10,6 +11,18 @@ internal class MemberSummary [JsonProperty("api_uri")] public string MemberDetailUrl { get; set; } + [JsonProperty("contact_form")] + public string ContactForm { get; set; } + + [JsonProperty("crp_id")] + public string CrpId { get; set; } + + [JsonProperty("cspan_id")] + public int CspanId { get; set; } + + [JsonProperty("date_of_birth")] + public DateTime DateOfBirth { get; set; } + [JsonProperty("first_name")] public string FirstName { get; set; } @@ -28,12 +41,21 @@ internal class MemberSummary [JsonProperty("facebook_account")] public string FacebookAccount { get; set; } - [JsonProperty("facebook_id")] - public long? FacebookId { get; set; } + [JsonProperty("fax")] + public string Fax { get; set; } + + [JsonProperty("geoid")] + public string GeoId { get; set; } [JsonProperty("google_entity_id")] public string GoogleEntityId { get; set; } + [JsonProperty("govtrack_id")] + public string GovTrackId { get; set; } + + [JsonProperty("icpsr_id")] + public int IcpsrId { get; set; } + [JsonProperty("url")] public string HomeUrl { get; set; } @@ -49,12 +71,27 @@ internal class MemberSummary [JsonProperty("ideal_point")] public string IdealPoint { get; set; } + [JsonProperty("in_office")] + public bool InOffice { get; set; } + + [JsonProperty("leadership_role")] + public string LeadershipRole { get; set; } + [JsonProperty("seniority")] public int Seniority { get; set; } [JsonProperty("next_election")] public int NextElection { get; set; } + [JsonProperty("ocd_id")] + public string OcdId { get; set; } + + [JsonProperty("office")] + public string Office { get; set; } + + [JsonProperty("phone")] + public string Phone { get; set; } + [JsonProperty("total_votes")] public int? TotalVotes { get; set; } @@ -70,10 +107,16 @@ internal class MemberSummary [JsonProperty("district")] public int District { get; set; } + [JsonProperty("votesmart_id")] + public int VotesmartId { get; set; } + [JsonProperty("missed_votes_pct")] public double PercentageOfVotesMissed { get; set; } [JsonProperty("votes_with_party_pct")] public double PercentageOVotesWithParty { get; set; } + + [JsonProperty("youtube_account")] + public string YoutubeAccount { get; set; } } } \ No newline at end of file