Skip to content

Commit

Permalink
added user/votes request route (#84)
Browse files Browse the repository at this point in the history
- add route to fetch votes made by current user
  • Loading branch information
dnenov authored Aug 23, 2023
1 parent bb2425b commit 3794683
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/GregClient/Requests/UserVotes.cs
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)
{
}
}
}

0 comments on commit 3794683

Please sign in to comment.