From fd887122e40ef4c50f733199c72634e5fa8541b6 Mon Sep 17 00:00:00 2001 From: Octokit Bot Date: Tue, 15 Oct 2024 10:39:25 -0700 Subject: [PATCH] New updates to generated code (#96) --- src/GitHub/Models/Users.cs | 54 +++++++++++++++------ src/GitHub/Models/Users_matches.cs | 75 ++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+), 14 deletions(-) create mode 100644 src/GitHub/Models/Users_matches.cs diff --git a/src/GitHub/Models/Users.cs b/src/GitHub/Models/Users.cs index 1353411f7..ee1970b91 100644 --- a/src/GitHub/Models/Users.cs +++ b/src/GitHub/Models/Users.cs @@ -14,23 +14,45 @@ public partial class Users : IAdditionalDataHolder, IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } - /// Whether this email address is the primary address. - public bool? Primary { get; set; } - /// The type of email address. + /// The fragment property #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 - /// The email address. + /// The matches property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Value { get; set; } + public List? Matches { get; set; } #nullable restore #else - public string Value { get; set; } + public List Matches { get; set; } +#endif + /// The object_type property +#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 + /// The object_url property +#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 + /// The property property +#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 /// /// Instantiates a new and sets the default values. @@ -57,9 +79,11 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "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.CreateFromDiscriminatorValue)?.AsList(); } }, + { "object_type", n => { ObjectType = n.GetStringValue(); } }, + { "object_url", n => { ObjectUrl = n.GetStringValue(); } }, + { "property", n => { Property = n.GetStringValue(); } }, }; } /// @@ -69,9 +93,11 @@ public virtual IDictionary> 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("matches", Matches); + writer.WriteStringValue("object_type", ObjectType); + writer.WriteStringValue("object_url", ObjectUrl); + writer.WriteStringValue("property", Property); writer.WriteAdditionalData(AdditionalData); } } diff --git a/src/GitHub/Models/Users_matches.cs b/src/GitHub/Models/Users_matches.cs new file mode 100644 index 000000000..02c4f2f4d --- /dev/null +++ b/src/GitHub/Models/Users_matches.cs @@ -0,0 +1,75 @@ +// +#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 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The indices property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Indices { get; set; } +#nullable restore +#else + public List Indices { get; set; } +#endif + /// The text property +#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 + /// + /// Instantiates a new and sets the default values. + /// + public Users_matches() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::GitHub.Models.Users_matches CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new global::GitHub.Models.Users_matches(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "indices", n => { Indices = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "text", n => { Text = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("indices", Indices); + writer.WriteStringValue("text", Text); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618