Skip to content

Commit

Permalink
New updates to generated code (#59)
Browse files Browse the repository at this point in the history
Co-authored-by: Octokit Bot <octokitbot@martynus.net>
  • Loading branch information
octokitbot and Octokit Bot committed Apr 15, 2024
1 parent 0964075 commit 52628a5
Show file tree
Hide file tree
Showing 79 changed files with 213 additions and 85 deletions.
2 changes: 1 addition & 1 deletion src/GitHub/Gists/GistsRequestBuilder.cs
Expand Up @@ -145,7 +145,7 @@ public RequestInformation ToPostRequestInformation(GistsPostRequestBody body, Ac
{
#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.POST, "{+baseurl}/gists", PathParameters);
var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.Headers.TryAdd("Accept", "application/json");
requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
Expand Down
2 changes: 1 addition & 1 deletion src/GitHub/Gists/Item/Comments/CommentsRequestBuilder.cs
Expand Up @@ -133,7 +133,7 @@ public RequestInformation ToPostRequestInformation(CommentsPostRequestBody body,
{
#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.POST, "{+baseurl}/gists/{gist_id}/comments", PathParameters);
var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.Headers.TryAdd("Accept", "application/json");
requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
Expand Down
2 changes: 1 addition & 1 deletion src/GitHub/Gists/Item/Forks/ForksRequestBuilder.cs
Expand Up @@ -112,7 +112,7 @@ public RequestInformation ToPostRequestInformation(Action<RequestConfiguration<D
public RequestInformation ToPostRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default)
{
#endif
var requestInfo = new RequestInformation(Method.POST, "{+baseurl}/gists/{gist_id}/forks", PathParameters);
var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.Headers.TryAdd("Accept", "application/json");
return requestInfo;
Expand Down
72 changes: 72 additions & 0 deletions src/GitHub/Models/PullRequestWebhook.cs
@@ -0,0 +1,72 @@
// <auto-generated/>
using Microsoft.Kiota.Abstractions.Serialization;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System;
namespace GitHub.Models {
public class PullRequestWebhook : PullRequest, IParsable
{
/// <summary>Whether to allow auto-merge for pull requests.</summary>
public bool? AllowAutoMerge { get; set; }
/// <summary>Whether to allow updating the pull request&apos;s branch.</summary>
public bool? AllowUpdateBranch { get; set; }
/// <summary>Whether to delete head branches when pull requests are merged.</summary>
public bool? DeleteBranchOnMerge { get; set; }
/// <summary>The default value for a merge commit message.- `PR_TITLE` - default to the pull request&apos;s title.- `PR_BODY` - default to the pull request&apos;s body.- `BLANK` - default to a blank commit message.</summary>
public PullRequestWebhook_merge_commit_message? MergeCommitMessage { get; set; }
/// <summary>The default value for a merge commit title.- `PR_TITLE` - default to the pull request&apos;s title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., &quot;Merge pull request #123 from branch-name&quot;).</summary>
public PullRequestWebhook_merge_commit_title? MergeCommitTitle { get; set; }
/// <summary>The default value for a squash merge commit message:- `PR_BODY` - default to the pull request&apos;s body.- `COMMIT_MESSAGES` - default to the branch&apos;s commit messages.- `BLANK` - default to a blank commit message.</summary>
public PullRequestWebhook_squash_merge_commit_message? SquashMergeCommitMessage { get; set; }
/// <summary>The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request&apos;s title.- `COMMIT_OR_PR_TITLE` - default to the commit&apos;s title (if only one commit) or the pull request&apos;s title (when more than one commit).</summary>
public PullRequestWebhook_squash_merge_commit_title? SquashMergeCommitTitle { get; set; }
/// <summary>Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead.**</summary>
public bool? UseSquashPrTitleAsDefault { get; set; }
/// <summary>
/// Creates a new instance of the appropriate class based on discriminator value
/// </summary>
/// <returns>A <see cref="PullRequestWebhook"/></returns>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static new PullRequestWebhook CreateFromDiscriminatorValue(IParseNode parseNode)
{
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
return new PullRequestWebhook();
}
/// <summary>
/// The deserialization information for the current model
/// </summary>
/// <returns>A IDictionary&lt;string, Action&lt;IParseNode&gt;&gt;</returns>
public override IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{
return new Dictionary<string, Action<IParseNode>>(base.GetFieldDeserializers())
{
{"allow_auto_merge", n => { AllowAutoMerge = n.GetBoolValue(); } },
{"allow_update_branch", n => { AllowUpdateBranch = n.GetBoolValue(); } },
{"delete_branch_on_merge", n => { DeleteBranchOnMerge = n.GetBoolValue(); } },
{"merge_commit_message", n => { MergeCommitMessage = n.GetEnumValue<PullRequestWebhook_merge_commit_message>(); } },
{"merge_commit_title", n => { MergeCommitTitle = n.GetEnumValue<PullRequestWebhook_merge_commit_title>(); } },
{"squash_merge_commit_message", n => { SquashMergeCommitMessage = n.GetEnumValue<PullRequestWebhook_squash_merge_commit_message>(); } },
{"squash_merge_commit_title", n => { SquashMergeCommitTitle = n.GetEnumValue<PullRequestWebhook_squash_merge_commit_title>(); } },
{"use_squash_pr_title_as_default", n => { UseSquashPrTitleAsDefault = n.GetBoolValue(); } },
};
}
/// <summary>
/// Serializes information the current object
/// </summary>
/// <param name="writer">Serialization writer to use to serialize this model</param>
public override void Serialize(ISerializationWriter writer)
{
_ = writer ?? throw new ArgumentNullException(nameof(writer));
base.Serialize(writer);
writer.WriteBoolValue("allow_auto_merge", AllowAutoMerge);
writer.WriteBoolValue("allow_update_branch", AllowUpdateBranch);
writer.WriteBoolValue("delete_branch_on_merge", DeleteBranchOnMerge);
writer.WriteEnumValue<PullRequestWebhook_merge_commit_message>("merge_commit_message", MergeCommitMessage);
writer.WriteEnumValue<PullRequestWebhook_merge_commit_title>("merge_commit_title", MergeCommitTitle);
writer.WriteEnumValue<PullRequestWebhook_squash_merge_commit_message>("squash_merge_commit_message", SquashMergeCommitMessage);
writer.WriteEnumValue<PullRequestWebhook_squash_merge_commit_title>("squash_merge_commit_title", SquashMergeCommitTitle);
writer.WriteBoolValue("use_squash_pr_title_as_default", UseSquashPrTitleAsDefault);
}
}
}
15 changes: 15 additions & 0 deletions src/GitHub/Models/PullRequestWebhook_merge_commit_message.cs
@@ -0,0 +1,15 @@
// <auto-generated/>
using System.Runtime.Serialization;
using System;
namespace GitHub.Models {
/// <summary>The default value for a merge commit message.- `PR_TITLE` - default to the pull request&apos;s title.- `PR_BODY` - default to the pull request&apos;s body.- `BLANK` - default to a blank commit message.</summary>
public enum PullRequestWebhook_merge_commit_message
{
[EnumMember(Value = "PR_BODY")]
PR_BODY,
[EnumMember(Value = "PR_TITLE")]
PR_TITLE,
[EnumMember(Value = "BLANK")]
BLANK,
}
}
13 changes: 13 additions & 0 deletions src/GitHub/Models/PullRequestWebhook_merge_commit_title.cs
@@ -0,0 +1,13 @@
// <auto-generated/>
using System.Runtime.Serialization;
using System;
namespace GitHub.Models {
/// <summary>The default value for a merge commit title.- `PR_TITLE` - default to the pull request&apos;s title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., &quot;Merge pull request #123 from branch-name&quot;).</summary>
public enum PullRequestWebhook_merge_commit_title
{
[EnumMember(Value = "PR_TITLE")]
PR_TITLE,
[EnumMember(Value = "MERGE_MESSAGE")]
MERGE_MESSAGE,
}
}
@@ -0,0 +1,15 @@
// <auto-generated/>
using System.Runtime.Serialization;
using System;
namespace GitHub.Models {
/// <summary>The default value for a squash merge commit message:- `PR_BODY` - default to the pull request&apos;s body.- `COMMIT_MESSAGES` - default to the branch&apos;s commit messages.- `BLANK` - default to a blank commit message.</summary>
public enum PullRequestWebhook_squash_merge_commit_message
{
[EnumMember(Value = "PR_BODY")]
PR_BODY,
[EnumMember(Value = "COMMIT_MESSAGES")]
COMMIT_MESSAGES,
[EnumMember(Value = "BLANK")]
BLANK,
}
}
13 changes: 13 additions & 0 deletions src/GitHub/Models/PullRequestWebhook_squash_merge_commit_title.cs
@@ -0,0 +1,13 @@
// <auto-generated/>
using System.Runtime.Serialization;
using System;
namespace GitHub.Models {
/// <summary>The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request&apos;s title.- `COMMIT_OR_PR_TITLE` - default to the commit&apos;s title (if only one commit) or the pull request&apos;s title (when more than one commit).</summary>
public enum PullRequestWebhook_squash_merge_commit_title
{
[EnumMember(Value = "PR_TITLE")]
PR_TITLE,
[EnumMember(Value = "COMMIT_OR_PR_TITLE")]
COMMIT_OR_PR_TITLE,
}
}
2 changes: 1 addition & 1 deletion src/GitHub/Notifications/NotificationsRequestBuilder.cs
Expand Up @@ -128,7 +128,7 @@ public RequestInformation ToPutRequestInformation(NotificationsPutRequestBody bo
{
#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.PUT, "{+baseurl}/notifications", PathParameters);
var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.Headers.TryAdd("Accept", "application/json");
requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
Expand Down
Expand Up @@ -116,7 +116,7 @@ public RequestInformation ToPutRequestInformation(RepositoriesPutRequestBody bod
{
#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.PUT, "{+baseurl}/orgs/{org}/actions/permissions/repositories", PathParameters);
var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
return requestInfo;
Expand Down
Expand Up @@ -116,7 +116,7 @@ public RequestInformation ToPutRequestInformation(RepositoriesPutRequestBody bod
{
#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.PUT, "{+baseurl}/orgs/{org}/actions/secrets/{secret_name}/repositories", PathParameters);
var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
return requestInfo;
Expand Down
Expand Up @@ -116,7 +116,7 @@ public RequestInformation ToPutRequestInformation(RepositoriesPutRequestBody bod
{
#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.PUT, "{+baseurl}/orgs/{org}/actions/variables/{name}/repositories", PathParameters);
var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
return requestInfo;
Expand Down
Expand Up @@ -118,7 +118,7 @@ public RequestInformation ToPostRequestInformation(VariablesPostRequestBody body
{
#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.POST, "{+baseurl}/orgs/{org}/actions/variables", PathParameters);
var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.Headers.TryAdd("Accept", "application/json");
requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
Expand Down
Expand Up @@ -127,7 +127,7 @@ public RequestInformation ToPutRequestInformation(RepositoriesPutRequestBody bod
{
#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.PUT, "{+baseurl}/orgs/{org}/codespaces/secrets/{secret_name}/repositories", PathParameters);
var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.Headers.TryAdd("Accept", "application/json");
requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
Expand Down
Expand Up @@ -116,7 +116,7 @@ public RequestInformation ToPutRequestInformation(RepositoriesPutRequestBody bod
{
#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.PUT, "{+baseurl}/orgs/{org}/dependabot/secrets/{secret_name}/repositories", PathParameters);
var requestInfo = new RequestInformation(Method.PUT, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
return requestInfo;
Expand Down
2 changes: 1 addition & 1 deletion src/GitHub/Orgs/Item/Hooks/HooksRequestBuilder.cs
Expand Up @@ -131,7 +131,7 @@ public RequestInformation ToPostRequestInformation(HooksPostRequestBody body, Ac
{
#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.POST, "{+baseurl}/orgs/{org}/hooks", PathParameters);
var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.Headers.TryAdd("Accept", "application/json");
requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
Expand Down
Expand Up @@ -131,7 +131,7 @@ public RequestInformation ToPostRequestInformation(InvitationsPostRequestBody bo
{
#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.POST, "{+baseurl}/orgs/{org}/invitations", PathParameters);
var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.Headers.TryAdd("Accept", "application/json");
requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
Expand Down
Expand Up @@ -126,7 +126,7 @@ public RequestInformation ToPostRequestInformation(MigrationsPostRequestBody bod
{
#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.POST, "{+baseurl}/orgs/{org}/migrations", PathParameters);
var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.Headers.TryAdd("Accept", "application/json");
requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
Expand Down
Expand Up @@ -141,7 +141,7 @@ public RequestInformation ToPostRequestInformation(PersonalAccessTokenRequestsPo
{
#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.POST, "{+baseurl}/orgs/{org}/personal-access-token-requests", PathParameters);
var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.Headers.TryAdd("Accept", "application/json");
requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
Expand Down
Expand Up @@ -141,7 +141,7 @@ public RequestInformation ToPostRequestInformation(PersonalAccessTokensPostReque
{
#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.POST, "{+baseurl}/orgs/{org}/personal-access-tokens", PathParameters);
var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.Headers.TryAdd("Accept", "application/json");
requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
Expand Down
2 changes: 1 addition & 1 deletion src/GitHub/Orgs/Item/Projects/ProjectsRequestBuilder.cs
Expand Up @@ -124,7 +124,7 @@ public RequestInformation ToPostRequestInformation(ProjectsPostRequestBody body,
{
#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.POST, "{+baseurl}/orgs/{org}/projects", PathParameters);
var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.Headers.TryAdd("Accept", "application/json");
requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
Expand Down
Expand Up @@ -121,7 +121,7 @@ public RequestInformation ToPatchRequestInformation(ValuesPatchRequestBody body,
{
#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.PATCH, "{+baseurl}/orgs/{org}/properties/values", PathParameters);
var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.Headers.TryAdd("Accept", "application/json");
requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
Expand Down
2 changes: 1 addition & 1 deletion src/GitHub/Orgs/Item/Repos/ReposRequestBuilder.cs
Expand Up @@ -113,7 +113,7 @@ public RequestInformation ToPostRequestInformation(ReposPostRequestBody body, Ac
{
#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.POST, "{+baseurl}/orgs/{org}/repos", PathParameters);
var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.Headers.TryAdd("Accept", "application/json");
requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
Expand Down
2 changes: 1 addition & 1 deletion src/GitHub/Orgs/Item/Rulesets/RulesetsRequestBuilder.cs
Expand Up @@ -139,7 +139,7 @@ public RequestInformation ToPostRequestInformation(RulesetsPostRequestBody body,
{
#endif
_ = body ?? throw new ArgumentNullException(nameof(body));
var requestInfo = new RequestInformation(Method.POST, "{+baseurl}/orgs/{org}/rulesets", PathParameters);
var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
requestInfo.Configure(requestConfiguration);
requestInfo.Headers.TryAdd("Accept", "application/json");
requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
Expand Down

0 comments on commit 52628a5

Please sign in to comment.