Skip to content

Commit f77553c

Browse files
authored
feat | fix | breaking: updates CopilotSeatDetails[CopilotSeatDetails_organization > NullableOrganizationSimple], [CopilotSeatDetails_assignee > SimpleUser], fixes many previously unknown types, fixes check run discriminator to evaluate status, fixes content discriminator to evaluate type
1 parent 2df6bed commit f77553c

15 files changed

+246
-830
lines changed

src/GitHub/Models/CopilotSeatDetails.cs

+10-10
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ namespace GitHub.Models
1414
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.18.0")]
1515
public partial class CopilotSeatDetails : IParsable
1616
{
17-
/// <summary>The assignee that has been granted access to GitHub Copilot.</summary>
17+
/// <summary>A GitHub user.</summary>
1818
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
1919
#nullable enable
20-
public global::GitHub.Models.CopilotSeatDetails_assignee? Assignee { get; set; }
20+
public global::GitHub.Models.SimpleUser? Assignee { get; set; }
2121
#nullable restore
2222
#else
23-
public global::GitHub.Models.CopilotSeatDetails_assignee Assignee { get; set; }
23+
public global::GitHub.Models.SimpleUser Assignee { get; set; }
2424
#endif
2525
/// <summary>The team through which the assignee is granted access to GitHub Copilot, if applicable.</summary>
2626
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
@@ -42,13 +42,13 @@ public partial class CopilotSeatDetails : IParsable
4242
#else
4343
public string LastActivityEditor { get; set; }
4444
#endif
45-
/// <summary>The organization to which this seat belongs.</summary>
45+
/// <summary>A GitHub organization.</summary>
4646
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
4747
#nullable enable
48-
public global::GitHub.Models.CopilotSeatDetails_organization? Organization { get; set; }
48+
public global::GitHub.Models.NullableOrganizationSimple? Organization { get; set; }
4949
#nullable restore
5050
#else
51-
public global::GitHub.Models.CopilotSeatDetails_organization Organization { get; set; }
51+
public global::GitHub.Models.NullableOrganizationSimple Organization { get; set; }
5252
#endif
5353
/// <summary>The pending cancellation date for the seat, in `YYYY-MM-DD` format. This will be null unless the assignee&apos;s Copilot access has been canceled during the current billing cycle. If the seat has been cancelled, this corresponds to the start of the organization&apos;s next billing cycle.</summary>
5454
public Date? PendingCancellationDate { get; set; }
@@ -72,12 +72,12 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
7272
{
7373
return new Dictionary<string, Action<IParseNode>>
7474
{
75-
{ "assignee", n => { Assignee = n.GetObjectValue<global::GitHub.Models.CopilotSeatDetails_assignee>(global::GitHub.Models.CopilotSeatDetails_assignee.CreateFromDiscriminatorValue); } },
75+
{ "assignee", n => { Assignee = n.GetObjectValue<global::GitHub.Models.SimpleUser>(global::GitHub.Models.SimpleUser.CreateFromDiscriminatorValue); } },
7676
{ "assigning_team", n => { AssigningTeam = n.GetObjectValue<global::GitHub.Models.CopilotSeatDetails.CopilotSeatDetails_assigning_team>(global::GitHub.Models.CopilotSeatDetails.CopilotSeatDetails_assigning_team.CreateFromDiscriminatorValue); } },
7777
{ "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } },
7878
{ "last_activity_at", n => { LastActivityAt = n.GetDateTimeOffsetValue(); } },
7979
{ "last_activity_editor", n => { LastActivityEditor = n.GetStringValue(); } },
80-
{ "organization", n => { Organization = n.GetObjectValue<global::GitHub.Models.CopilotSeatDetails_organization>(global::GitHub.Models.CopilotSeatDetails_organization.CreateFromDiscriminatorValue); } },
80+
{ "organization", n => { Organization = n.GetObjectValue<global::GitHub.Models.NullableOrganizationSimple>(global::GitHub.Models.NullableOrganizationSimple.CreateFromDiscriminatorValue); } },
8181
{ "pending_cancellation_date", n => { PendingCancellationDate = n.GetDateValue(); } },
8282
{ "updated_at", n => { UpdatedAt = n.GetDateTimeOffsetValue(); } },
8383
};
@@ -89,12 +89,12 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
8989
public virtual void Serialize(ISerializationWriter writer)
9090
{
9191
_ = writer ?? throw new ArgumentNullException(nameof(writer));
92-
writer.WriteObjectValue<global::GitHub.Models.CopilotSeatDetails_assignee>("assignee", Assignee);
92+
writer.WriteObjectValue<global::GitHub.Models.SimpleUser>("assignee", Assignee);
9393
writer.WriteObjectValue<global::GitHub.Models.CopilotSeatDetails.CopilotSeatDetails_assigning_team>("assigning_team", AssigningTeam);
9494
writer.WriteDateTimeOffsetValue("created_at", CreatedAt);
9595
writer.WriteDateTimeOffsetValue("last_activity_at", LastActivityAt);
9696
writer.WriteStringValue("last_activity_editor", LastActivityEditor);
97-
writer.WriteObjectValue<global::GitHub.Models.CopilotSeatDetails_organization>("organization", Organization);
97+
writer.WriteObjectValue<global::GitHub.Models.NullableOrganizationSimple>("organization", Organization);
9898
writer.WriteDateValue("pending_cancellation_date", PendingCancellationDate);
9999
writer.WriteDateTimeOffsetValue("updated_at", UpdatedAt);
100100
}

src/GitHub/Models/CopilotSeatDetails_assignee.cs

-56
This file was deleted.

src/GitHub/Models/CopilotSeatDetails_organization.cs

-56
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
// <auto-generated/>
2+
#pragma warning disable CS0618
3+
using Microsoft.Kiota.Abstractions.Extensions;
4+
using Microsoft.Kiota.Abstractions.Serialization;
5+
using System.Collections.Generic;
6+
using System.IO;
7+
using System;
8+
namespace GitHub.Models
9+
{
10+
/// <summary>
11+
/// A GitHub organization.
12+
/// </summary>
13+
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.18.0")]
14+
public partial class NullableOrganizationSimple : IAdditionalDataHolder, IParsable
15+
{
16+
/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>
17+
public IDictionary<string, object> AdditionalData { get; set; }
18+
/// <summary>The avatar_url property</summary>
19+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
20+
#nullable enable
21+
public string? AvatarUrl { get; set; }
22+
#nullable restore
23+
#else
24+
public string AvatarUrl { get; set; }
25+
#endif
26+
/// <summary>The description property</summary>
27+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
28+
#nullable enable
29+
public string? Description { get; set; }
30+
#nullable restore
31+
#else
32+
public string Description { get; set; }
33+
#endif
34+
/// <summary>The events_url property</summary>
35+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
36+
#nullable enable
37+
public string? EventsUrl { get; set; }
38+
#nullable restore
39+
#else
40+
public string EventsUrl { get; set; }
41+
#endif
42+
/// <summary>The hooks_url property</summary>
43+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
44+
#nullable enable
45+
public string? HooksUrl { get; set; }
46+
#nullable restore
47+
#else
48+
public string HooksUrl { get; set; }
49+
#endif
50+
/// <summary>The id property</summary>
51+
public int? Id { get; set; }
52+
/// <summary>The issues_url property</summary>
53+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
54+
#nullable enable
55+
public string? IssuesUrl { get; set; }
56+
#nullable restore
57+
#else
58+
public string IssuesUrl { get; set; }
59+
#endif
60+
/// <summary>The login property</summary>
61+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
62+
#nullable enable
63+
public string? Login { get; set; }
64+
#nullable restore
65+
#else
66+
public string Login { get; set; }
67+
#endif
68+
/// <summary>The members_url property</summary>
69+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
70+
#nullable enable
71+
public string? MembersUrl { get; set; }
72+
#nullable restore
73+
#else
74+
public string MembersUrl { get; set; }
75+
#endif
76+
/// <summary>The node_id property</summary>
77+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
78+
#nullable enable
79+
public string? NodeId { get; set; }
80+
#nullable restore
81+
#else
82+
public string NodeId { get; set; }
83+
#endif
84+
/// <summary>The public_members_url property</summary>
85+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
86+
#nullable enable
87+
public string? PublicMembersUrl { get; set; }
88+
#nullable restore
89+
#else
90+
public string PublicMembersUrl { get; set; }
91+
#endif
92+
/// <summary>The repos_url property</summary>
93+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
94+
#nullable enable
95+
public string? ReposUrl { get; set; }
96+
#nullable restore
97+
#else
98+
public string ReposUrl { get; set; }
99+
#endif
100+
/// <summary>The url property</summary>
101+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
102+
#nullable enable
103+
public string? Url { get; set; }
104+
#nullable restore
105+
#else
106+
public string Url { get; set; }
107+
#endif
108+
/// <summary>
109+
/// Instantiates a new <see cref="global::GitHub.Models.NullableOrganizationSimple"/> and sets the default values.
110+
/// </summary>
111+
public NullableOrganizationSimple()
112+
{
113+
AdditionalData = new Dictionary<string, object>();
114+
}
115+
/// <summary>
116+
/// Creates a new instance of the appropriate class based on discriminator value
117+
/// </summary>
118+
/// <returns>A <see cref="global::GitHub.Models.NullableOrganizationSimple"/></returns>
119+
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
120+
public static global::GitHub.Models.NullableOrganizationSimple CreateFromDiscriminatorValue(IParseNode parseNode)
121+
{
122+
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
123+
return new global::GitHub.Models.NullableOrganizationSimple();
124+
}
125+
/// <summary>
126+
/// The deserialization information for the current model
127+
/// </summary>
128+
/// <returns>A IDictionary&lt;string, Action&lt;IParseNode&gt;&gt;</returns>
129+
public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
130+
{
131+
return new Dictionary<string, Action<IParseNode>>
132+
{
133+
{ "avatar_url", n => { AvatarUrl = n.GetStringValue(); } },
134+
{ "description", n => { Description = n.GetStringValue(); } },
135+
{ "events_url", n => { EventsUrl = n.GetStringValue(); } },
136+
{ "hooks_url", n => { HooksUrl = n.GetStringValue(); } },
137+
{ "id", n => { Id = n.GetIntValue(); } },
138+
{ "issues_url", n => { IssuesUrl = n.GetStringValue(); } },
139+
{ "login", n => { Login = n.GetStringValue(); } },
140+
{ "members_url", n => { MembersUrl = n.GetStringValue(); } },
141+
{ "node_id", n => { NodeId = n.GetStringValue(); } },
142+
{ "public_members_url", n => { PublicMembersUrl = n.GetStringValue(); } },
143+
{ "repos_url", n => { ReposUrl = n.GetStringValue(); } },
144+
{ "url", n => { Url = n.GetStringValue(); } },
145+
};
146+
}
147+
/// <summary>
148+
/// Serializes information the current object
149+
/// </summary>
150+
/// <param name="writer">Serialization writer to use to serialize this model</param>
151+
public virtual void Serialize(ISerializationWriter writer)
152+
{
153+
_ = writer ?? throw new ArgumentNullException(nameof(writer));
154+
writer.WriteStringValue("avatar_url", AvatarUrl);
155+
writer.WriteStringValue("description", Description);
156+
writer.WriteStringValue("events_url", EventsUrl);
157+
writer.WriteStringValue("hooks_url", HooksUrl);
158+
writer.WriteIntValue("id", Id);
159+
writer.WriteStringValue("issues_url", IssuesUrl);
160+
writer.WriteStringValue("login", Login);
161+
writer.WriteStringValue("members_url", MembersUrl);
162+
writer.WriteStringValue("node_id", NodeId);
163+
writer.WriteStringValue("public_members_url", PublicMembersUrl);
164+
writer.WriteStringValue("repos_url", ReposUrl);
165+
writer.WriteStringValue("url", Url);
166+
writer.WriteAdditionalData(AdditionalData);
167+
}
168+
}
169+
}
170+
#pragma warning restore CS0618

src/GitHub/Repos/Item/Item/Branches/Item/Protection/Restrictions/Apps/AppsDeleteRequestBodyMember1.cs src/GitHub/Repos/Item/Item/Branches/Item/Protection/Restrictions/Apps/AppsDeleteRequestBody.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace GitHub.Repos.Item.Item.Branches.Item.Protection.Restrictions.Apps
99
{
1010
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.18.0")]
1111
#pragma warning disable CS1591
12-
public partial class AppsDeleteRequestBodyMember1 : IAdditionalDataHolder, IParsable
12+
public partial class AppsDeleteRequestBody : IAdditionalDataHolder, IParsable
1313
#pragma warning restore CS1591
1414
{
1515
/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>
@@ -23,21 +23,21 @@ public partial class AppsDeleteRequestBodyMember1 : IAdditionalDataHolder, IPars
2323
public List<string> Apps { get; set; }
2424
#endif
2525
/// <summary>
26-
/// Instantiates a new <see cref="global::GitHub.Repos.Item.Item.Branches.Item.Protection.Restrictions.Apps.AppsDeleteRequestBodyMember1"/> and sets the default values.
26+
/// Instantiates a new <see cref="global::GitHub.Repos.Item.Item.Branches.Item.Protection.Restrictions.Apps.AppsDeleteRequestBody"/> and sets the default values.
2727
/// </summary>
28-
public AppsDeleteRequestBodyMember1()
28+
public AppsDeleteRequestBody()
2929
{
3030
AdditionalData = new Dictionary<string, object>();
3131
}
3232
/// <summary>
3333
/// Creates a new instance of the appropriate class based on discriminator value
3434
/// </summary>
35-
/// <returns>A <see cref="global::GitHub.Repos.Item.Item.Branches.Item.Protection.Restrictions.Apps.AppsDeleteRequestBodyMember1"/></returns>
35+
/// <returns>A <see cref="global::GitHub.Repos.Item.Item.Branches.Item.Protection.Restrictions.Apps.AppsDeleteRequestBody"/></returns>
3636
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
37-
public static global::GitHub.Repos.Item.Item.Branches.Item.Protection.Restrictions.Apps.AppsDeleteRequestBodyMember1 CreateFromDiscriminatorValue(IParseNode parseNode)
37+
public static global::GitHub.Repos.Item.Item.Branches.Item.Protection.Restrictions.Apps.AppsDeleteRequestBody CreateFromDiscriminatorValue(IParseNode parseNode)
3838
{
3939
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
40-
return new global::GitHub.Repos.Item.Item.Branches.Item.Protection.Restrictions.Apps.AppsDeleteRequestBodyMember1();
40+
return new global::GitHub.Repos.Item.Item.Branches.Item.Protection.Restrictions.Apps.AppsDeleteRequestBody();
4141
}
4242
/// <summary>
4343
/// The deserialization information for the current model

0 commit comments

Comments
 (0)