Skip to content

Commit

Permalink
feat | fix | breaking: updates CopilotSeatDetails[CopilotSeatDetails_…
Browse files Browse the repository at this point in the history
…organization > NullableOrganizationSimple], [CopilotSeatDetails_assignee > SimpleUser], fixes many previously unknown types, fixes check run discriminator to evaluate status, fixes content discriminator to evaluate type
  • Loading branch information
octokitbot authored Oct 1, 2024
1 parent 2df6bed commit f77553c
Show file tree
Hide file tree
Showing 15 changed files with 246 additions and 830 deletions.
20 changes: 10 additions & 10 deletions src/GitHub/Models/CopilotSeatDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ namespace GitHub.Models
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.18.0")]
public partial class CopilotSeatDetails : IParsable
{
/// <summary>The assignee that has been granted access to GitHub Copilot.</summary>
/// <summary>A GitHub user.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::GitHub.Models.CopilotSeatDetails_assignee? Assignee { get; set; }
public global::GitHub.Models.SimpleUser? Assignee { get; set; }
#nullable restore
#else
public global::GitHub.Models.CopilotSeatDetails_assignee Assignee { get; set; }
public global::GitHub.Models.SimpleUser Assignee { get; set; }
#endif
/// <summary>The team through which the assignee is granted access to GitHub Copilot, if applicable.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
Expand All @@ -42,13 +42,13 @@ public partial class CopilotSeatDetails : IParsable
#else
public string LastActivityEditor { get; set; }
#endif
/// <summary>The organization to which this seat belongs.</summary>
/// <summary>A GitHub organization.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::GitHub.Models.CopilotSeatDetails_organization? Organization { get; set; }
public global::GitHub.Models.NullableOrganizationSimple? Organization { get; set; }
#nullable restore
#else
public global::GitHub.Models.CopilotSeatDetails_organization Organization { get; set; }
public global::GitHub.Models.NullableOrganizationSimple Organization { get; set; }
#endif
/// <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>
public Date? PendingCancellationDate { get; set; }
Expand All @@ -72,12 +72,12 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{
return new Dictionary<string, Action<IParseNode>>
{
{ "assignee", n => { Assignee = n.GetObjectValue<global::GitHub.Models.CopilotSeatDetails_assignee>(global::GitHub.Models.CopilotSeatDetails_assignee.CreateFromDiscriminatorValue); } },
{ "assignee", n => { Assignee = n.GetObjectValue<global::GitHub.Models.SimpleUser>(global::GitHub.Models.SimpleUser.CreateFromDiscriminatorValue); } },
{ "assigning_team", n => { AssigningTeam = n.GetObjectValue<global::GitHub.Models.CopilotSeatDetails.CopilotSeatDetails_assigning_team>(global::GitHub.Models.CopilotSeatDetails.CopilotSeatDetails_assigning_team.CreateFromDiscriminatorValue); } },
{ "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } },
{ "last_activity_at", n => { LastActivityAt = n.GetDateTimeOffsetValue(); } },
{ "last_activity_editor", n => { LastActivityEditor = n.GetStringValue(); } },
{ "organization", n => { Organization = n.GetObjectValue<global::GitHub.Models.CopilotSeatDetails_organization>(global::GitHub.Models.CopilotSeatDetails_organization.CreateFromDiscriminatorValue); } },
{ "organization", n => { Organization = n.GetObjectValue<global::GitHub.Models.NullableOrganizationSimple>(global::GitHub.Models.NullableOrganizationSimple.CreateFromDiscriminatorValue); } },
{ "pending_cancellation_date", n => { PendingCancellationDate = n.GetDateValue(); } },
{ "updated_at", n => { UpdatedAt = n.GetDateTimeOffsetValue(); } },
};
Expand All @@ -89,12 +89,12 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
public virtual void Serialize(ISerializationWriter writer)
{
_ = writer ?? throw new ArgumentNullException(nameof(writer));
writer.WriteObjectValue<global::GitHub.Models.CopilotSeatDetails_assignee>("assignee", Assignee);
writer.WriteObjectValue<global::GitHub.Models.SimpleUser>("assignee", Assignee);
writer.WriteObjectValue<global::GitHub.Models.CopilotSeatDetails.CopilotSeatDetails_assigning_team>("assigning_team", AssigningTeam);
writer.WriteDateTimeOffsetValue("created_at", CreatedAt);
writer.WriteDateTimeOffsetValue("last_activity_at", LastActivityAt);
writer.WriteStringValue("last_activity_editor", LastActivityEditor);
writer.WriteObjectValue<global::GitHub.Models.CopilotSeatDetails_organization>("organization", Organization);
writer.WriteObjectValue<global::GitHub.Models.NullableOrganizationSimple>("organization", Organization);
writer.WriteDateValue("pending_cancellation_date", PendingCancellationDate);
writer.WriteDateTimeOffsetValue("updated_at", UpdatedAt);
}
Expand Down
56 changes: 0 additions & 56 deletions src/GitHub/Models/CopilotSeatDetails_assignee.cs

This file was deleted.

56 changes: 0 additions & 56 deletions src/GitHub/Models/CopilotSeatDetails_organization.cs

This file was deleted.

170 changes: 170 additions & 0 deletions src/GitHub/Models/NullableOrganizationSimple.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
// <auto-generated/>
#pragma warning disable CS0618
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
using System.Collections.Generic;
using System.IO;
using System;
namespace GitHub.Models
{
/// <summary>
/// A GitHub organization.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.18.0")]
public partial class NullableOrganizationSimple : 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>The avatar_url property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? AvatarUrl { get; set; }
#nullable restore
#else
public string AvatarUrl { get; set; }
#endif
/// <summary>The description property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Description { get; set; }
#nullable restore
#else
public string Description { get; set; }
#endif
/// <summary>The events_url property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? EventsUrl { get; set; }
#nullable restore
#else
public string EventsUrl { get; set; }
#endif
/// <summary>The hooks_url property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? HooksUrl { get; set; }
#nullable restore
#else
public string HooksUrl { get; set; }
#endif
/// <summary>The id property</summary>
public int? Id { get; set; }
/// <summary>The issues_url property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? IssuesUrl { get; set; }
#nullable restore
#else
public string IssuesUrl { get; set; }
#endif
/// <summary>The login property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Login { get; set; }
#nullable restore
#else
public string Login { get; set; }
#endif
/// <summary>The members_url property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? MembersUrl { get; set; }
#nullable restore
#else
public string MembersUrl { 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 public_members_url property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? PublicMembersUrl { get; set; }
#nullable restore
#else
public string PublicMembersUrl { get; set; }
#endif
/// <summary>The repos_url property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? ReposUrl { get; set; }
#nullable restore
#else
public string ReposUrl { get; set; }
#endif
/// <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="global::GitHub.Models.NullableOrganizationSimple"/> and sets the default values.
/// </summary>
public NullableOrganizationSimple()
{
AdditionalData = new Dictionary<string, object>();
}
/// <summary>
/// Creates a new instance of the appropriate class based on discriminator value
/// </summary>
/// <returns>A <see cref="global::GitHub.Models.NullableOrganizationSimple"/></returns>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static global::GitHub.Models.NullableOrganizationSimple CreateFromDiscriminatorValue(IParseNode parseNode)
{
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
return new global::GitHub.Models.NullableOrganizationSimple();
}
/// <summary>
/// The deserialization information for the current model
/// </summary>
/// <returns>A IDictionary&lt;string, Action&lt;IParseNode&gt;&gt;</returns>
public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{
return new Dictionary<string, Action<IParseNode>>
{
{ "avatar_url", n => { AvatarUrl = n.GetStringValue(); } },
{ "description", n => { Description = n.GetStringValue(); } },
{ "events_url", n => { EventsUrl = n.GetStringValue(); } },
{ "hooks_url", n => { HooksUrl = n.GetStringValue(); } },
{ "id", n => { Id = n.GetIntValue(); } },
{ "issues_url", n => { IssuesUrl = n.GetStringValue(); } },
{ "login", n => { Login = n.GetStringValue(); } },
{ "members_url", n => { MembersUrl = n.GetStringValue(); } },
{ "node_id", n => { NodeId = n.GetStringValue(); } },
{ "public_members_url", n => { PublicMembersUrl = n.GetStringValue(); } },
{ "repos_url", n => { ReposUrl = n.GetStringValue(); } },
{ "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.WriteStringValue("avatar_url", AvatarUrl);
writer.WriteStringValue("description", Description);
writer.WriteStringValue("events_url", EventsUrl);
writer.WriteStringValue("hooks_url", HooksUrl);
writer.WriteIntValue("id", Id);
writer.WriteStringValue("issues_url", IssuesUrl);
writer.WriteStringValue("login", Login);
writer.WriteStringValue("members_url", MembersUrl);
writer.WriteStringValue("node_id", NodeId);
writer.WriteStringValue("public_members_url", PublicMembersUrl);
writer.WriteStringValue("repos_url", ReposUrl);
writer.WriteStringValue("url", Url);
writer.WriteAdditionalData(AdditionalData);
}
}
}
#pragma warning restore CS0618
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace GitHub.Repos.Item.Item.Branches.Item.Protection.Restrictions.Apps
{
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.18.0")]
#pragma warning disable CS1591
public partial class AppsDeleteRequestBodyMember1 : IAdditionalDataHolder, IParsable
public partial class AppsDeleteRequestBody : IAdditionalDataHolder, IParsable
#pragma warning restore CS1591
{
/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>
Expand All @@ -23,21 +23,21 @@ public partial class AppsDeleteRequestBodyMember1 : IAdditionalDataHolder, IPars
public List<string> Apps { get; set; }
#endif
/// <summary>
/// Instantiates a new <see cref="global::GitHub.Repos.Item.Item.Branches.Item.Protection.Restrictions.Apps.AppsDeleteRequestBodyMember1"/> and sets the default values.
/// Instantiates a new <see cref="global::GitHub.Repos.Item.Item.Branches.Item.Protection.Restrictions.Apps.AppsDeleteRequestBody"/> and sets the default values.
/// </summary>
public AppsDeleteRequestBodyMember1()
public AppsDeleteRequestBody()
{
AdditionalData = new Dictionary<string, object>();
}
/// <summary>
/// Creates a new instance of the appropriate class based on discriminator value
/// </summary>
/// <returns>A <see cref="global::GitHub.Repos.Item.Item.Branches.Item.Protection.Restrictions.Apps.AppsDeleteRequestBodyMember1"/></returns>
/// <returns>A <see cref="global::GitHub.Repos.Item.Item.Branches.Item.Protection.Restrictions.Apps.AppsDeleteRequestBody"/></returns>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static global::GitHub.Repos.Item.Item.Branches.Item.Protection.Restrictions.Apps.AppsDeleteRequestBodyMember1 CreateFromDiscriminatorValue(IParseNode parseNode)
public static global::GitHub.Repos.Item.Item.Branches.Item.Protection.Restrictions.Apps.AppsDeleteRequestBody CreateFromDiscriminatorValue(IParseNode parseNode)
{
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
return new global::GitHub.Repos.Item.Item.Branches.Item.Protection.Restrictions.Apps.AppsDeleteRequestBodyMember1();
return new global::GitHub.Repos.Item.Item.Branches.Item.Protection.Restrictions.Apps.AppsDeleteRequestBody();
}
/// <summary>
/// The deserialization information for the current model
Expand Down
Loading

0 comments on commit f77553c

Please sign in to comment.