/
CheckRun.cs
186 lines (186 loc) · 8.94 KB
/
CheckRun.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
// <auto-generated/>
using Microsoft.Kiota.Abstractions.Serialization;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System;
namespace GitHub.Models {
/// <summary>
/// A check performed on the code of a given code change
/// </summary>
public class CheckRun : IAdditionalDataHolder, IParsable {
/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>
public IDictionary<string, object> AdditionalData { get; set; }
/// <summary>GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public NullableIntegration? App { get; set; }
#nullable restore
#else
public NullableIntegration App { get; set; }
#endif
/// <summary>The check_suite property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public CheckRun_check_suite? CheckSuite { get; set; }
#nullable restore
#else
public CheckRun_check_suite CheckSuite { get; set; }
#endif
/// <summary>The completed_at property</summary>
public DateTimeOffset? CompletedAt { get; set; }
/// <summary>The conclusion property</summary>
public CheckRun_conclusion? Conclusion { get; set; }
/// <summary>A deployment created as the result of an Actions check run from a workflow that references an environment</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public DeploymentSimple? Deployment { get; set; }
#nullable restore
#else
public DeploymentSimple Deployment { get; set; }
#endif
/// <summary>The details_url property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? DetailsUrl { get; set; }
#nullable restore
#else
public string DetailsUrl { get; set; }
#endif
/// <summary>The external_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? ExternalId { get; set; }
#nullable restore
#else
public string ExternalId { get; set; }
#endif
/// <summary>The SHA of the commit that is being checked.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? HeadSha { get; set; }
#nullable restore
#else
public string HeadSha { get; set; }
#endif
/// <summary>The html_url property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? HtmlUrl { get; set; }
#nullable restore
#else
public string HtmlUrl { get; set; }
#endif
/// <summary>The id of the check.</summary>
public int? Id { get; set; }
/// <summary>The name of the check.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Name { get; set; }
#nullable restore
#else
public string Name { get; set; }
#endif
/// <summary>The node_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? NodeId { get; set; }
#nullable restore
#else
public string NodeId { get; set; }
#endif
/// <summary>The output property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public CheckRun_output? Output { get; set; }
#nullable restore
#else
public CheckRun_output Output { get; set; }
#endif
/// <summary>Pull requests that are open with a `head_sha` or `head_branch` that matches the check. The returned pull requests do not necessarily indicate pull requests that triggered the check.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public List<PullRequestMinimal>? PullRequests { get; set; }
#nullable restore
#else
public List<PullRequestMinimal> PullRequests { get; set; }
#endif
/// <summary>The started_at property</summary>
public DateTimeOffset? StartedAt { get; set; }
/// <summary>The phase of the lifecycle that the check is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check runs.</summary>
public CheckRun_status? Status { get; set; }
/// <summary>The url property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Url { get; set; }
#nullable restore
#else
public string Url { get; set; }
#endif
/// <summary>
/// Instantiates a new <see cref="CheckRun"/> and sets the default values.
/// </summary>
public CheckRun() {
AdditionalData = new Dictionary<string, object>();
}
/// <summary>
/// Creates a new instance of the appropriate class based on discriminator value
/// </summary>
/// <returns>A <see cref="CheckRun"/></returns>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static CheckRun CreateFromDiscriminatorValue(IParseNode parseNode) {
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
return new CheckRun();
}
/// <summary>
/// The deserialization information for the current model
/// </summary>
/// <returns>A IDictionary<string, Action<IParseNode>></returns>
public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers() {
return new Dictionary<string, Action<IParseNode>> {
{"app", n => { App = n.GetObjectValue<NullableIntegration>(NullableIntegration.CreateFromDiscriminatorValue); } },
{"check_suite", n => { CheckSuite = n.GetObjectValue<CheckRun_check_suite>(CheckRun_check_suite.CreateFromDiscriminatorValue); } },
{"completed_at", n => { CompletedAt = n.GetDateTimeOffsetValue(); } },
{"conclusion", n => { Conclusion = n.GetEnumValue<CheckRun_conclusion>(); } },
{"deployment", n => { Deployment = n.GetObjectValue<DeploymentSimple>(DeploymentSimple.CreateFromDiscriminatorValue); } },
{"details_url", n => { DetailsUrl = n.GetStringValue(); } },
{"external_id", n => { ExternalId = n.GetStringValue(); } },
{"head_sha", n => { HeadSha = n.GetStringValue(); } },
{"html_url", n => { HtmlUrl = n.GetStringValue(); } },
{"id", n => { Id = n.GetIntValue(); } },
{"name", n => { Name = n.GetStringValue(); } },
{"node_id", n => { NodeId = n.GetStringValue(); } },
{"output", n => { Output = n.GetObjectValue<CheckRun_output>(CheckRun_output.CreateFromDiscriminatorValue); } },
{"pull_requests", n => { PullRequests = n.GetCollectionOfObjectValues<PullRequestMinimal>(PullRequestMinimal.CreateFromDiscriminatorValue)?.ToList(); } },
{"started_at", n => { StartedAt = n.GetDateTimeOffsetValue(); } },
{"status", n => { Status = n.GetEnumValue<CheckRun_status>(); } },
{"url", n => { Url = n.GetStringValue(); } },
};
}
/// <summary>
/// Serializes information the current object
/// </summary>
/// <param name="writer">Serialization writer to use to serialize this model</param>
public virtual void Serialize(ISerializationWriter writer) {
_ = writer ?? throw new ArgumentNullException(nameof(writer));
writer.WriteObjectValue<NullableIntegration>("app", App);
writer.WriteObjectValue<CheckRun_check_suite>("check_suite", CheckSuite);
writer.WriteDateTimeOffsetValue("completed_at", CompletedAt);
writer.WriteEnumValue<CheckRun_conclusion>("conclusion", Conclusion);
writer.WriteObjectValue<DeploymentSimple>("deployment", Deployment);
writer.WriteStringValue("details_url", DetailsUrl);
writer.WriteStringValue("external_id", ExternalId);
writer.WriteStringValue("head_sha", HeadSha);
writer.WriteStringValue("html_url", HtmlUrl);
writer.WriteIntValue("id", Id);
writer.WriteStringValue("name", Name);
writer.WriteStringValue("node_id", NodeId);
writer.WriteObjectValue<CheckRun_output>("output", Output);
writer.WriteCollectionOfObjectValues<PullRequestMinimal>("pull_requests", PullRequests);
writer.WriteDateTimeOffsetValue("started_at", StartedAt);
writer.WriteEnumValue<CheckRun_status>("status", Status);
writer.WriteStringValue("url", Url);
writer.WriteAdditionalData(AdditionalData);
}
}
}