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: Adds cvss_severities to the SDK #119

Merged
merged 1 commit into from
Sep 17, 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
10 changes: 10 additions & 0 deletions src/GitHub/Models/ApiOverview.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ public partial class ApiOverview : IAdditionalDataHolder, IParsable
#nullable restore
#else
public List<string> Api { get; set; }
#endif
/// <summary>The codespaces property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public List<string>? Codespaces { get; set; }
#nullable restore
#else
public List<string> Codespaces { get; set; }
#endif
/// <summary>The copilot property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
Expand Down Expand Up @@ -165,6 +173,7 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{ "actions", n => { Actions = n.GetCollectionOfPrimitiveValues<string>()?.AsList(); } },
{ "actions_macos", n => { ActionsMacos = n.GetCollectionOfPrimitiveValues<string>()?.AsList(); } },
{ "api", n => { Api = n.GetCollectionOfPrimitiveValues<string>()?.AsList(); } },
{ "codespaces", n => { Codespaces = n.GetCollectionOfPrimitiveValues<string>()?.AsList(); } },
{ "copilot", n => { Copilot = n.GetCollectionOfPrimitiveValues<string>()?.AsList(); } },
{ "dependabot", n => { Dependabot = n.GetCollectionOfPrimitiveValues<string>()?.AsList(); } },
{ "domains", n => { Domains = n.GetObjectValue<global::GitHub.Models.ApiOverview_domains>(global::GitHub.Models.ApiOverview_domains.CreateFromDiscriminatorValue); } },
Expand All @@ -190,6 +199,7 @@ public virtual void Serialize(ISerializationWriter writer)
writer.WriteCollectionOfPrimitiveValues<string>("actions", Actions);
writer.WriteCollectionOfPrimitiveValues<string>("actions_macos", ActionsMacos);
writer.WriteCollectionOfPrimitiveValues<string>("api", Api);
writer.WriteCollectionOfPrimitiveValues<string>("codespaces", Codespaces);
writer.WriteCollectionOfPrimitiveValues<string>("copilot", Copilot);
writer.WriteCollectionOfPrimitiveValues<string>("dependabot", Dependabot);
writer.WriteObjectValue<global::GitHub.Models.ApiOverview_domains>("domains", Domains);
Expand Down
75 changes: 75 additions & 0 deletions src/GitHub/Models/CvssSeverities.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.18.0")]
#pragma warning disable CS1591
public partial class CvssSeverities : 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 cvss_v3 property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::GitHub.Models.CvssSeverities_cvss_v3? CvssV3 { get; set; }
#nullable restore
#else
public global::GitHub.Models.CvssSeverities_cvss_v3 CvssV3 { get; set; }
#endif
/// <summary>The cvss_v4 property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::GitHub.Models.CvssSeverities_cvss_v4? CvssV4 { get; set; }
#nullable restore
#else
public global::GitHub.Models.CvssSeverities_cvss_v4 CvssV4 { get; set; }
#endif
/// <summary>
/// Instantiates a new <see cref="global::GitHub.Models.CvssSeverities"/> and sets the default values.
/// </summary>
public CvssSeverities()
{
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.CvssSeverities"/></returns>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static global::GitHub.Models.CvssSeverities CreateFromDiscriminatorValue(IParseNode parseNode)
{
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
return new global::GitHub.Models.CvssSeverities();
}
/// <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>>
{
{ "cvss_v3", n => { CvssV3 = n.GetObjectValue<global::GitHub.Models.CvssSeverities_cvss_v3>(global::GitHub.Models.CvssSeverities_cvss_v3.CreateFromDiscriminatorValue); } },
{ "cvss_v4", n => { CvssV4 = n.GetObjectValue<global::GitHub.Models.CvssSeverities_cvss_v4>(global::GitHub.Models.CvssSeverities_cvss_v4.CreateFromDiscriminatorValue); } },
};
}
/// <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.WriteObjectValue<global::GitHub.Models.CvssSeverities_cvss_v3>("cvss_v3", CvssV3);
writer.WriteObjectValue<global::GitHub.Models.CvssSeverities_cvss_v4>("cvss_v4", CvssV4);
writer.WriteAdditionalData(AdditionalData);
}
}
}
#pragma warning restore CS0618
68 changes: 68 additions & 0 deletions src/GitHub/Models/CvssSeverities_cvss_v3.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// <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.18.0")]
#pragma warning disable CS1591
public partial class CvssSeverities_cvss_v3 : 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 CVSS 3 score.</summary>
public double? Score { get; private set; }
/// <summary>The CVSS 3 vector string.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? VectorString { get; set; }
#nullable restore
#else
public string VectorString { get; set; }
#endif
/// <summary>
/// Instantiates a new <see cref="global::GitHub.Models.CvssSeverities_cvss_v3"/> and sets the default values.
/// </summary>
public CvssSeverities_cvss_v3()
{
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.CvssSeverities_cvss_v3"/></returns>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static global::GitHub.Models.CvssSeverities_cvss_v3 CreateFromDiscriminatorValue(IParseNode parseNode)
{
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
return new global::GitHub.Models.CvssSeverities_cvss_v3();
}
/// <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>>
{
{ "score", n => { Score = n.GetDoubleValue(); } },
{ "vector_string", n => { VectorString = 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("vector_string", VectorString);
writer.WriteAdditionalData(AdditionalData);
}
}
}
#pragma warning restore CS0618
68 changes: 68 additions & 0 deletions src/GitHub/Models/CvssSeverities_cvss_v4.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// <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.18.0")]
#pragma warning disable CS1591
public partial class CvssSeverities_cvss_v4 : 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 CVSS 4 score.</summary>
public double? Score { get; private set; }
/// <summary>The CVSS 4 vector string.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? VectorString { get; set; }
#nullable restore
#else
public string VectorString { get; set; }
#endif
/// <summary>
/// Instantiates a new <see cref="global::GitHub.Models.CvssSeverities_cvss_v4"/> and sets the default values.
/// </summary>
public CvssSeverities_cvss_v4()
{
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.CvssSeverities_cvss_v4"/></returns>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static global::GitHub.Models.CvssSeverities_cvss_v4 CreateFromDiscriminatorValue(IParseNode parseNode)
{
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
return new global::GitHub.Models.CvssSeverities_cvss_v4();
}
/// <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>>
{
{ "score", n => { Score = n.GetDoubleValue(); } },
{ "vector_string", n => { VectorString = 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("vector_string", VectorString);
writer.WriteAdditionalData(AdditionalData);
}
}
}
#pragma warning restore CS0618
10 changes: 10 additions & 0 deletions src/GitHub/Models/DependabotAlertSecurityAdvisory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ public partial class DependabotAlertSecurityAdvisory : IParsable
#nullable restore
#else
public global::GitHub.Models.DependabotAlertSecurityAdvisory_cvss Cvss { get; private set; }
#endif
/// <summary>The cvss_severities property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::GitHub.Models.CvssSeverities? CvssSeverities { get; set; }
#nullable restore
#else
public global::GitHub.Models.CvssSeverities CvssSeverities { get; set; }
#endif
/// <summary>Details for the advisory pertaining to Common Weakness Enumeration.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
Expand Down Expand Up @@ -113,6 +121,7 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{
{ "cve_id", n => { CveId = n.GetStringValue(); } },
{ "cvss", n => { Cvss = n.GetObjectValue<global::GitHub.Models.DependabotAlertSecurityAdvisory_cvss>(global::GitHub.Models.DependabotAlertSecurityAdvisory_cvss.CreateFromDiscriminatorValue); } },
{ "cvss_severities", n => { CvssSeverities = n.GetObjectValue<global::GitHub.Models.CvssSeverities>(global::GitHub.Models.CvssSeverities.CreateFromDiscriminatorValue); } },
{ "cwes", n => { Cwes = n.GetCollectionOfObjectValues<global::GitHub.Models.DependabotAlertSecurityAdvisory_cwes>(global::GitHub.Models.DependabotAlertSecurityAdvisory_cwes.CreateFromDiscriminatorValue)?.AsList(); } },
{ "description", n => { Description = n.GetStringValue(); } },
{ "ghsa_id", n => { GhsaId = n.GetStringValue(); } },
Expand All @@ -133,6 +142,7 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
public virtual void Serialize(ISerializationWriter writer)
{
_ = writer ?? throw new ArgumentNullException(nameof(writer));
writer.WriteObjectValue<global::GitHub.Models.CvssSeverities>("cvss_severities", CvssSeverities);
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/GitHub/Models/GlobalAdvisory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ public partial class GlobalAdvisory : IParsable
#nullable restore
#else
public global::GitHub.Models.GlobalAdvisory_cvss Cvss { get; set; }
#endif
/// <summary>The cvss_severities property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::GitHub.Models.CvssSeverities? CvssSeverities { get; set; }
#nullable restore
#else
public global::GitHub.Models.CvssSeverities CvssSeverities { get; set; }
#endif
/// <summary>The cwes property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
Expand Down Expand Up @@ -168,6 +176,7 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{ "credits", n => { Credits = n.GetCollectionOfObjectValues<global::GitHub.Models.GlobalAdvisory_credits>(global::GitHub.Models.GlobalAdvisory_credits.CreateFromDiscriminatorValue)?.AsList(); } },
{ "cve_id", n => { CveId = n.GetStringValue(); } },
{ "cvss", n => { Cvss = n.GetObjectValue<global::GitHub.Models.GlobalAdvisory_cvss>(global::GitHub.Models.GlobalAdvisory_cvss.CreateFromDiscriminatorValue); } },
{ "cvss_severities", n => { CvssSeverities = n.GetObjectValue<global::GitHub.Models.CvssSeverities>(global::GitHub.Models.CvssSeverities.CreateFromDiscriminatorValue); } },
{ "cwes", n => { Cwes = n.GetCollectionOfObjectValues<global::GitHub.Models.GlobalAdvisory_cwes>(global::GitHub.Models.GlobalAdvisory_cwes.CreateFromDiscriminatorValue)?.AsList(); } },
{ "description", n => { Description = n.GetStringValue(); } },
{ "epss", n => { Epss = n.GetObjectValue<global::GitHub.Models.GlobalAdvisory_epss>(global::GitHub.Models.GlobalAdvisory_epss.CreateFromDiscriminatorValue); } },
Expand Down Expand Up @@ -197,6 +206,7 @@ public virtual void Serialize(ISerializationWriter writer)
{
_ = writer ?? throw new ArgumentNullException(nameof(writer));
writer.WriteObjectValue<global::GitHub.Models.GlobalAdvisory_cvss>("cvss", Cvss);
writer.WriteObjectValue<global::GitHub.Models.CvssSeverities>("cvss_severities", CvssSeverities);
writer.WriteCollectionOfObjectValues<global::GitHub.Models.GlobalAdvisory_cwes>("cwes", Cwes);
writer.WriteStringValue("description", Description);
writer.WriteObjectValue<global::GitHub.Models.GlobalAdvisory_epss>("epss", Epss);
Expand Down
10 changes: 10 additions & 0 deletions src/GitHub/Models/RepositoryAdvisory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ public partial class RepositoryAdvisory : IParsable
#nullable restore
#else
public global::GitHub.Models.RepositoryAdvisory_cvss Cvss { get; set; }
#endif
/// <summary>The cvss_severities property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::GitHub.Models.CvssSeverities? CvssSeverities { get; set; }
#nullable restore
#else
public global::GitHub.Models.CvssSeverities CvssSeverities { get; set; }
#endif
/// <summary>A list of only the CWE IDs.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
Expand Down Expand Up @@ -206,6 +214,7 @@ public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{ "credits_detailed", n => { CreditsDetailed = n.GetCollectionOfObjectValues<global::GitHub.Models.RepositoryAdvisoryCredit>(global::GitHub.Models.RepositoryAdvisoryCredit.CreateFromDiscriminatorValue)?.AsList(); } },
{ "cve_id", n => { CveId = n.GetStringValue(); } },
{ "cvss", n => { Cvss = n.GetObjectValue<global::GitHub.Models.RepositoryAdvisory_cvss>(global::GitHub.Models.RepositoryAdvisory_cvss.CreateFromDiscriminatorValue); } },
{ "cvss_severities", n => { CvssSeverities = n.GetObjectValue<global::GitHub.Models.CvssSeverities>(global::GitHub.Models.CvssSeverities.CreateFromDiscriminatorValue); } },
{ "cwe_ids", n => { CweIds = n.GetCollectionOfPrimitiveValues<string>()?.AsList(); } },
{ "cwes", n => { Cwes = n.GetCollectionOfObjectValues<global::GitHub.Models.RepositoryAdvisory_cwes>(global::GitHub.Models.RepositoryAdvisory_cwes.CreateFromDiscriminatorValue)?.AsList(); } },
{ "description", n => { Description = n.GetStringValue(); } },
Expand Down Expand Up @@ -237,6 +246,7 @@ public virtual void Serialize(ISerializationWriter writer)
writer.WriteCollectionOfObjectValues<global::GitHub.Models.RepositoryAdvisory_credits>("credits", Credits);
writer.WriteStringValue("cve_id", CveId);
writer.WriteObjectValue<global::GitHub.Models.RepositoryAdvisory_cvss>("cvss", Cvss);
writer.WriteObjectValue<global::GitHub.Models.CvssSeverities>("cvss_severities", CvssSeverities);
writer.WriteCollectionOfPrimitiveValues<string>("cwe_ids", CweIds);
writer.WriteStringValue("description", Description);
writer.WriteEnumValue<global::GitHub.Models.RepositoryAdvisory_severity>("severity", Severity);
Expand Down
Loading
Loading