-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added user/votes request route (#84)
- add route to fetch votes made by current user
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 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,45 @@ | ||
using RestSharp; | ||
|
||
namespace Greg.Requests | ||
{ | ||
/// <summary> | ||
/// Request for getting all votes by the current user. | ||
/// </summary> | ||
public class GetUserVotes : PackageReferenceRequest | ||
{ | ||
private readonly Method httpMethod = Method.GET; | ||
|
||
/// <summary> | ||
/// GET request for fetching all votes by the current user. | ||
/// Authentication is required to identify user. | ||
/// </summary> | ||
public GetUserVotes() | ||
{ | ||
this.ForceAuthentication = true; | ||
|
||
httpMethod = Method.GET; | ||
} | ||
/// <summary> | ||
/// Path used to call remote package manager API endpoint. | ||
/// </summary> | ||
public override string Path | ||
{ | ||
get { return "user/votes"; } | ||
} | ||
|
||
/// <summary> | ||
/// Http method used to make remote package manager API call. | ||
/// </summary> | ||
public override Method HttpMethod | ||
{ | ||
get { return httpMethod; } | ||
} | ||
|
||
/// <summary> | ||
/// This function can be used to build request for POST/PUT request types which requires some additional headers to be added to the request. | ||
/// </summary> | ||
internal override void Build(ref RestRequest request) | ||
{ | ||
} | ||
} | ||
} |