Skip to content

Commit

Permalink
New updates to generated code (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
octokitbot authored Oct 10, 2024
1 parent bad1843 commit bff8750
Show file tree
Hide file tree
Showing 7 changed files with 170 additions and 15 deletions.
4 changes: 4 additions & 0 deletions src/GitHub/Models/CopilotOrganizationDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public partial class CopilotOrganizationDetails : IAdditionalDataHolder, IParsab
public global::GitHub.Models.CopilotOrganizationDetails_cli? Cli { get; set; }
/// <summary>The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor.</summary>
public global::GitHub.Models.CopilotOrganizationDetails_ide_chat? IdeChat { get; set; }
/// <summary>The Copilot plan of the organization, or the parent enterprise, when applicable.</summary>
public global::GitHub.Models.CopilotOrganizationDetails_plan_type? PlanType { get; set; }
/// <summary>The organization policy for allowing or disallowing organization members to use Copilot features within github.com.</summary>
public global::GitHub.Models.CopilotOrganizationDetails_platform_chat? PlatformChat { get; set; }
/// <summary>The organization policy for allowing or disallowing Copilot to make suggestions that match public code.</summary>
Expand Down Expand Up @@ -60,6 +62,7 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{
{ "cli", n => { Cli = n.GetEnumValue<global::GitHub.Models.CopilotOrganizationDetails_cli>(); } },
{ "ide_chat", n => { IdeChat = n.GetEnumValue<global::GitHub.Models.CopilotOrganizationDetails_ide_chat>(); } },
{ "plan_type", n => { PlanType = n.GetEnumValue<global::GitHub.Models.CopilotOrganizationDetails_plan_type>(); } },
{ "platform_chat", n => { PlatformChat = n.GetEnumValue<global::GitHub.Models.CopilotOrganizationDetails_platform_chat>(); } },
{ "public_code_suggestions", n => { PublicCodeSuggestions = n.GetEnumValue<global::GitHub.Models.CopilotOrganizationDetails_public_code_suggestions>(); } },
{ "seat_breakdown", n => { SeatBreakdown = n.GetObjectValue<global::GitHub.Models.CopilotSeatBreakdown>(global::GitHub.Models.CopilotSeatBreakdown.CreateFromDiscriminatorValue); } },
Expand All @@ -75,6 +78,7 @@ public virtual void Serialize(ISerializationWriter writer)
_ = writer ?? throw new ArgumentNullException(nameof(writer));
writer.WriteEnumValue<global::GitHub.Models.CopilotOrganizationDetails_cli>("cli", Cli);
writer.WriteEnumValue<global::GitHub.Models.CopilotOrganizationDetails_ide_chat>("ide_chat", IdeChat);
writer.WriteEnumValue<global::GitHub.Models.CopilotOrganizationDetails_plan_type>("plan_type", PlanType);
writer.WriteEnumValue<global::GitHub.Models.CopilotOrganizationDetails_platform_chat>("platform_chat", PlatformChat);
writer.WriteEnumValue<global::GitHub.Models.CopilotOrganizationDetails_public_code_suggestions>("public_code_suggestions", PublicCodeSuggestions);
writer.WriteObjectValue<global::GitHub.Models.CopilotSeatBreakdown>("seat_breakdown", SeatBreakdown);
Expand Down
23 changes: 23 additions & 0 deletions src/GitHub/Models/CopilotOrganizationDetails_plan_type.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// <auto-generated/>
using System.Runtime.Serialization;
using System;
namespace GitHub.Models
{
/// <summary>The Copilot plan of the organization, or the parent enterprise, when applicable.</summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")]
public enum CopilotOrganizationDetails_plan_type
{
[EnumMember(Value = "business")]
#pragma warning disable CS1591
Business,
#pragma warning restore CS1591
[EnumMember(Value = "enterprise")]
#pragma warning disable CS1591
Enterprise,
#pragma warning restore CS1591
[EnumMember(Value = "unknown")]
#pragma warning disable CS1591
Unknown,
#pragma warning restore CS1591
}
}
4 changes: 4 additions & 0 deletions src/GitHub/Models/CopilotSeatDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public partial class CopilotSeatDetails : IParsable
#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; }
/// <summary>The Copilot plan of the organization, or the parent enterprise, when applicable.</summary>
public global::GitHub.Models.CopilotSeatDetails_plan_type? PlanType { get; set; }
/// <summary>Timestamp of when the assignee&apos;s GitHub Copilot access was last updated, in ISO 8601 format.</summary>
public DateTimeOffset? UpdatedAt { get; set; }
/// <summary>
Expand Down Expand Up @@ -79,6 +81,7 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{ "last_activity_editor", n => { LastActivityEditor = n.GetStringValue(); } },
{ "organization", n => { Organization = n.GetObjectValue<global::GitHub.Models.NullableOrganizationSimple>(global::GitHub.Models.NullableOrganizationSimple.CreateFromDiscriminatorValue); } },
{ "pending_cancellation_date", n => { PendingCancellationDate = n.GetDateValue(); } },
{ "plan_type", n => { PlanType = n.GetEnumValue<global::GitHub.Models.CopilotSeatDetails_plan_type>(); } },
{ "updated_at", n => { UpdatedAt = n.GetDateTimeOffsetValue(); } },
};
}
Expand All @@ -96,6 +99,7 @@ public virtual void Serialize(ISerializationWriter writer)
writer.WriteStringValue("last_activity_editor", LastActivityEditor);
writer.WriteObjectValue<global::GitHub.Models.NullableOrganizationSimple>("organization", Organization);
writer.WriteDateValue("pending_cancellation_date", PendingCancellationDate);
writer.WriteEnumValue<global::GitHub.Models.CopilotSeatDetails_plan_type>("plan_type", PlanType);
writer.WriteDateTimeOffsetValue("updated_at", UpdatedAt);
}
/// <summary>
Expand Down
23 changes: 23 additions & 0 deletions src/GitHub/Models/CopilotSeatDetails_plan_type.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// <auto-generated/>
using System.Runtime.Serialization;
using System;
namespace GitHub.Models
{
/// <summary>The Copilot plan of the organization, or the parent enterprise, when applicable.</summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")]
public enum CopilotSeatDetails_plan_type
{
[EnumMember(Value = "business")]
#pragma warning disable CS1591
Business,
#pragma warning restore CS1591
[EnumMember(Value = "enterprise")]
#pragma warning disable CS1591
Enterprise,
#pragma warning restore CS1591
[EnumMember(Value = "unknown")]
#pragma warning disable CS1591
Unknown,
#pragma warning restore CS1591
}
}
54 changes: 40 additions & 14 deletions src/GitHub/Models/Users.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,45 @@ public partial class Users : 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>Whether this email address is the primary address.</summary>
public bool? Primary { get; set; }
/// <summary>The type of email address.</summary>
/// <summary>The fragment property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Type { get; set; }
public string? Fragment { get; set; }
#nullable restore
#else
public string Type { get; set; }
public string Fragment { get; set; }
#endif
/// <summary>The email address.</summary>
/// <summary>The matches property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Value { get; set; }
public List<global::GitHub.Models.Users_matches>? Matches { get; set; }
#nullable restore
#else
public string Value { get; set; }
public List<global::GitHub.Models.Users_matches> Matches { get; set; }
#endif
/// <summary>The object_type property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? ObjectType { get; set; }
#nullable restore
#else
public string ObjectType { get; set; }
#endif
/// <summary>The object_url property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? ObjectUrl { get; set; }
#nullable restore
#else
public string ObjectUrl { get; set; }
#endif
/// <summary>The property property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Property { get; set; }
#nullable restore
#else
public string Property { get; set; }
#endif
/// <summary>
/// Instantiates a new <see cref="global::GitHub.Models.Users"/> and sets the default values.
Expand All @@ -57,9 +79,11 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{
return new Dictionary<string, Action<IParseNode>>
{
{ "primary", n => { Primary = n.GetBoolValue(); } },
{ "type", n => { Type = n.GetStringValue(); } },
{ "value", n => { Value = n.GetStringValue(); } },
{ "fragment", n => { Fragment = n.GetStringValue(); } },
{ "matches", n => { Matches = n.GetCollectionOfObjectValues<global::GitHub.Models.Users_matches>(global::GitHub.Models.Users_matches.CreateFromDiscriminatorValue)?.AsList(); } },
{ "object_type", n => { ObjectType = n.GetStringValue(); } },
{ "object_url", n => { ObjectUrl = n.GetStringValue(); } },
{ "property", n => { Property = n.GetStringValue(); } },
};
}
/// <summary>
Expand All @@ -69,9 +93,11 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
public virtual void Serialize(ISerializationWriter writer)
{
_ = writer ?? throw new ArgumentNullException(nameof(writer));
writer.WriteBoolValue("primary", Primary);
writer.WriteStringValue("type", Type);
writer.WriteStringValue("value", Value);
writer.WriteStringValue("fragment", Fragment);
writer.WriteCollectionOfObjectValues<global::GitHub.Models.Users_matches>("matches", Matches);
writer.WriteStringValue("object_type", ObjectType);
writer.WriteStringValue("object_url", ObjectUrl);
writer.WriteStringValue("property", Property);
writer.WriteAdditionalData(AdditionalData);
}
}
Expand Down
75 changes: 75 additions & 0 deletions src/GitHub/Models/Users_matches.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// <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
{
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.19.0")]
#pragma warning disable CS1591
public partial class Users_matches : 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>
public IDictionary<string, object> AdditionalData { get; set; }
/// <summary>The indices property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public List<int?>? Indices { get; set; }
#nullable restore
#else
public List<int?> Indices { get; set; }
#endif
/// <summary>The text property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Text { get; set; }
#nullable restore
#else
public string Text { get; set; }
#endif
/// <summary>
/// Instantiates a new <see cref="global::GitHub.Models.Users_matches"/> and sets the default values.
/// </summary>
public Users_matches()
{
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.Users_matches"/></returns>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static global::GitHub.Models.Users_matches CreateFromDiscriminatorValue(IParseNode parseNode)
{
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
return new global::GitHub.Models.Users_matches();
}
/// <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>>
{
{ "indices", n => { Indices = n.GetCollectionOfPrimitiveValues<int?>()?.AsList(); } },
{ "text", n => { Text = 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.WriteCollectionOfPrimitiveValues<int?>("indices", Indices);
writer.WriteStringValue("text", Text);
writer.WriteAdditionalData(AdditionalData);
}
}
}
#pragma warning restore CS0618
2 changes: 1 addition & 1 deletion src/GitHub/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"descriptionHash": "8E75A9568025D2342D8E3EED133A8A20DAA06C7979A39C420CB0C607E9E357E71B605AC9F7C811E24985B6C4902845A6C94C831F79C3EB687B4BC744DDB5C5FF",
"descriptionHash": "78E960D62E4977D7C0590CFB9F19215F0D810ACA39F64862C52E2D17758BE492D45635B01CC02DDA49AB89ABB9688B3996719F5A57DEF299897C71D6436F4F66",
"descriptionLocation": "../../../../../schemas/ghec.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.19.0",
Expand Down

0 comments on commit bff8750

Please sign in to comment.