c# - 表示 TFS 服务挂钩事件的 C# 对象
问题描述
我正在寻找与https://docs.microsoft.com/en-us/azure/devops/service-hooks/events?view=vsts#build中的 build.complete 事件的示例有效负载相匹配的 C# 对象.完成。参考页面推荐了一个 nuget 包,但我在其中找不到“BuildCompleteEvent”。
我正在寻找这个对象,因为我有一个输出到 Azure 存储队列的 TFS 服务挂钩,并且当我在 Azure 函数中从队列中读取该消息时,我希望能够将消息字符串解析为有用的 C# 对象。
解决方案
对于“构建完成”事件:
public class Message
{
public string text { get; set; }
public string html { get; set; }
public string markdown { get; set; }
}
public class DetailedMessage
{
public string text { get; set; }
public string html { get; set; }
public string markdown { get; set; }
}
public class Drop
{
public string location { get; set; }
public string type { get; set; }
public string url { get; set; }
public string downloadUrl { get; set; }
}
public class Log
{
public string type { get; set; }
public string url { get; set; }
public string downloadUrl { get; set; }
}
public class LastChangedBy
{
public string id { get; set; }
public string displayName { get; set; }
public string uniqueName { get; set; }
public string url { get; set; }
public string imageUrl { get; set; }
}
public class Definition
{
public int batchSize { get; set; }
public string triggerType { get; set; }
public string definitionType { get; set; }
public int id { get; set; }
public string name { get; set; }
public string url { get; set; }
}
public class Queue
{
public string queueType { get; set; }
public int id { get; set; }
public string name { get; set; }
public string url { get; set; }
}
public class RequestedFor
{
public string id { get; set; }
public string displayName { get; set; }
public string uniqueName { get; set; }
public string url { get; set; }
public string imageUrl { get; set; }
}
public class Request
{
public int id { get; set; }
public string url { get; set; }
public RequestedFor requestedFor { get; set; }
}
public class Resource
{
public string uri { get; set; }
public int id { get; set; }
public string buildNumber { get; set; }
public string url { get; set; }
public DateTime startTime { get; set; }
public DateTime finishTime { get; set; }
public string reason { get; set; }
public string status { get; set; }
public string dropLocation { get; set; }
public Drop drop { get; set; }
public Log log { get; set; }
public string sourceGetVersion { get; set; }
public LastChangedBy lastChangedBy { get; set; }
public bool retainIndefinitely { get; set; }
public bool hasDiagnostics { get; set; }
public Definition definition { get; set; }
public Queue queue { get; set; }
public List<Request> requests { get; set; }
}
public class Collection
{
public string id { get; set; }
}
public class Account
{
public string id { get; set; }
}
public class Project
{
public string id { get; set; }
}
public class ResourceContainers
{
public Collection collection { get; set; }
public Account account { get; set; }
public Project project { get; set; }
}
public class RootObject
{
public string id { get; set; }
public string eventType { get; set; }
public string publisherId { get; set; }
public string scope { get; set; }
public Message message { get; set; }
public DetailedMessage detailedMessage { get; set; }
public Resource resource { get; set; }
public string resourceVersion { get; set; }
public ResourceContainers resourceContainers { get; set; }
public DateTime createdDate { get; set; }
}
推荐阅读
- ada - Ada:1..var 范围内的自定义类型?
- python-3.x - matplotlib 中的标签字体
- django - 创建 aws cli 容器以将 django postgres 数据库备份上传到 s3
- c++ - 为什么 GCC 在我的机器上创建额外的汇编指令?
- hls.js - 无法从“SourceBuffer”读取“缓冲”属性:此 SourceBuffer 已从父媒体源中删除
- python - When I keep clicking the square not always detects it
- matrix - SSRS 矩阵报告中格式化日期/数字列的问题
- java - 如何使数组的前半部分是从 0 到 7 的随机整数,后半部分是数组前半部分的随机成员,但只能选择一次
- swift - Swift 中的 createDirectory(at:withIntermediateDirectories:attributes:) 是原子的吗
- php - 内置函数的 ReflectionFunction 返回类型为 null