Skip to content

Commit

Permalink
FEAT:| Added/Updated [GitHub, class, IDictionary, string, double, Sec…
Browse files Browse the repository at this point in the history
…retScanningLocationWikiCommit, static, virtual] (#54)

* New updates to generated code

* New updates to generated code

* New updates to generated code

* New updates to generated code

---------

Co-authored-by: Octokit Bot <octokitbot@martynus.net>
  • Loading branch information
octokitbot and Octokit Bot committed Mar 22, 2024
1 parent 78f734f commit 4b2d48d
Show file tree
Hide file tree
Showing 13 changed files with 164 additions and 24 deletions.
1 change: 1 addition & 0 deletions src/GitHub/Models/Root.cs
Expand Up @@ -113,6 +113,7 @@ public class Root : IAdditionalDataHolder, IParsable {
public string GistsUrl { get; set; }
#endif
/// <summary>The hub_url property</summary>
[Obsolete("")]
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? HubUrl { get; set; }
Expand Down
19 changes: 18 additions & 1 deletion src/GitHub/Models/SecretScanningLocation.cs
Expand Up @@ -54,7 +54,7 @@ public class SecretScanningLocation : IAdditionalDataHolder, IParsable {
writer.WriteAdditionalData(AdditionalData);
}
/// <summary>
/// Composed type wrapper for classes <see cref="SecretScanningLocationCommit"/>, <see cref="SecretScanningLocationDiscussionBody"/>, <see cref="SecretScanningLocationDiscussionComment"/>, <see cref="SecretScanningLocationDiscussionTitle"/>, <see cref="SecretScanningLocationIssueBody"/>, <see cref="SecretScanningLocationIssueComment"/>, <see cref="SecretScanningLocationIssueTitle"/>, <see cref="SecretScanningLocationPullRequestBody"/>, <see cref="SecretScanningLocationPullRequestComment"/>, <see cref="SecretScanningLocationPullRequestReview"/>, <see cref="SecretScanningLocationPullRequestReviewComment"/>, <see cref="SecretScanningLocationPullRequestTitle"/>
/// Composed type wrapper for classes <see cref="SecretScanningLocationCommit"/>, <see cref="SecretScanningLocationDiscussionBody"/>, <see cref="SecretScanningLocationDiscussionComment"/>, <see cref="SecretScanningLocationDiscussionTitle"/>, <see cref="SecretScanningLocationIssueBody"/>, <see cref="SecretScanningLocationIssueComment"/>, <see cref="SecretScanningLocationIssueTitle"/>, <see cref="SecretScanningLocationPullRequestBody"/>, <see cref="SecretScanningLocationPullRequestComment"/>, <see cref="SecretScanningLocationPullRequestReview"/>, <see cref="SecretScanningLocationPullRequestReviewComment"/>, <see cref="SecretScanningLocationPullRequestTitle"/>, <see cref="SecretScanningLocationWikiCommit"/>
/// </summary>
public class SecretScanningLocation_details : IComposedTypeWrapper, IParsable {
/// <summary>Composed type representation for type <see cref="GitHub.Models.SecretScanningLocationCommit"/></summary>
Expand Down Expand Up @@ -152,6 +152,14 @@ public class SecretScanningLocation_details : IComposedTypeWrapper, IParsable {
#nullable restore
#else
public GitHub.Models.SecretScanningLocationPullRequestTitle SecretScanningLocationPullRequestTitle { get; set; }
#endif
/// <summary>Composed type representation for type <see cref="GitHub.Models.SecretScanningLocationWikiCommit"/></summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public GitHub.Models.SecretScanningLocationWikiCommit? SecretScanningLocationWikiCommit { get; set; }
#nullable restore
#else
public GitHub.Models.SecretScanningLocationWikiCommit SecretScanningLocationWikiCommit { get; set; }
#endif
/// <summary>
/// Creates a new instance of the appropriate class based on discriminator value
Expand Down Expand Up @@ -198,6 +206,9 @@ public class SecretScanningLocation_details : IComposedTypeWrapper, IParsable {
else if("secret-scanning-location-pull-request-title".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) {
result.SecretScanningLocationPullRequestTitle = new GitHub.Models.SecretScanningLocationPullRequestTitle();
}
else if("secret-scanning-location-wiki-commit".Equals(mappingValue, StringComparison.OrdinalIgnoreCase)) {
result.SecretScanningLocationWikiCommit = new GitHub.Models.SecretScanningLocationWikiCommit();
}
return result;
}
/// <summary>
Expand Down Expand Up @@ -241,6 +252,9 @@ public class SecretScanningLocation_details : IComposedTypeWrapper, IParsable {
else if(SecretScanningLocationPullRequestTitle != null) {
return SecretScanningLocationPullRequestTitle.GetFieldDeserializers();
}
else if(SecretScanningLocationWikiCommit != null) {
return SecretScanningLocationWikiCommit.GetFieldDeserializers();
}
return new Dictionary<string, Action<IParseNode>>();
}
/// <summary>
Expand Down Expand Up @@ -285,6 +299,9 @@ public class SecretScanningLocation_details : IComposedTypeWrapper, IParsable {
else if(SecretScanningLocationPullRequestTitle != null) {
writer.WriteObjectValue<GitHub.Models.SecretScanningLocationPullRequestTitle>(null, SecretScanningLocationPullRequestTitle);
}
else if(SecretScanningLocationWikiCommit != null) {
writer.WriteObjectValue<GitHub.Models.SecretScanningLocationWikiCommit>(null, SecretScanningLocationWikiCommit);
}
}
}
}
Expand Down
112 changes: 112 additions & 0 deletions src/GitHub/Models/SecretScanningLocationWikiCommit.cs
@@ -0,0 +1,112 @@
// <auto-generated/>
using Microsoft.Kiota.Abstractions.Serialization;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System;
namespace GitHub.Models {
/// <summary>
/// Represents a &apos;wiki_commit&apos; secret scanning location type. This location type shows that a secret was detected inside a commit to a repository wiki.
/// </summary>
public class SecretScanningLocationWikiCommit : 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>SHA-1 hash ID of the associated blob</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? BlobSha { get; set; }
#nullable restore
#else
public string BlobSha { get; set; }
#endif
/// <summary>SHA-1 hash ID of the associated commit</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? CommitSha { get; set; }
#nullable restore
#else
public string CommitSha { get; set; }
#endif
/// <summary>The GitHub URL to get the associated wiki commit</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? CommitUrl { get; set; }
#nullable restore
#else
public string CommitUrl { get; set; }
#endif
/// <summary>The column at which the secret ends within the end line when the file is interpreted as 8-bit ASCII.</summary>
public double? EndColumn { get; set; }
/// <summary>Line number at which the secret ends in the file</summary>
public double? EndLine { get; set; }
/// <summary>The GitHub URL to get the associated wiki page</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? PageUrl { get; set; }
#nullable restore
#else
public string PageUrl { get; set; }
#endif
/// <summary>The file path of the wiki page</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Path { get; set; }
#nullable restore
#else
public string Path { get; set; }
#endif
/// <summary>The column at which the secret starts within the start line when the file is interpreted as 8-bit ASCII.</summary>
public double? StartColumn { get; set; }
/// <summary>Line number at which the secret starts in the file</summary>
public double? StartLine { get; set; }
/// <summary>
/// Instantiates a new <see cref="SecretScanningLocationWikiCommit"/> and sets the default values.
/// </summary>
public SecretScanningLocationWikiCommit() {
AdditionalData = new Dictionary<string, object>();
}
/// <summary>
/// Creates a new instance of the appropriate class based on discriminator value
/// </summary>
/// <returns>A <see cref="SecretScanningLocationWikiCommit"/></returns>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static SecretScanningLocationWikiCommit CreateFromDiscriminatorValue(IParseNode parseNode) {
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
return new SecretScanningLocationWikiCommit();
}
/// <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>> {
{"blob_sha", n => { BlobSha = n.GetStringValue(); } },
{"commit_sha", n => { CommitSha = n.GetStringValue(); } },
{"commit_url", n => { CommitUrl = n.GetStringValue(); } },
{"end_column", n => { EndColumn = n.GetDoubleValue(); } },
{"end_line", n => { EndLine = n.GetDoubleValue(); } },
{"page_url", n => { PageUrl = n.GetStringValue(); } },
{"path", n => { Path = n.GetStringValue(); } },
{"start_column", n => { StartColumn = n.GetDoubleValue(); } },
{"start_line", n => { StartLine = n.GetDoubleValue(); } },
};
}
/// <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("blob_sha", BlobSha);
writer.WriteStringValue("commit_sha", CommitSha);
writer.WriteStringValue("commit_url", CommitUrl);
writer.WriteDoubleValue("end_column", EndColumn);
writer.WriteDoubleValue("end_line", EndLine);
writer.WriteStringValue("page_url", PageUrl);
writer.WriteStringValue("path", Path);
writer.WriteDoubleValue("start_column", StartColumn);
writer.WriteDoubleValue("start_line", StartLine);
writer.WriteAdditionalData(AdditionalData);
}
}
}
2 changes: 2 additions & 0 deletions src/GitHub/Models/SecretScanningLocation_type.cs
Expand Up @@ -6,6 +6,8 @@ namespace GitHub.Models {
public enum SecretScanningLocation_type {
[EnumMember(Value = "commit")]
Commit,
[EnumMember(Value = "wiki_commit")]
Wiki_commit,
[EnumMember(Value = "issue_title")]
Issue_title,
[EnumMember(Value = "issue_body")]
Expand Down
11 changes: 7 additions & 4 deletions src/GitHub/Orgs/Item/Hooks/HooksRequestBuilder.cs
Expand Up @@ -37,7 +37,7 @@ public class HooksRequestBuilder : BaseRequestBuilder {
public HooksRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/hooks{?page*,per_page*}", rawUrl) {
}
/// <summary>
/// List organization webhooks
/// You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
/// API method documentation <see href="https://docs.github.com/rest/orgs/webhooks#list-organization-webhooks" />
/// </summary>
/// <returns>A List&lt;OrgHook&gt;</returns>
Expand All @@ -59,7 +59,7 @@ public class HooksRequestBuilder : BaseRequestBuilder {
return collectionResult?.ToList();
}
/// <summary>
/// Here&apos;s how you can create a hook that posts payloads in JSON format:
/// Create a hook that posts payloads in JSON format.You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
/// API method documentation <see href="https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook" />
/// </summary>
/// <returns>A <see cref="OrgHook"/></returns>
Expand All @@ -83,6 +83,9 @@ public class HooksRequestBuilder : BaseRequestBuilder {
};
return await RequestAdapter.SendAsync<OrgHook>(requestInfo, OrgHook.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
/// </summary>
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
Expand All @@ -98,7 +101,7 @@ public class HooksRequestBuilder : BaseRequestBuilder {
return requestInfo;
}
/// <summary>
/// Here&apos;s how you can create a hook that posts payloads in JSON format:
/// Create a hook that posts payloads in JSON format.You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
/// </summary>
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="body">The request body</param>
Expand Down Expand Up @@ -126,7 +129,7 @@ public class HooksRequestBuilder : BaseRequestBuilder {
return new HooksRequestBuilder(rawUrl, RequestAdapter);
}
/// <summary>
/// List organization webhooks
/// You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
/// </summary>
public class HooksRequestBuilderGetQueryParameters {
/// <summary>The page number of the results to fetch. For more information, see &quot;[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).&quot;</summary>
Expand Down
Expand Up @@ -28,7 +28,7 @@ public class ConfigRequestBuilder : BaseRequestBuilder {
public ConfigRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/orgs/{org}/hooks/{hook_id}/config", rawUrl) {
}
/// <summary>
/// Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use &quot;[Get an organization webhook ](/rest/orgs/webhooks#get-an-organization-webhook).&quot;OAuth app tokens and personal access tokens (classic) need the `admin:org_hook` scope to use this endpoint.
/// Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use &quot;[Get an organization webhook ](/rest/orgs/webhooks#get-an-organization-webhook).&quot;You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
/// API method documentation <see href="https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization" />
/// </summary>
/// <returns>A <see cref="WebhookConfig"/></returns>
Expand All @@ -45,7 +45,7 @@ public class ConfigRequestBuilder : BaseRequestBuilder {
return await RequestAdapter.SendAsync<WebhookConfig>(requestInfo, WebhookConfig.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use &quot;[Update an organization webhook ](/rest/orgs/webhooks#update-an-organization-webhook).&quot;OAuth app tokens and personal access tokens (classic) need the `admin:org_hook` scope to use this endpoint.
/// Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use &quot;[Update an organization webhook ](/rest/orgs/webhooks#update-an-organization-webhook).&quot;You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
/// API method documentation <see href="https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization" />
/// </summary>
/// <returns>A <see cref="WebhookConfig"/></returns>
Expand All @@ -64,7 +64,7 @@ public class ConfigRequestBuilder : BaseRequestBuilder {
return await RequestAdapter.SendAsync<WebhookConfig>(requestInfo, WebhookConfig.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use &quot;[Get an organization webhook ](/rest/orgs/webhooks#get-an-organization-webhook).&quot;OAuth app tokens and personal access tokens (classic) need the `admin:org_hook` scope to use this endpoint.
/// Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use &quot;[Get an organization webhook ](/rest/orgs/webhooks#get-an-organization-webhook).&quot;You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
/// </summary>
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
Expand All @@ -81,7 +81,7 @@ public class ConfigRequestBuilder : BaseRequestBuilder {
return requestInfo;
}
/// <summary>
/// Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use &quot;[Update an organization webhook ](/rest/orgs/webhooks#update-an-organization-webhook).&quot;OAuth app tokens and personal access tokens (classic) need the `admin:org_hook` scope to use this endpoint.
/// Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use &quot;[Update an organization webhook ](/rest/orgs/webhooks#update-an-organization-webhook).&quot;You must be an organization owner to use this endpoint. OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
/// </summary>
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="body">The request body</param>
Expand Down

0 comments on commit 4b2d48d

Please sign in to comment.