diff --git a/src/GitHub/Repos/Item/Item/PrivateVulnerabilityReporting/PrivateVulnerabilityReportingGetResponse.cs b/src/GitHub/Repos/Item/Item/PrivateVulnerabilityReporting/PrivateVulnerabilityReportingGetResponse.cs new file mode 100644 index 00000000..882288ce --- /dev/null +++ b/src/GitHub/Repos/Item/Item/PrivateVulnerabilityReporting/PrivateVulnerabilityReportingGetResponse.cs @@ -0,0 +1,47 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace GitHub.Repos.Item.Item.PrivateVulnerabilityReporting { + public class PrivateVulnerabilityReportingGetResponse : 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 or not private vulnerability reporting is enabled for the repository. + public bool? Enabled { get; set; } + /// + /// Instantiates a new and sets the default values. + /// + public PrivateVulnerabilityReportingGetResponse() { + 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 PrivateVulnerabilityReportingGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PrivateVulnerabilityReportingGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"enabled", n => { Enabled = n.GetBoolValue(); } }, + }; + } + /// + /// 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.WriteBoolValue("enabled", Enabled); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/GitHub/Repos/Item/Item/PrivateVulnerabilityReporting/PrivateVulnerabilityReportingRequestBuilder.cs b/src/GitHub/Repos/Item/Item/PrivateVulnerabilityReporting/PrivateVulnerabilityReportingRequestBuilder.cs index 7be3bab1..cdeda6d2 100644 --- a/src/GitHub/Repos/Item/Item/PrivateVulnerabilityReporting/PrivateVulnerabilityReportingRequestBuilder.cs +++ b/src/GitHub/Repos/Item/Item/PrivateVulnerabilityReporting/PrivateVulnerabilityReportingRequestBuilder.cs @@ -48,6 +48,27 @@ public class PrivateVulnerabilityReportingRequestBuilder : BaseRequestBuilder { await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// + /// Returns a boolean indicating whether or not private vulnerability reporting is enabled for the repository. For more information, see "[Evaluating the security settings of a repository](https://docs.github.com/code-security/security-advisories/working-with-repository-security-advisories/evaluating-the-security-settings-of-a-repository)". + /// API method documentation + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 422 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"422", BasicError.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, PrivateVulnerabilityReportingGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// /// Enables private vulnerability reporting for a repository. The authenticated user must have admin access to the repository. For more information, see "[Privately reporting a security vulnerability](https://docs.github.com/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability)." /// API method documentation /// @@ -85,6 +106,23 @@ public class PrivateVulnerabilityReportingRequestBuilder : BaseRequestBuilder { return requestInfo; } /// + /// Returns a boolean indicating whether or not private vulnerability reporting is enabled for the repository. For more information, see "[Evaluating the security settings of a repository](https://docs.github.com/code-security/security-advisories/working-with-repository-security-advisories/evaluating-the-security-settings-of-a-repository)". + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// /// Enables private vulnerability reporting for a repository. The authenticated user must have admin access to the repository. For more information, see "[Privately reporting a security vulnerability](https://docs.github.com/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability)." /// /// A diff --git a/src/GitHub/kiota-lock.json b/src/GitHub/kiota-lock.json index 189505bb..c2c9f041 100644 --- a/src/GitHub/kiota-lock.json +++ b/src/GitHub/kiota-lock.json @@ -1,8 +1,8 @@ { - "descriptionHash": "728430A700C1A6B37AA3A767B0FDF1A6C56A311E37615AFFFF2E17557A73D3F2F98242BE97554E6D7667A9E748060FC914162082ADE8B04924A1DB371FC1F8B9", + "descriptionHash": "DE060A6CF9EFEE14358028B28C66A421969687F96C8EBF96933E452D3043303AB97B244EA2E3B9800382F90BBFF2A8EBB158D61A852738284C655FD2A387E3C8", "descriptionLocation": "../../../source-generator/schemas/downloaded.json", "lockFileVersion": "1.0.0", - "kiotaVersion": "1.12.0-preview.202403040006", + "kiotaVersion": "1.12.0", "clientClassName": "GitHubClient", "clientNamespaceName": "GitHub", "language": "CSharp",