Skip to content

Commit

Permalink
New updates to generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
octokitbot committed Aug 20, 2024
1 parent b06d77e commit 849eaa9
Show file tree
Hide file tree
Showing 9 changed files with 127 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public class AlertsRequestBuilderGetQueryParameters
[QueryParameter("resolution")]
public string Resolution { get; set; }
#endif
/// <summary>A comma-separated list of secret types to return. By default all secret types are returned.See &quot;[Secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)&quot;for a complete list of secret types.</summary>
/// <summary>A comma-separated list of secret types to return. By default all secret types are returned.See &quot;[Supported secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)&quot;for a complete list of secret types.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
[QueryParameter("secret_type")]
Expand Down
10 changes: 10 additions & 0 deletions src/GitHub/Models/BranchRestrictionPolicy_apps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ public class BranchRestrictionPolicy_apps : 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 client_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? ClientId { get; set; }
#nullable restore
#else
public string ClientId { get; set; }
#endif
/// <summary>The created_at property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
Expand Down Expand Up @@ -126,6 +134,7 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{
return new Dictionary<string, Action<IParseNode>>
{
{"client_id", n => { ClientId = n.GetStringValue(); } },
{"created_at", n => { CreatedAt = n.GetStringValue(); } },
{"description", n => { Description = n.GetStringValue(); } },
{"events", n => { Events = n.GetCollectionOfPrimitiveValues<string>()?.ToList(); } },
Expand All @@ -147,6 +156,7 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
public virtual void Serialize(ISerializationWriter writer)
{
_ = writer ?? throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("client_id", ClientId);
writer.WriteStringValue("created_at", CreatedAt);
writer.WriteStringValue("description", Description);
writer.WriteCollectionOfPrimitiveValues<string>("events", Events);
Expand Down
2 changes: 1 addition & 1 deletion src/GitHub/Models/OrganizationSecretScanningAlert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public class OrganizationSecretScanningAlert : IAdditionalDataHolder, IParsable
#else
public string SecretType { get; set; }
#endif
/// <summary>User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see &quot;[Secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security).&quot;</summary>
/// <summary>User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see &quot;[Supported secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets).&quot;</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? SecretTypeDisplayName { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/GitHub/Models/SecretScanningAlert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class SecretScanningAlert : IAdditionalDataHolder, IParsable
#else
public string SecretType { get; set; }
#endif
/// <summary>User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see &quot;[Secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security).&quot;</summary>
/// <summary>User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see &quot;[Supported secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets).&quot;</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? SecretTypeDisplayName { get; set; }
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 @@ -129,7 +129,7 @@ public class AlertsRequestBuilderGetQueryParameters
[QueryParameter("resolution")]
public string Resolution { get; set; }
#endif
/// <summary>A comma-separated list of secret types to return. By default all secret types are returned.See &quot;[Secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)&quot;for a complete list of secret types.</summary>
/// <summary>A comma-separated list of secret types to return. By default all secret types are returned.See &quot;[Supported secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)&quot;for a complete list of secret types.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
[QueryParameter("secret_type")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public class AlertsRequestBuilderGetQueryParameters
[QueryParameter("resolution")]
public string Resolution { get; set; }
#endif
/// <summary>A comma-separated list of secret types to return. By default all secret types are returned.See &quot;[Secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security)&quot;for a complete list of secret types.</summary>
/// <summary>A comma-separated list of secret types to return. By default all secret types are returned.See &quot;[Supported secret scanning patterns](https://docs.github.com/[email protected]/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)&quot;for a complete list of secret types.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
[QueryParameter("secret_type")]
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": "7A1A56113B7CD6BAECE551AA2899C89F63DF4B382A1BE3B559BE575E4B270523A48A30AF096D2D1A9CCA014DD10863E754DC78084B48DEB85ACC6404333A22FF",
"descriptionHash": "F43CDC6F6D77A361F42CD6F96DA23A7F84F462A11BCE7232285B730F8595E4F8A776593F7FBDABDAE8F908288A9ABB0ED80ACCD34B7781224C0029FF3FE92354",
"descriptionLocation": "../../../../../schemas/ghes-3.13.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.14.0",
Expand Down

0 comments on commit 849eaa9

Please sign in to comment.