add: webhook
This commit is contained in:
39
Models/GiteaWebhookPayload.cs
Normal file
39
Models/GiteaWebhookPayload.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
namespace Alchegos.Gitea.Webhook.Models;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
public class GiteaWebhookPayload
|
||||
{
|
||||
[JsonPropertyName("repository")]
|
||||
public Repository? Repository { get; set; }
|
||||
|
||||
[JsonPropertyName("pusher")]
|
||||
public User? Pusher { get; set; }
|
||||
|
||||
[JsonPropertyName("commits")]
|
||||
public List<CommitInfo>? Commits { get; set; }
|
||||
|
||||
[JsonPropertyName("head_commit")]
|
||||
public CommitInfo? HeadCommit { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class Repository
|
||||
{
|
||||
[JsonPropertyName("name")]
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
|
||||
public class User
|
||||
{
|
||||
[JsonPropertyName("username")]
|
||||
public string? UserName { get; set; }
|
||||
}
|
||||
|
||||
public class CommitInfo
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public string? Id { get; set; }
|
||||
|
||||
[JsonPropertyName("message")]
|
||||
public string? Message { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user