From 978093803cd30ad0643376f9440f048770b0699d Mon Sep 17 00:00:00 2001 From: Martin Costello Date: Thu, 1 Dec 2022 00:00:45 +0000 Subject: [PATCH] [bug] Fix API URLs for GitHub Enterprise Server (#2626) * Fix API URLs for GHES Fix leading slashes causing API calls to fail when used with GitHub Enterprise. * Fix tests Fix tests that should have been updated in the previous commit. Co-authored-by: Keegan Campbell --- .../Clients/ActionsWorkflowJobsClientTests.cs | 16 ++-- .../Clients/ActionsWorkflowRunsClientTests.cs | 44 ++++----- .../Clients/ActionsWorkflowsClientTests.cs | 24 ++--- .../Clients/PackageVersionsClientTests.cs | 30 +++--- Octokit.Tests/Clients/PackagesClientTests.cs | 30 +++--- ...bservableActionsWorkflowRunsClientTests.cs | 2 +- .../ObservablePackageVersionsTests.cs | 4 +- .../Reactive/ObservablePackagesTests.cs | 12 +-- Octokit/Helpers/ApiUrls.cs | 96 +++++++++---------- 9 files changed, 129 insertions(+), 129 deletions(-) diff --git a/Octokit.Tests/Clients/ActionsWorkflowJobsClientTests.cs b/Octokit.Tests/Clients/ActionsWorkflowJobsClientTests.cs index 1ec99df17b..7819c4aa1a 100644 --- a/Octokit.Tests/Clients/ActionsWorkflowJobsClientTests.cs +++ b/Octokit.Tests/Clients/ActionsWorkflowJobsClientTests.cs @@ -28,7 +28,7 @@ public async Task RequestsCorrectUrl() await client.Rerun("fake", "repo", 123); connection.Received().Post( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/jobs/123/rerun")); + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/jobs/123/rerun")); } [Fact] @@ -63,7 +63,7 @@ public async Task RequestsCorrectUrl() await client.Get("fake", "repo", 123); connection.Received().Get( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/jobs/123")); + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/jobs/123")); } [Fact] @@ -98,7 +98,7 @@ public async Task RequestsCorrectUrl() await client.GetLogs("fake", "repo", 123); connection.Connection.Received().Get( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/jobs/123/logs"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/jobs/123/logs"), null); } @@ -134,14 +134,14 @@ public async Task RequestsCorrectUrl() await client.List("fake", "repo", 123); connection.Received().GetAll( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs/123/jobs"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs/123/jobs"), Args.EmptyDictionary, Args.ApiOptions); await client.List("fake", "repo", 123, 456); connection.Received().GetAll( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs/123/attempts/456/jobs"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs/123/attempts/456/jobs"), null, Args.ApiOptions); } @@ -160,7 +160,7 @@ public async Task RequestsCorrectUrlWithRequest() await client.List("fake", "repo", 123, request); connection.Received().GetAll( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs/123/jobs"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs/123/jobs"), Arg.Is>(x => x.Count == 1 && x["filter"] == "all"), @@ -179,7 +179,7 @@ public async Task RequestsCorrectUrlWithRequestWithApiOptions() await client.List("fake", "repo", 123, request, options); connection.Received().GetAll( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs/123/jobs"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs/123/jobs"), Arg.Is>(x => x.Count == 1 && x["filter"] == "latest"), @@ -188,7 +188,7 @@ public async Task RequestsCorrectUrlWithRequestWithApiOptions() await client.List("fake", "repo", 123, 456, options); connection.Received().GetAll( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs/123/attempts/456/jobs"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs/123/attempts/456/jobs"), null, options); } diff --git a/Octokit.Tests/Clients/ActionsWorkflowRunsClientTests.cs b/Octokit.Tests/Clients/ActionsWorkflowRunsClientTests.cs index 21b159e152..559d59093d 100644 --- a/Octokit.Tests/Clients/ActionsWorkflowRunsClientTests.cs +++ b/Octokit.Tests/Clients/ActionsWorkflowRunsClientTests.cs @@ -30,7 +30,7 @@ public async Task RequestsCorrectUrl() await client.Approve("fake", "repo", 123); connection.Received().Post( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs/123/approve")); + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs/123/approve")); } [Fact] @@ -65,7 +65,7 @@ public async Task RequestsCorrectUrl() await client.Cancel("fake", "repo", 123); connection.Received().Post( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs/123/cancel")); + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs/123/cancel")); } [Fact] @@ -100,7 +100,7 @@ public async Task RequestsCorrectUrl() await client.Delete("fake", "repo", 123); connection.Received().Delete( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs/123")); + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs/123")); } [Fact] @@ -135,7 +135,7 @@ public async Task RequestsCorrectUrl() await client.DeleteLogs("fake", "repo", 123); connection.Received().Delete( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs/123/logs")); + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs/123/logs")); } [Fact] @@ -170,7 +170,7 @@ public async Task RequestsCorrectUrl() await client.Get("fake", "repo", 123); connection.Received().Get( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs/123"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs/123"), null); } @@ -205,7 +205,7 @@ public async Task RequestsCorrectUrl() var responseTask = Task.FromResult>(new ApiResponse(response)); var connection = Substitute.For(); - connection.GetRaw(Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs/123/logs"), null) + connection.GetRaw(Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs/123/logs"), null) .Returns(responseTask); var apiConnection = Substitute.For(); @@ -250,7 +250,7 @@ public async Task RequestsCorrectUrl() await client.GetAttempt("fake", "repo", 123, 456); connection.Received().Get( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs/123/attempts/456"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs/123/attempts/456"), null); } @@ -285,7 +285,7 @@ public async Task RequestsCorrectUrl() var responseTask = Task.FromResult>(new ApiResponse(response)); var connection = Substitute.For(); - connection.GetRaw(Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs/123/attempts/456/logs"), null) + connection.GetRaw(Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs/123/attempts/456/logs"), null) .Returns(responseTask); var apiConnection = Substitute.For(); @@ -330,7 +330,7 @@ public async Task RequestsCorrectUrl() await client.GetReviewHistory("fake", "repo", 123); connection.Received().GetAll( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs/123/approvals")); + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs/123/approvals")); } [Fact] @@ -371,7 +371,7 @@ public async Task RequestsCorrectUrl() await client.GetUsage("fake", "repo", 123); connection.Received().Get( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs/123/timing"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs/123/timing"), null); } @@ -407,7 +407,7 @@ public async Task RequestsCorrectUrl() await client.List("fake", "repo"); connection.Received().GetAll( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs"), Args.EmptyDictionary, Args.ApiOptions); } @@ -432,7 +432,7 @@ public async Task RequestsCorrectUrlWithRequest() await client.List("fake", "repo", request); connection.Received().GetAll( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs"), Arg.Is>(x => x.Count == 7 && x["actor"] == "octocat" @@ -458,7 +458,7 @@ public async Task RequestsCorrectUrlWithRequestWithApiOptions() await client.List("fake", "repo", request, options); connection.Received().GetAll( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs"), Arg.Is>(x => x.Count == 3 && x["branch"] == "main" @@ -520,7 +520,7 @@ public async Task RequestsCorrectUrlWithId() await client.ListByWorkflow("fake", "repo", 123); connection.Received().GetAll( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/workflows/123/runs"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/workflows/123/runs"), Args.EmptyDictionary, Args.ApiOptions); } @@ -534,7 +534,7 @@ public async Task RequestsCorrectUrlWithName() await client.ListByWorkflow("fake", "repo", "main.yml"); connection.Received().GetAll( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/workflows/main.yml/runs"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/workflows/main.yml/runs"), Args.EmptyDictionary, Args.ApiOptions); } @@ -559,7 +559,7 @@ public async Task RequestsCorrectUrlWithIdWithRequest() await client.ListByWorkflow("fake", "repo", 123, request); connection.Received().GetAll( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/workflows/123/runs"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/workflows/123/runs"), Arg.Is>(x => x.Count == 7 && x["actor"] == "octocat" @@ -593,7 +593,7 @@ public async Task RequestsCorrectUrlWithNameWithRequest() await client.ListByWorkflow("fake", "repo", "main.yml", request); connection.Received().GetAll( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/workflows/main.yml/runs"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/workflows/main.yml/runs"), Arg.Is>(x => x.Count == 7 && x["actor"] == "octocat" @@ -619,7 +619,7 @@ public async Task RequestsCorrectUrlWithIdWithRequestWithApiOptions() await client.ListByWorkflow("fake", "repo", 123, request, options); connection.Received().GetAll( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/workflows/123/runs"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/workflows/123/runs"), Arg.Is>(x => x.Count == 3 && x["branch"] == "main" @@ -640,7 +640,7 @@ public async Task RequestsCorrectUrlWithNameWithRequestWithApiOptions() await client.ListByWorkflow("fake", "repo", "main.yml", request, options); connection.Received().GetAll( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/workflows/main.yml/runs"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/workflows/main.yml/runs"), Arg.Is>(x => x.Count == 3 && x["branch"] == "main" @@ -732,7 +732,7 @@ public async Task RequestsCorrectUrl() await client.Rerun("fake", "repo", 123); connection.Received().Post( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs/123/rerun")); + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs/123/rerun")); } [Fact] @@ -769,7 +769,7 @@ public async Task RequestsCorrectUrl() await client.RerunFailedJobs("fake", "repo", 123); connection.Received().Post( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs/123/rerun-failed-jobs")); + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs/123/rerun-failed-jobs")); } [Fact] @@ -806,7 +806,7 @@ public async Task RequestsCorrectUrl() await client.ReviewPendingDeployments("fake", "repo", 123, review); connection.Received().Post( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs/123/pending_deployments"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs/123/pending_deployments"), review); } diff --git a/Octokit.Tests/Clients/ActionsWorkflowsClientTests.cs b/Octokit.Tests/Clients/ActionsWorkflowsClientTests.cs index 155b7e7786..45642f27fe 100644 --- a/Octokit.Tests/Clients/ActionsWorkflowsClientTests.cs +++ b/Octokit.Tests/Clients/ActionsWorkflowsClientTests.cs @@ -42,7 +42,7 @@ public async Task RequestsCorrectUrlByWorkflowId() await client.CreateDispatch("fake", "repo", 123, createDispatch); connection.Received().Post( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/workflows/123/dispatches"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/workflows/123/dispatches"), createDispatch); } @@ -57,7 +57,7 @@ public async Task RequestsCorrectUrlByWorkflowFileName() await client.CreateDispatch("fake", "repo", "main.yaml", createDispatch); connection.Received().Post( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/workflows/main.yaml/dispatches"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/workflows/main.yaml/dispatches"), createDispatch); } @@ -107,7 +107,7 @@ public async Task RequestsCorrectUrlByWorkflowId() await client.Disable("fake", "repo", 123); connection.Received().Put( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/workflows/123/disable")); + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/workflows/123/disable")); } [Fact] @@ -119,7 +119,7 @@ public async Task RequestsCorrectUrlByWorkflowFileName() await client.Disable("fake", "repo", "main.yaml"); connection.Received().Put( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/workflows/main.yaml/disable")); + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/workflows/main.yaml/disable")); } [Fact] @@ -162,7 +162,7 @@ public async Task RequestsCorrectUrlByWorkflowId() await client.Enable("fake", "repo", 123); connection.Received().Put( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/workflows/123/enable")); + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/workflows/123/enable")); } [Fact] @@ -174,7 +174,7 @@ public async Task RequestsCorrectUrlByWorkflowFileName() await client.Enable("fake", "repo", "main.yaml"); connection.Received().Put( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/workflows/main.yaml/enable")); + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/workflows/main.yaml/enable")); } [Fact] @@ -217,7 +217,7 @@ public async Task RequestsCorrectUrlByWorkflowId() await client.Get("fake", "repo", 123); connection.Received().Get( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/workflows/123"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/workflows/123"), null); } @@ -230,7 +230,7 @@ public async Task RequestsCorrectUrlByWorkflowFileName() await client.Get("fake", "repo", "main.yaml"); connection.Received().Get( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/workflows/main.yaml"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/workflows/main.yaml"), null); } @@ -274,7 +274,7 @@ public async Task RequestsCorrectUrlByWorkflowId() await client.GetUsage("fake", "repo", 123); connection.Received().Get( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/workflows/123/timing"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/workflows/123/timing"), null); } @@ -287,7 +287,7 @@ public async Task RequestsCorrectUrlByWorkflowFileName() await client.GetUsage("fake", "repo", "main.yaml"); connection.Received().Get( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/workflows/main.yaml/timing"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/workflows/main.yaml/timing"), null); } @@ -331,7 +331,7 @@ public async Task RequestsCorrectUrl() await client.List("fake", "repo"); connection.Received().GetAll( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/workflows"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/workflows"), null, Args.ApiOptions); } @@ -347,7 +347,7 @@ public async Task RequestsCorrectUrlWithRequestWithApiOptions() await client.List("fake", "repo", options); connection.Received().GetAll( - Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/workflows"), + Arg.Is(u => u.ToString() == "repos/fake/repo/actions/workflows"), null, options); } diff --git a/Octokit.Tests/Clients/PackageVersionsClientTests.cs b/Octokit.Tests/Clients/PackageVersionsClientTests.cs index 2e75aa3325..f0708719ec 100644 --- a/Octokit.Tests/Clients/PackageVersionsClientTests.cs +++ b/Octokit.Tests/Clients/PackageVersionsClientTests.cs @@ -28,7 +28,7 @@ public async Task RequestsCorrectUrl() await client.GetAllForOrg("fake", PackageType.RubyGems, "name"); connection.Received().GetAll(Arg.Is(u => - u.ToString() == "/orgs/fake/packages/rubygems/name/versions"), + u.ToString() == "orgs/fake/packages/rubygems/name/versions"), Arg.Is>(d => d.ContainsKey("state")), Args.ApiOptions); } @@ -43,7 +43,7 @@ public async Task RequestsCorrectUrlWithOptionalParameter() var calls = connection.ReceivedCalls(); connection.Received().GetAll(Arg.Is(u => - u.ToString() == "/orgs/fake/packages/rubygems/name/versions"), + u.ToString() == "orgs/fake/packages/rubygems/name/versions"), Arg.Is>(d => d.ContainsKey("state") && d["state"] == "deleted"), Args.ApiOptions); } @@ -72,7 +72,7 @@ public async Task RequestsCorrectUrl() await client.GetForOrg("fake", PackageType.Npm, "name", 5); - connection.Received().Get(Arg.Is(u => u.ToString() == "/orgs/fake/packages/npm/name/versions/5")); + connection.Received().Get(Arg.Is(u => u.ToString() == "orgs/fake/packages/npm/name/versions/5")); } [Fact] @@ -100,7 +100,7 @@ public async Task RequestsCorrectUrl() await client.DeleteForOrg("fake", PackageType.Npm, "name", 5); - connection.Received().Delete(Arg.Is(u => u.ToString() == "/orgs/fake/packages/npm/name/versions/5")); + connection.Received().Delete(Arg.Is(u => u.ToString() == "orgs/fake/packages/npm/name/versions/5")); } [Fact] @@ -128,7 +128,7 @@ public async Task RequestsCorrectUrl() await client.RestoreForOrg("fake", PackageType.Npm, "name", 5); - connection.Received().Post(Arg.Is(u => u.ToString() == "/orgs/fake/packages/npm/name/versions/5/restore")); + connection.Received().Post(Arg.Is(u => u.ToString() == "orgs/fake/packages/npm/name/versions/5/restore")); } [Fact] @@ -157,7 +157,7 @@ public async Task RequestsCorrectUrl() await client.GetAllForActiveUser(PackageType.RubyGems, "name"); connection.Received().GetAll(Arg.Is(u => - u.ToString() == "/user/packages/rubygems/name/versions"), + u.ToString() == "user/packages/rubygems/name/versions"), Arg.Is>(d => d.ContainsKey("state")), Args.ApiOptions); } @@ -172,7 +172,7 @@ public async Task RequestsCorrectUrlWithOptionalParameter() var calls = connection.ReceivedCalls(); connection.Received().GetAll(Arg.Is(u => - u.ToString() == "/user/packages/rubygems/name/versions"), + u.ToString() == "user/packages/rubygems/name/versions"), Arg.Is>(d => d.ContainsKey("state") && d["state"] == "deleted"), Args.ApiOptions); } @@ -198,7 +198,7 @@ public async Task RequestsCorrectUrl() await client.GetForActiveUser(PackageType.Npm, "name", 5); - connection.Received().Get(Arg.Is(u => u.ToString() == "/user/packages/npm/name/versions/5")); + connection.Received().Get(Arg.Is(u => u.ToString() == "user/packages/npm/name/versions/5")); } [Fact] @@ -223,7 +223,7 @@ public async Task RequestsCorrectUrl() await client.DeleteForActiveUser(PackageType.Npm, "name", 5); - connection.Received().Delete(Arg.Is(u => u.ToString() == "/user/packages/npm/name/versions/5")); + connection.Received().Delete(Arg.Is(u => u.ToString() == "user/packages/npm/name/versions/5")); } [Fact] @@ -248,7 +248,7 @@ public async Task RequestsCorrectUrl() await client.RestoreForActiveUser(PackageType.Npm, "name", 5); - connection.Received().Post(Arg.Is(u => u.ToString() == "/user/packages/npm/name/versions/5/restore")); + connection.Received().Post(Arg.Is(u => u.ToString() == "user/packages/npm/name/versions/5/restore")); } [Fact] @@ -274,7 +274,7 @@ public async Task RequestsCorrectUrl() await client.GetAllForUser("fake", PackageType.RubyGems, "name"); connection.Received().GetAll(Arg.Is(u => - u.ToString() == "/users/fake/packages/rubygems/name/versions"), + u.ToString() == "users/fake/packages/rubygems/name/versions"), Arg.Is>(d => d.ContainsKey("state")), Args.ApiOptions); } @@ -289,7 +289,7 @@ public async Task RequestsCorrectUrlWithOptionalParameter() var calls = connection.ReceivedCalls(); connection.Received().GetAll(Arg.Is(u => - u.ToString() == "/users/fake/packages/rubygems/name/versions"), + u.ToString() == "users/fake/packages/rubygems/name/versions"), Arg.Is>(d => d.ContainsKey("state") && d["state"] == "deleted"), Args.ApiOptions); } @@ -318,7 +318,7 @@ public async Task RequestsCorrectUrl() await client.GetForUser("fake", PackageType.Npm, "name", 5); - connection.Received().Get(Arg.Is(u => u.ToString() == "/users/fake/packages/npm/name/versions/5")); + connection.Received().Get(Arg.Is(u => u.ToString() == "users/fake/packages/npm/name/versions/5")); } [Fact] @@ -346,7 +346,7 @@ public async Task RequestsCorrectUrl() await client.DeleteForUser("fake", PackageType.Npm, "name", 5); - connection.Received().Delete(Arg.Is(u => u.ToString() == "/users/fake/packages/npm/name/versions/5")); + connection.Received().Delete(Arg.Is(u => u.ToString() == "users/fake/packages/npm/name/versions/5")); } [Fact] @@ -374,7 +374,7 @@ public async Task RequestsCorrectUrl() await client.RestoreForUser("fake", PackageType.Npm, "name", 5); - connection.Received().Post(Arg.Is(u => u.ToString() == "/users/fake/packages/npm/name/versions/5/restore")); + connection.Received().Post(Arg.Is(u => u.ToString() == "users/fake/packages/npm/name/versions/5/restore")); } [Fact] diff --git a/Octokit.Tests/Clients/PackagesClientTests.cs b/Octokit.Tests/Clients/PackagesClientTests.cs index 1b056c30a4..2da109bf1f 100644 --- a/Octokit.Tests/Clients/PackagesClientTests.cs +++ b/Octokit.Tests/Clients/PackagesClientTests.cs @@ -27,7 +27,7 @@ public async Task RequestsCorrectUrl() await client.GetAllForOrg("fake", PackageType.RubyGems); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "/orgs/fake/packages"), Arg.Is>(d => d.ContainsKey("package_type"))); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/fake/packages"), Arg.Is>(d => d.ContainsKey("package_type"))); } [Fact] @@ -39,7 +39,7 @@ public async Task RequestsCorrectUrlWithOptionalParameter() await client.GetAllForOrg("fake", PackageType.RubyGems, PackageVisibility.Public); var calls = connection.ReceivedCalls(); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "/orgs/fake/packages"), Arg.Is>(d => d.ContainsKey("package_type") && d.ContainsKey("visibility"))); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/fake/packages"), Arg.Is>(d => d.ContainsKey("package_type") && d.ContainsKey("visibility"))); } [Fact] @@ -63,7 +63,7 @@ public async Task RequestsCorrectUrl() await client.GetForOrg("fake", PackageType.Npm, "name"); - connection.Received().Get(Arg.Is(u => u.ToString() == "/orgs/fake/packages/npm/name")); + connection.Received().Get(Arg.Is(u => u.ToString() == "orgs/fake/packages/npm/name")); } [Fact] @@ -89,7 +89,7 @@ public async Task RequestsCorrectUrl() await client.DeleteForOrg("fake", PackageType.Npm, "name"); - connection.Received().Delete(Arg.Is(u => u.ToString() == "/orgs/fake/packages/npm/name")); + connection.Received().Delete(Arg.Is(u => u.ToString() == "orgs/fake/packages/npm/name")); } [Fact] @@ -115,7 +115,7 @@ public async Task RequestsCorrectUrl() await client.RestoreForOrg("fake", PackageType.Npm, "name"); - connection.Received().Post(Arg.Is(u => u.ToString() == "/orgs/fake/packages/npm/name/restore")); + connection.Received().Post(Arg.Is(u => u.ToString() == "orgs/fake/packages/npm/name/restore")); } [Fact] @@ -141,7 +141,7 @@ public async Task RequestsCorrectUrl() await client.GetAllForActiveUser(PackageType.RubyGems); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "/user/packages"), Arg.Is>(d => d.ContainsKey("package_type"))); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "user/packages"), Arg.Is>(d => d.ContainsKey("package_type"))); } [Fact] @@ -153,7 +153,7 @@ public async Task RequestsCorrectUrlWithOptionalParameter() await client.GetAllForActiveUser(PackageType.RubyGems, PackageVisibility.Public); var calls = connection.ReceivedCalls(); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "/user/packages"), Arg.Is>(d => d.ContainsKey("package_type") && d.ContainsKey("visibility"))); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "user/packages"), Arg.Is>(d => d.ContainsKey("package_type") && d.ContainsKey("visibility"))); } } @@ -167,7 +167,7 @@ public async Task RequestsCorrectUrl() await client.GetForActiveUser(PackageType.Npm, "name"); - connection.Received().Get(Arg.Is(u => u.ToString() == "/user/packages/npm/name")); + connection.Received().Get(Arg.Is(u => u.ToString() == "user/packages/npm/name")); } [Fact] @@ -190,7 +190,7 @@ public async Task RequestsCorrectUrl() await client.DeleteForActiveUser(PackageType.Npm, "name"); - connection.Received().Delete(Arg.Is(u => u.ToString() == "/user/packages/npm/name")); + connection.Received().Delete(Arg.Is(u => u.ToString() == "user/packages/npm/name")); } [Fact] @@ -213,7 +213,7 @@ public async Task RequestsCorrectUrl() await client.RestoreForActiveUser(PackageType.Npm, "name"); - connection.Received().Post(Arg.Is(u => u.ToString() == "/user/packages/npm/name/restore")); + connection.Received().Post(Arg.Is(u => u.ToString() == "user/packages/npm/name/restore")); } [Fact] @@ -236,7 +236,7 @@ public async Task RequestsCorrectUrl() await client.GetAllForUser("fake", PackageType.RubyGems); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "/users/fake/packages"), Arg.Is>(d => d.ContainsKey("package_type"))); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "users/fake/packages"), Arg.Is>(d => d.ContainsKey("package_type"))); } [Fact] @@ -248,7 +248,7 @@ public async Task RequestsCorrectUrlWithOptionalParameter() await client.GetAllForUser("fake", PackageType.RubyGems, PackageVisibility.Public); var calls = connection.ReceivedCalls(); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "/users/fake/packages"), Arg.Is>(d => d.ContainsKey("package_type") && d.ContainsKey("visibility"))); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "users/fake/packages"), Arg.Is>(d => d.ContainsKey("package_type") && d.ContainsKey("visibility"))); } [Fact] @@ -272,7 +272,7 @@ public async Task RequestsCorrectUrl() await client.GetForUser("fake", PackageType.Npm, "name"); - connection.Received().Get(Arg.Is(u => u.ToString() == "/users/fake/packages/npm/name")); + connection.Received().Get(Arg.Is(u => u.ToString() == "users/fake/packages/npm/name")); } [Fact] @@ -298,7 +298,7 @@ public async Task RequestsCorrectUrl() await client.DeleteForUser("fake", PackageType.Npm, "name"); - connection.Received().Delete(Arg.Is(u => u.ToString() == "/users/fake/packages/npm/name")); + connection.Received().Delete(Arg.Is(u => u.ToString() == "users/fake/packages/npm/name")); } [Fact] @@ -324,7 +324,7 @@ public async Task RequestsCorrectUrl() await client.RestoreForUser("fake", PackageType.Npm, "name"); - connection.Received().Post(Arg.Is(u => u.ToString() == "/users/fake/packages/npm/name/restore")); + connection.Received().Post(Arg.Is(u => u.ToString() == "users/fake/packages/npm/name/restore")); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableActionsWorkflowRunsClientTests.cs b/Octokit.Tests/Reactive/ObservableActionsWorkflowRunsClientTests.cs index 0344f91a4c..677190e8d2 100644 --- a/Octokit.Tests/Reactive/ObservableActionsWorkflowRunsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableActionsWorkflowRunsClientTests.cs @@ -382,7 +382,7 @@ public async Task CallsGetReviewHistoryOnClient() client.GetReviewHistory("fake", "repo", 123); - connection.Connection.Received().Get>(Arg.Is(u => u.ToString() == "/repos/fake/repo/actions/runs/123/approvals"), + connection.Connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/actions/runs/123/approvals"), null); } diff --git a/Octokit.Tests/Reactive/ObservablePackageVersionsTests.cs b/Octokit.Tests/Reactive/ObservablePackageVersionsTests.cs index 0ba5cc3332..1942610a76 100644 --- a/Octokit.Tests/Reactive/ObservablePackageVersionsTests.cs +++ b/Octokit.Tests/Reactive/ObservablePackageVersionsTests.cs @@ -28,7 +28,7 @@ public void RequestsCorrectUrl() client.GetAllForOrg("fake", PackageType.RubyGems, "name"); gitHubClient.Connection.Received().Get>( - new Uri("/orgs/fake/packages/rubygems/name/versions", UriKind.Relative), + new Uri("orgs/fake/packages/rubygems/name/versions", UriKind.Relative), Arg.Is>(d => d.ContainsKey("state"))); } @@ -41,7 +41,7 @@ public void RequestsCorrectUrlWithOptionalParameter() client.GetAllForOrg("fake", PackageType.RubyGems, "name", PackageVersionState.Deleted); gitHubClient.Connection.Received().Get>( - Arg.Is(u => u.ToString() == "/orgs/fake/packages/rubygems/name/versions"), + Arg.Is(u => u.ToString() == "orgs/fake/packages/rubygems/name/versions"), Arg.Is>(d => d.ContainsKey("state") && d["state"] == "deleted")); } diff --git a/Octokit.Tests/Reactive/ObservablePackagesTests.cs b/Octokit.Tests/Reactive/ObservablePackagesTests.cs index 996da9b7bd..5e1adb848c 100644 --- a/Octokit.Tests/Reactive/ObservablePackagesTests.cs +++ b/Octokit.Tests/Reactive/ObservablePackagesTests.cs @@ -28,7 +28,7 @@ public void RequestsCorrectUrl() client.GetAllForOrg("fake", PackageType.RubyGems); gitHubClient.Connection.Received(1).Get>( - new Uri("/orgs/fake/packages", UriKind.Relative), + new Uri("orgs/fake/packages", UriKind.Relative), Arg.Is>(d => d.ContainsKey("package_type"))); } @@ -41,7 +41,7 @@ public void RequestsCorrectUrlWithOptionalParameter() client.GetAllForOrg("fake", PackageType.RubyGems, PackageVisibility.Public); gitHubClient.Connection.Received().Get>( - Arg.Is(u => u.ToString() == "/orgs/fake/packages"), + Arg.Is(u => u.ToString() == "orgs/fake/packages"), Arg.Is>(d => d.ContainsKey("package_type") && d.ContainsKey("visibility"))); } @@ -143,7 +143,7 @@ public void RequestsCorrectUrl() client.GetAllForActiveUser(PackageType.RubyGems); gitHubClient.Connection.Received(1).Get>( - new Uri("/user/packages", UriKind.Relative), + new Uri("user/packages", UriKind.Relative), Arg.Is>(d => d.ContainsKey("package_type"))); } @@ -156,7 +156,7 @@ public void RequestsCorrectUrlWithOptionalParameter() client.GetAllForActiveUser(PackageType.RubyGems, PackageVisibility.Public); gitHubClient.Connection.Received().Get>( - Arg.Is(u => u.ToString() == "/user/packages"), + Arg.Is(u => u.ToString() == "user/packages"), Arg.Is>(d => d.ContainsKey("package_type") && d.ContainsKey("visibility"))); } } @@ -241,7 +241,7 @@ public void RequestsCorrectUrl() client.GetAllForUser("fake", PackageType.RubyGems); gitHubClient.Connection.Received(1).Get>( - new Uri("/users/fake/packages", UriKind.Relative), + new Uri("users/fake/packages", UriKind.Relative), Arg.Is>(d => d.ContainsKey("package_type"))); } @@ -254,7 +254,7 @@ public void RequestsCorrectUrlWithOptionalParameter() client.GetAllForUser("fake", PackageType.RubyGems, PackageVisibility.Public); gitHubClient.Connection.Received().Get>( - Arg.Is(u => u.ToString() == "/users/fake/packages"), + Arg.Is(u => u.ToString() == "users/fake/packages"), Arg.Is>(d => d.ContainsKey("package_type") && d.ContainsKey("visibility"))); } diff --git a/Octokit/Helpers/ApiUrls.cs b/Octokit/Helpers/ApiUrls.cs index c4ae3b26b9..9bff25de4b 100644 --- a/Octokit/Helpers/ApiUrls.cs +++ b/Octokit/Helpers/ApiUrls.cs @@ -4620,7 +4620,7 @@ public static Uri AllOrganizationCredentials(string org, string login) /// The Packages endpoint. public static Uri PackagesOrg(string org) { - return "/orgs/{0}/packages".FormatUri(org); + return "orgs/{0}/packages".FormatUri(org); } /// @@ -4629,7 +4629,7 @@ public static Uri PackagesOrg(string org) /// The Package endpoint. public static Uri PackageOrg(string org, PackageType packageType, string packageName) { - return "/orgs/{0}/packages/{1}/{2}".FormatUri(org, packageType.ToParameter(), packageName); + return "orgs/{0}/packages/{1}/{2}".FormatUri(org, packageType.ToParameter(), packageName); } /// @@ -4638,7 +4638,7 @@ public static Uri PackageOrg(string org, PackageType packageType, string package /// The Package Restore endpoint. public static Uri PackageRestoreOrg(string org, PackageType packageType, string packageName) { - return "/orgs/{0}/packages/{1}/{2}/restore".FormatUri(org, packageType.ToParameter(), packageName); + return "orgs/{0}/packages/{1}/{2}/restore".FormatUri(org, packageType.ToParameter(), packageName); } /// @@ -4647,7 +4647,7 @@ public static Uri PackageRestoreOrg(string org, PackageType packageType, string /// The Package endpoint. public static Uri PackageVersionsOrg(string org, PackageType packageType, string packageName) { - return "/orgs/{0}/packages/{1}/{2}/versions".FormatUri(org, packageType.ToParameter(), packageName); + return "orgs/{0}/packages/{1}/{2}/versions".FormatUri(org, packageType.ToParameter(), packageName); } /// @@ -4656,7 +4656,7 @@ public static Uri PackageVersionsOrg(string org, PackageType packageType, string /// The Package endpoint. public static Uri PackageVersionOrg(string org, PackageType packageType, string packageName, int packageVersionId) { - return "/orgs/{0}/packages/{1}/{2}/versions/{3}".FormatUri(org, packageType.ToParameter(), packageName, packageVersionId); + return "orgs/{0}/packages/{1}/{2}/versions/{3}".FormatUri(org, packageType.ToParameter(), packageName, packageVersionId); } /// @@ -4665,7 +4665,7 @@ public static Uri PackageVersionOrg(string org, PackageType packageType, string /// The Package endpoint. public static Uri PackageVersionRestoreOrg(string org, PackageType packageType, string packageName, int packageVersionId) { - return "/orgs/{0}/packages/{1}/{2}/versions/{3}/restore".FormatUri(org, packageType.ToParameter(), packageName, packageVersionId); + return "orgs/{0}/packages/{1}/{2}/versions/{3}/restore".FormatUri(org, packageType.ToParameter(), packageName, packageVersionId); } /// @@ -4674,7 +4674,7 @@ public static Uri PackageVersionRestoreOrg(string org, PackageType packageType, /// The Packages endpoint. public static Uri PackagesActiveUser() { - return "/user/packages".FormatUri(); + return "user/packages".FormatUri(); } /// @@ -4683,7 +4683,7 @@ public static Uri PackagesActiveUser() /// The Package endpoint. public static Uri PackageActiveUser(PackageType packageType, string packageName) { - return "/user/packages/{0}/{1}".FormatUri(packageType.ToParameter(), packageName); + return "user/packages/{0}/{1}".FormatUri(packageType.ToParameter(), packageName); } /// @@ -4692,7 +4692,7 @@ public static Uri PackageActiveUser(PackageType packageType, string packageName) /// The Package Restore endpoint. public static Uri PackageRestoreActiveUser(PackageType packageType, string packageName) { - return "/user/packages/{0}/{1}/restore".FormatUri(packageType.ToParameter(), packageName); + return "user/packages/{0}/{1}/restore".FormatUri(packageType.ToParameter(), packageName); } /// @@ -4701,7 +4701,7 @@ public static Uri PackageRestoreActiveUser(PackageType packageType, string packa /// The Package endpoint. public static Uri PackageVersionsActiveUser(PackageType packageType, string packageName) { - return "/user/packages/{0}/{1}/versions".FormatUri(packageType.ToParameter(), packageName); + return "user/packages/{0}/{1}/versions".FormatUri(packageType.ToParameter(), packageName); } /// @@ -4710,7 +4710,7 @@ public static Uri PackageVersionsActiveUser(PackageType packageType, string pack /// The Package endpoint. public static Uri PackageVersionActiveUser(PackageType packageType, string packageName, int packageVersionId) { - return "/user/packages/{0}/{1}/versions/{2}".FormatUri(packageType.ToParameter(), packageName, packageVersionId); + return "user/packages/{0}/{1}/versions/{2}".FormatUri(packageType.ToParameter(), packageName, packageVersionId); } /// @@ -4719,7 +4719,7 @@ public static Uri PackageVersionActiveUser(PackageType packageType, string packa /// The Package endpoint. public static Uri PackageVersionRestoreActiveUser(PackageType packageType, string packageName, int packageVersionId) { - return "/user/packages/{0}/{1}/versions/{2}/restore".FormatUri(packageType.ToParameter(), packageName, packageVersionId); + return "user/packages/{0}/{1}/versions/{2}/restore".FormatUri(packageType.ToParameter(), packageName, packageVersionId); } /// @@ -4728,7 +4728,7 @@ public static Uri PackageVersionRestoreActiveUser(PackageType packageType, strin /// The Packages endpoint. public static Uri PackagesUser(string username) { - return "/users/{0}/packages".FormatUri(username); + return "users/{0}/packages".FormatUri(username); } /// @@ -4737,7 +4737,7 @@ public static Uri PackagesUser(string username) /// The Package endpoint. public static Uri PackageUser(string username, PackageType packageType, string packageName) { - return "/users/{0}/packages/{1}/{2}".FormatUri(username, packageType.ToParameter(), packageName); + return "users/{0}/packages/{1}/{2}".FormatUri(username, packageType.ToParameter(), packageName); } /// @@ -4746,7 +4746,7 @@ public static Uri PackageUser(string username, PackageType packageType, string p /// The Package Restore endpoint. public static Uri PackageRestoreUser(string username, PackageType packageType, string packageName) { - return "/users/{0}/packages/{1}/{2}/restore".FormatUri(username, packageType.ToParameter(), packageName); + return "users/{0}/packages/{1}/{2}/restore".FormatUri(username, packageType.ToParameter(), packageName); } /// @@ -4755,7 +4755,7 @@ public static Uri PackageRestoreUser(string username, PackageType packageType, s /// The Package endpoint. public static Uri PackageVersionsUser(string username, PackageType packageType, string packageName) { - return "/users/{0}/packages/{1}/{2}/versions".FormatUri(username, packageType.ToParameter(), packageName); + return "users/{0}/packages/{1}/{2}/versions".FormatUri(username, packageType.ToParameter(), packageName); } /// @@ -4764,7 +4764,7 @@ public static Uri PackageVersionsUser(string username, PackageType packageType, /// The Package endpoint. public static Uri PackageVersionUser(string username, PackageType packageType, string packageName, int packageVersionId) { - return "/users/{0}/packages/{1}/{2}/versions/{3}".FormatUri(username, packageType.ToParameter(), packageName, packageVersionId); + return "users/{0}/packages/{1}/{2}/versions/{3}".FormatUri(username, packageType.ToParameter(), packageName, packageVersionId); } /// @@ -4773,7 +4773,7 @@ public static Uri PackageVersionUser(string username, PackageType packageType, s /// The Package endpoint. public static Uri PackageVersionRestoreUser(string username, PackageType packageType, string packageName, int packageVersionId) { - return "/users/{0}/packages/{1}/{2}/versions/{3}/restore".FormatUri(username, packageType.ToParameter(), packageName, packageVersionId); + return "users/{0}/packages/{1}/{2}/versions/{3}/restore".FormatUri(username, packageType.ToParameter(), packageName, packageVersionId); } /// @@ -4785,7 +4785,7 @@ public static Uri PackageVersionRestoreUser(string username, PackageType package /// The that gets an Actions workflow for a repository. public static Uri ActionsDispatchWorkflow(string owner, string repo, long workflowId) { - return "/repos/{0}/{1}/actions/workflows/{2}/dispatches".FormatUri(owner, repo, workflowId); + return "repos/{0}/{1}/actions/workflows/{2}/dispatches".FormatUri(owner, repo, workflowId); } /// @@ -4797,7 +4797,7 @@ public static Uri ActionsDispatchWorkflow(string owner, string repo, long workfl /// The that gets an Actions workflow for a repository. public static Uri ActionsDispatchWorkflow(string owner, string repo, string workflowFileName) { - return "/repos/{0}/{1}/actions/workflows/{2}/dispatches".FormatUri(owner, repo, workflowFileName.UriEncode()); + return "repos/{0}/{1}/actions/workflows/{2}/dispatches".FormatUri(owner, repo, workflowFileName.UriEncode()); } /// @@ -4809,7 +4809,7 @@ public static Uri ActionsDispatchWorkflow(string owner, string repo, string work /// The that gets an Actions workflow for a repository. public static Uri ActionsDisableWorkflow(string owner, string repo, string workflowFileName) { - return "/repos/{0}/{1}/actions/workflows/{2}/disable".FormatUri(owner, repo, workflowFileName.UriEncode()); + return "repos/{0}/{1}/actions/workflows/{2}/disable".FormatUri(owner, repo, workflowFileName.UriEncode()); } /// @@ -4821,7 +4821,7 @@ public static Uri ActionsDisableWorkflow(string owner, string repo, string workf /// The that gets an Actions workflow for a repository. public static Uri ActionsDisableWorkflow(string owner, string repo, long workflowId) { - return "/repos/{0}/{1}/actions/workflows/{2}/disable".FormatUri(owner, repo, workflowId); + return "repos/{0}/{1}/actions/workflows/{2}/disable".FormatUri(owner, repo, workflowId); } /// @@ -4833,7 +4833,7 @@ public static Uri ActionsDisableWorkflow(string owner, string repo, long workflo /// The that gets an Actions workflow for a repository. public static Uri ActionsEnableWorkflow(string owner, string repo, string workflowFileName) { - return "/repos/{0}/{1}/actions/workflows/{2}/enable".FormatUri(owner, repo, workflowFileName.UriEncode()); + return "repos/{0}/{1}/actions/workflows/{2}/enable".FormatUri(owner, repo, workflowFileName.UriEncode()); } /// @@ -4845,7 +4845,7 @@ public static Uri ActionsEnableWorkflow(string owner, string repo, string workfl /// The that gets an Actions workflow for a repository. public static Uri ActionsEnableWorkflow(string owner, string repo, long workflowId) { - return "/repos/{0}/{1}/actions/workflows/{2}/enable".FormatUri(owner, repo, workflowId); + return "repos/{0}/{1}/actions/workflows/{2}/enable".FormatUri(owner, repo, workflowId); } /// @@ -4857,7 +4857,7 @@ public static Uri ActionsEnableWorkflow(string owner, string repo, long workflow /// The that gets an Actions workflow for a repository. public static Uri ActionsGetWorkflow(string owner, string repo, string workflowFileName) { - return "/repos/{0}/{1}/actions/workflows/{2}".FormatUri(owner, repo, workflowFileName.UriEncode()); + return "repos/{0}/{1}/actions/workflows/{2}".FormatUri(owner, repo, workflowFileName.UriEncode()); } /// @@ -4869,7 +4869,7 @@ public static Uri ActionsGetWorkflow(string owner, string repo, string workflowF /// The that gets an Actions workflow for a repository. public static Uri ActionsGetWorkflow(string owner, string repo, long workflowId) { - return "/repos/{0}/{1}/actions/workflows/{2}".FormatUri(owner, repo, workflowId); + return "repos/{0}/{1}/actions/workflows/{2}".FormatUri(owner, repo, workflowId); } /// @@ -4881,7 +4881,7 @@ public static Uri ActionsGetWorkflow(string owner, string repo, long workflowId) /// The that gets an Actions workflow for a repository. public static Uri ActionsGetWorkflowUsage(string owner, string repo, string workflowFileName) { - return "/repos/{0}/{1}/actions/workflows/{2}/timing".FormatUri(owner, repo, workflowFileName.UriEncode()); + return "repos/{0}/{1}/actions/workflows/{2}/timing".FormatUri(owner, repo, workflowFileName.UriEncode()); } /// @@ -4893,7 +4893,7 @@ public static Uri ActionsGetWorkflowUsage(string owner, string repo, string work /// The that gets an Actions workflow for a repository. public static Uri ActionsGetWorkflowUsage(string owner, string repo, long workflowId) { - return "/repos/{0}/{1}/actions/workflows/{2}/timing".FormatUri(owner, repo, workflowId); + return "repos/{0}/{1}/actions/workflows/{2}/timing".FormatUri(owner, repo, workflowId); } /// @@ -4904,7 +4904,7 @@ public static Uri ActionsGetWorkflowUsage(string owner, string repo, long workfl /// The that handles the Actions workflows for the repository. public static Uri ActionsListWorkflows(string owner, string repo) { - return "/repos/{0}/{1}/actions/workflows".FormatUri(owner, repo); + return "repos/{0}/{1}/actions/workflows".FormatUri(owner, repo); } /// @@ -4916,7 +4916,7 @@ public static Uri ActionsListWorkflows(string owner, string repo) /// The that gets an Actions workflow for a repository. public static Uri ActionsRerunWorkflowJob(string owner, string repo, long jobId) { - return "/repos/{0}/{1}/actions/jobs/{2}/rerun".FormatUri(owner, repo, jobId); + return "repos/{0}/{1}/actions/jobs/{2}/rerun".FormatUri(owner, repo, jobId); } /// @@ -4928,7 +4928,7 @@ public static Uri ActionsRerunWorkflowJob(string owner, string repo, long jobId) /// The that gets an Actions workflow for a repository. public static Uri ActionsGetWorkflowJob(string owner, string repo, long jobId) { - return "/repos/{0}/{1}/actions/jobs/{2}".FormatUri(owner, repo, jobId); + return "repos/{0}/{1}/actions/jobs/{2}".FormatUri(owner, repo, jobId); } /// @@ -4940,7 +4940,7 @@ public static Uri ActionsGetWorkflowJob(string owner, string repo, long jobId) /// The that gets an Actions workflow job for a repository. public static Uri ActionsGetWorkflowJobLogs(string owner, string repo, long jobId) { - return "/repos/{0}/{1}/actions/jobs/{2}/logs".FormatUri(owner, repo, jobId); + return "repos/{0}/{1}/actions/jobs/{2}/logs".FormatUri(owner, repo, jobId); } /// @@ -4952,7 +4952,7 @@ public static Uri ActionsGetWorkflowJobLogs(string owner, string repo, long jobI /// The that handles the Actions workflows runs for a workflow. public static Uri ActionsListWorkflowJobs(string owner, string repo, long runId) { - return "/repos/{0}/{1}/actions/runs/{2}/jobs".FormatUri(owner, repo, runId); + return "repos/{0}/{1}/actions/runs/{2}/jobs".FormatUri(owner, repo, runId); } /// @@ -4965,7 +4965,7 @@ public static Uri ActionsListWorkflowJobs(string owner, string repo, long runId) /// The that handles the Actions workflows runs for a workflow. public static Uri ActionsListWorkflowJobs(string owner, string repo, long runId, int attemptNumber) { - return "/repos/{0}/{1}/actions/runs/{2}/attempts/{3}/jobs".FormatUri(owner, repo, runId, attemptNumber); + return "repos/{0}/{1}/actions/runs/{2}/attempts/{3}/jobs".FormatUri(owner, repo, runId, attemptNumber); } /// @@ -4976,7 +4976,7 @@ public static Uri ActionsListWorkflowJobs(string owner, string repo, long runId, /// The that gets Actions workflow runs for a repository. public static Uri ActionsWorkflowRuns(string owner, string repo) { - return "/repos/{0}/{1}/actions/runs".FormatUri(owner, repo); + return "repos/{0}/{1}/actions/runs".FormatUri(owner, repo); } /// @@ -4988,7 +4988,7 @@ public static Uri ActionsWorkflowRuns(string owner, string repo) /// The that gets an Actions workflow run for a repository. public static Uri ActionsWorkflowRun(string owner, string repo, long runId) { - return "/repos/{0}/{1}/actions/runs/{2}".FormatUri(owner, repo, runId); + return "repos/{0}/{1}/actions/runs/{2}".FormatUri(owner, repo, runId); } /// @@ -5001,7 +5001,7 @@ public static Uri ActionsWorkflowRun(string owner, string repo, long runId) /// The that gets an Actions workflow run for a repository. public static Uri ActionsWorkflowRunAttempt(string owner, string repo, long runId, long attemptNumber) { - return "/repos/{0}/{1}/actions/runs/{2}/attempts/{3}".FormatUri(owner, repo, runId, attemptNumber); + return "repos/{0}/{1}/actions/runs/{2}/attempts/{3}".FormatUri(owner, repo, runId, attemptNumber); } /// @@ -5013,7 +5013,7 @@ public static Uri ActionsWorkflowRunAttempt(string owner, string repo, long runI /// The that approves an Actions workflow run for a repository. public static Uri ActionsApproveWorkflowRun(string owner, string repo, long runId) { - return "/repos/{0}/{1}/actions/runs/{2}/approve".FormatUri(owner, repo, runId); + return "repos/{0}/{1}/actions/runs/{2}/approve".FormatUri(owner, repo, runId); } /// @@ -5025,7 +5025,7 @@ public static Uri ActionsApproveWorkflowRun(string owner, string repo, long runI /// The that cancels an Actions workflow run for a repository. public static Uri ActionsCancelWorkflowRun(string owner, string repo, long runId) { - return "/repos/{0}/{1}/actions/runs/{2}/cancel".FormatUri(owner, repo, runId); + return "repos/{0}/{1}/actions/runs/{2}/cancel".FormatUri(owner, repo, runId); } /// @@ -5037,7 +5037,7 @@ public static Uri ActionsCancelWorkflowRun(string owner, string repo, long runId /// The that gets an Actions workflow run for a repository. public static Uri ActionsGetWorkflowRunLogs(string owner, string repo, long runId) { - return "/repos/{0}/{1}/actions/runs/{2}/logs".FormatUri(owner, repo, runId); + return "repos/{0}/{1}/actions/runs/{2}/logs".FormatUri(owner, repo, runId); } /// @@ -5050,7 +5050,7 @@ public static Uri ActionsGetWorkflowRunLogs(string owner, string repo, long runI /// The that gets an Actions workflow run for a repository. public static Uri ActionsGetWorkflowRunAttemptLogs(string owner, string repo, long runId, long attemptNumber) { - return "/repos/{0}/{1}/actions/runs/{2}/attempts/{3}/logs".FormatUri(owner, repo, runId, attemptNumber); + return "repos/{0}/{1}/actions/runs/{2}/attempts/{3}/logs".FormatUri(owner, repo, runId, attemptNumber); } /// @@ -5062,7 +5062,7 @@ public static Uri ActionsGetWorkflowRunAttemptLogs(string owner, string repo, lo /// The that gets an Actions workflow for a repository. public static Uri ActionsRerunWorkflowRun(string owner, string repo, long runId) { - return "/repos/{0}/{1}/actions/runs/{2}/rerun".FormatUri(owner, repo, runId); + return "repos/{0}/{1}/actions/runs/{2}/rerun".FormatUri(owner, repo, runId); } /// @@ -5074,7 +5074,7 @@ public static Uri ActionsRerunWorkflowRun(string owner, string repo, long runId) /// The that gets an Actions workflow for a repository. public static Uri ActionsRerunWorkflowRunFailedJobs(string owner, string repo, long runId) { - return "/repos/{0}/{1}/actions/runs/{2}/rerun-failed-jobs".FormatUri(owner, repo, runId); + return "repos/{0}/{1}/actions/runs/{2}/rerun-failed-jobs".FormatUri(owner, repo, runId); } /// @@ -5086,7 +5086,7 @@ public static Uri ActionsRerunWorkflowRunFailedJobs(string owner, string repo, l /// The that gets an Actions workflow for a repository. public static Uri ActionsGetWorkflowRunUsage(string owner, string repo, long runId) { - return "/repos/{0}/{1}/actions/runs/{2}/timing".FormatUri(owner, repo, runId); + return "repos/{0}/{1}/actions/runs/{2}/timing".FormatUri(owner, repo, runId); } /// @@ -5098,7 +5098,7 @@ public static Uri ActionsGetWorkflowRunUsage(string owner, string repo, long run /// The that gets Actions workflow run approvals for a repository. public static Uri ActionsWorkflowRunApprovals(string owner, string repo, long runId) { - return "/repos/{0}/{1}/actions/runs/{2}/approvals".FormatUri(owner, repo, runId); + return "repos/{0}/{1}/actions/runs/{2}/approvals".FormatUri(owner, repo, runId); } /// @@ -5110,7 +5110,7 @@ public static Uri ActionsWorkflowRunApprovals(string owner, string repo, long ru /// The that gets Actions workflow run pending deployments for a repository. public static Uri ActionsWorkflowRunPendingDeployments(string owner, string repo, long runId) { - return "/repos/{0}/{1}/actions/runs/{2}/pending_deployments".FormatUri(owner, repo, runId); + return "repos/{0}/{1}/actions/runs/{2}/pending_deployments".FormatUri(owner, repo, runId); } /// @@ -5122,7 +5122,7 @@ public static Uri ActionsWorkflowRunPendingDeployments(string owner, string repo /// The that handles the Actions workflows runs for a workflow. public static Uri ActionsListWorkflowRuns(string owner, string repo, long workflowId) { - return "/repos/{0}/{1}/actions/workflows/{2}/runs".FormatUri(owner, repo, workflowId); + return "repos/{0}/{1}/actions/workflows/{2}/runs".FormatUri(owner, repo, workflowId); } /// @@ -5134,7 +5134,7 @@ public static Uri ActionsListWorkflowRuns(string owner, string repo, long workfl /// The that handles the Actions workflows runs for a workflow. public static Uri ActionsListWorkflowRuns(string owner, string repo, string workflowFileName) { - return "/repos/{0}/{1}/actions/workflows/{2}/runs".FormatUri(owner, repo, workflowFileName.UriEncode()); + return "repos/{0}/{1}/actions/workflows/{2}/runs".FormatUri(owner, repo, workflowFileName.UriEncode()); } } }