-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introducing new endpoint for getting amendments.
It appears either the contract from ProPublica either changed recently or it was just always documented incorrectly. Amendments are not returned from the specific bill endpoint like subjects and related bills are.
- Loading branch information
Showing
11 changed files
with
149 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace ProPublicaCongressAPI.Contracts | ||
{ | ||
public class Amendment | ||
{ | ||
public string Number { get; set; } | ||
|
||
public string Slug { get; set; } | ||
|
||
public string SponsorTitle { get; set; } | ||
|
||
public string Sponsor { get; set; } | ||
|
||
public string SponsorId { get; set; } | ||
|
||
public string SponsorUrl { get; set; } | ||
|
||
public string SponsorParty { get; set; } | ||
|
||
public string SponsorState { get; set; } | ||
|
||
public DateTime DateIntroduced { get; set; } | ||
|
||
public string Title { get; set; } | ||
|
||
public DateTime DateLatestMajorAction { get; set; } | ||
|
||
public string LatestMajorAction { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
|
||
namespace ProPublicaCongressAPI.Contracts | ||
{ | ||
public class AmendmentsContainer | ||
{ | ||
public int Congress { get; set; } | ||
|
||
public string BillId { get; set; } | ||
|
||
public int NumberOfResults { get; set; } | ||
|
||
public int Offset { get; set; } | ||
|
||
public IReadOnlyCollection<Amendment> Amendments { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ public enum SpecificBillDetailType | |
{ | ||
Unknown, | ||
Subjects, | ||
Amendments, | ||
Related | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace ProPublicaCongressAPI.InternalModels | ||
{ | ||
internal class Amendment | ||
{ | ||
[JsonProperty("amendment_number")] | ||
public string Number { get; set; } | ||
|
||
[JsonProperty("slug")] | ||
public string Slug { get; set; } | ||
|
||
[JsonProperty("sponsor_title")] | ||
public string SponsorTitle { get; set; } | ||
|
||
[JsonProperty("sponsor")] | ||
public string Sponsor { get; set; } | ||
|
||
[JsonProperty("sponsor_id")] | ||
public string SponsorId { get; set; } | ||
|
||
[JsonProperty("sponsor_uri")] | ||
public string SponsorUrl { get; set; } | ||
|
||
[JsonProperty("sponsor_party")] | ||
public string SponsorParty { get; set; } | ||
|
||
[JsonProperty("sponsor_state")] | ||
public string SponsorState { get; set; } | ||
|
||
[JsonProperty("introduced_date")] | ||
public string DateIntroduced { get; set; } | ||
|
||
[JsonProperty("title")] | ||
public string Title { get; set; } | ||
|
||
[JsonProperty("latest_major_action_date")] | ||
public string DateLatestMajorAction { get; set; } | ||
|
||
[JsonProperty("latest_major_action")] | ||
public string LatestMajorAction { get; set; } | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
ProPublicaCongressAPI/InternalModels/AmendmentsContainer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
|
||
namespace ProPublicaCongressAPI.InternalModels | ||
{ | ||
internal class AmendmentsContainer | ||
{ | ||
[JsonProperty("congress")] | ||
public int Congress { get; set; } | ||
|
||
[JsonProperty("bill_id")] | ||
public string BillId { get; set; } | ||
|
||
[JsonProperty("num_results")] | ||
public int NumberOfResults { get; set; } | ||
|
||
[JsonProperty("offset")] | ||
public int Offset { get; set; } | ||
|
||
[JsonProperty("amendments")] | ||
public IReadOnlyCollection<Amendment> Amendments { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
ProPublicaCongressAPI/InternalModels/SpecificBillDetailAmendment.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters