Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Updates CheckRun.id to the proper type, adds Users[Users_matchesable, object_type, object_url, property] #19

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/GitHub/Models/CheckRun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class CheckRun : IAdditionalDataHolder, IParsable
public string HtmlUrl { get; set; }
#endif
/// <summary>The id of the check.</summary>
public int? Id { get; set; }
public long? Id { get; set; }
/// <summary>The name of the check.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
Expand Down Expand Up @@ -152,7 +152,7 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{"external_id", n => { ExternalId = n.GetStringValue(); } },
{"head_sha", n => { HeadSha = n.GetStringValue(); } },
{"html_url", n => { HtmlUrl = n.GetStringValue(); } },
{"id", n => { Id = n.GetIntValue(); } },
{"id", n => { Id = n.GetLongValue(); } },
{"name", n => { Name = n.GetStringValue(); } },
{"node_id", n => { NodeId = n.GetStringValue(); } },
{"output", n => { Output = n.GetObjectValue<CheckRun_output>(CheckRun_output.CreateFromDiscriminatorValue); } },
Expand All @@ -178,7 +178,7 @@ public virtual void Serialize(ISerializationWriter writer)
writer.WriteStringValue("external_id", ExternalId);
writer.WriteStringValue("head_sha", HeadSha);
writer.WriteStringValue("html_url", HtmlUrl);
writer.WriteIntValue("id", Id);
writer.WriteLongValue("id", Id);
writer.WriteStringValue("name", Name);
writer.WriteStringValue("node_id", NodeId);
writer.WriteObjectValue<CheckRun_output>("output", Output);
Expand Down
54 changes: 40 additions & 14 deletions src/GitHub/Models/Users.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,45 @@ public 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<Users_matches>? Matches { get; set; }
#nullable restore
#else
public string Value { get; set; }
public List<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="Users"/> and sets the default values.
Expand All @@ -54,9 +76,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<Users_matches>(Users_matches.CreateFromDiscriminatorValue)?.ToList(); } },
{"object_type", n => { ObjectType = n.GetStringValue(); } },
{"object_url", n => { ObjectUrl = n.GetStringValue(); } },
{"property", n => { Property = n.GetStringValue(); } },
};
}
/// <summary>
Expand All @@ -66,9 +90,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<Users_matches>("matches", Matches);
writer.WriteStringValue("object_type", ObjectType);
writer.WriteStringValue("object_url", ObjectUrl);
writer.WriteStringValue("property", Property);
writer.WriteAdditionalData(AdditionalData);
}
}
Expand Down
71 changes: 71 additions & 0 deletions src/GitHub/Models/Users_matches.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// <auto-generated/>
using Microsoft.Kiota.Abstractions.Serialization;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System;
namespace GitHub.Models {
#pragma warning disable CS1591
public 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="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="Users_matches"/></returns>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static Users_matches CreateFromDiscriminatorValue(IParseNode parseNode)
{
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
return new 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?>()?.ToList(); } },
{"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);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ public async Task<WithPathGetResponse> GetAsync(Action<RequestConfiguration<With
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
/// <exception cref="BasicError">When receiving a 404 status code</exception>
/// <exception cref="BasicError">When receiving a 409 status code</exception>
/// <exception cref="ValidationError">When receiving a 422 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
Expand All @@ -113,7 +112,6 @@ public async Task<FileCommit> PutAsync(WithPathPutRequestBody body, Action<Reque
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
{
{"404", BasicError.CreateFromDiscriminatorValue},
{"409", BasicError.CreateFromDiscriminatorValue},
{"422", ValidationError.CreateFromDiscriminatorValue},
};
return await RequestAdapter.SendAsync<FileCommit>(requestInfo, FileCommit.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
Expand Down
2 changes: 0 additions & 2 deletions src/GitHub/Repos/Item/Item/Git/Blobs/BlobsRequestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public BlobsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base
/// <exception cref="BasicError">When receiving a 403 status code</exception>
/// <exception cref="BasicError">When receiving a 404 status code</exception>
/// <exception cref="BasicError">When receiving a 409 status code</exception>
/// <exception cref="ValidationError">When receiving a 422 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<ShortBlob?> PostAsync(BlobsPostRequestBody body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
Expand All @@ -71,7 +70,6 @@ public async Task<ShortBlob> PostAsync(BlobsPostRequestBody body, Action<Request
{"403", BasicError.CreateFromDiscriminatorValue},
{"404", BasicError.CreateFromDiscriminatorValue},
{"409", BasicError.CreateFromDiscriminatorValue},
{"422", ValidationError.CreateFromDiscriminatorValue},
};
return await RequestAdapter.SendAsync<ShortBlob>(requestInfo, ShortBlob.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
Expand Down
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": "F217D5F1F87F8A1F8FB70565C28B485084BE45C455EC0AACDAE435F24B8A357B80CE3286ED44A22729143D9703328F3E40AB1465CAF38092B6D99D29B8529C42",
"descriptionHash": "069085907BD8F22D78802FEE2B193F25030EDB28E6ABA9F8632E157685FD6322ED131E8921518F618D2A5EDECB77292DB749B1C8FDD3ABD76BCD812213BEB221",
"descriptionLocation": "../../../../../schemas/ghec.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.14.0",
Expand Down
Loading