Skip to content

Commit

Permalink
Update go-github to v61 + gen endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
migueleliasweb committed May 6, 2024
1 parent 35555fd commit 12eaf76
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 58 deletions.
12 changes: 12 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Main",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "main.go"
}
]
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21
require (
github.com/buger/jsonparser v1.1.1
github.com/go-kit/log v0.2.1
github.com/google/go-github/v59 v59.0.0
github.com/google/go-github/v61 v61.0.0
github.com/gorilla/mux v1.8.0
golang.org/x/time v0.3.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KE
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-github/v59 v59.0.0 h1:7h6bgpF5as0YQLLkEiVqpgtJqjimMYhBkD4jT5aN3VA=
github.com/google/go-github/v59 v59.0.0/go.mod h1:rJU4R0rQHFVFDOkqGWxfLNo6vEk4dv40oDjhV/gH6wM=
github.com/google/go-github/v61 v61.0.0 h1:VwQCBwhyE9JclCI+22/7mLB1PuU9eowCXKY5pNlu1go=
github.com/google/go-github/v61 v61.0.0/go.mod h1:0WR+KmsWX75G2EbpyGsGmradjo3IiciuI4BmdVCobQY=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
Expand Down
120 changes: 70 additions & 50 deletions src/mock/endpointpattern.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ var GetEmojis EndpointPattern = EndpointPattern{
Method: "GET",
}

var GetEnterprisesCopilotUsageByEnterprise EndpointPattern = EndpointPattern{
Pattern: "/enterprises/{enterprise}/copilot/usage",
Method: "GET",
}

var GetEnterprisesDependabotAlertsByEnterprise EndpointPattern = EndpointPattern{
Pattern: "/enterprises/{enterprise}/dependabot/alerts",
Method: "GET",
Expand Down Expand Up @@ -767,6 +772,11 @@ var DeleteOrgsCopilotBillingSelectedUsersByOrg EndpointPattern = EndpointPattern
Method: "DELETE",
}

var GetOrgsCopilotUsageByOrg EndpointPattern = EndpointPattern{
Pattern: "/orgs/{org}/copilot/usage",
Method: "GET",
}

var GetOrgsDependabotAlertsByOrg EndpointPattern = EndpointPattern{
Pattern: "/orgs/{org}/dependabot/alerts",
Method: "GET",
Expand Down Expand Up @@ -1337,6 +1347,11 @@ var GetOrgsSettingsBillingSharedStorageByOrg EndpointPattern = EndpointPattern{
Method: "GET",
}

var GetOrgsTeamCopilotUsageByOrgByTeamSlug EndpointPattern = EndpointPattern{
Pattern: "/orgs/{org}/team/{team_slug}/copilot/usage",
Method: "GET",
}

var GetOrgsTeamsByOrg EndpointPattern = EndpointPattern{
Pattern: "/orgs/{org}/teams",
Method: "GET",
Expand Down Expand Up @@ -2702,6 +2717,56 @@ var DeleteReposEnvironmentsDeploymentProtectionRulesByOwnerByRepoByEnvironmentNa
Method: "DELETE",
}

var GetReposEnvironmentsSecretsByOwnerByRepoByEnvironmentName EndpointPattern = EndpointPattern{
Pattern: "/repos/{owner}/{repo}/environments/{environment_name}/secrets",
Method: "GET",
}

var GetReposEnvironmentsSecretsPublicKeyByOwnerByRepoByEnvironmentName EndpointPattern = EndpointPattern{
Pattern: "/repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key",
Method: "GET",
}

var GetReposEnvironmentsSecretsByOwnerByRepoByEnvironmentNameBySecretName EndpointPattern = EndpointPattern{
Pattern: "/repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}",
Method: "GET",
}

var PutReposEnvironmentsSecretsByOwnerByRepoByEnvironmentNameBySecretName EndpointPattern = EndpointPattern{
Pattern: "/repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}",
Method: "PUT",
}

var DeleteReposEnvironmentsSecretsByOwnerByRepoByEnvironmentNameBySecretName EndpointPattern = EndpointPattern{
Pattern: "/repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}",
Method: "DELETE",
}

var GetReposEnvironmentsVariablesByOwnerByRepoByEnvironmentName EndpointPattern = EndpointPattern{
Pattern: "/repos/{owner}/{repo}/environments/{environment_name}/variables",
Method: "GET",
}

var PostReposEnvironmentsVariablesByOwnerByRepoByEnvironmentName EndpointPattern = EndpointPattern{
Pattern: "/repos/{owner}/{repo}/environments/{environment_name}/variables",
Method: "POST",
}

var GetReposEnvironmentsVariablesByOwnerByRepoByEnvironmentNameByName EndpointPattern = EndpointPattern{
Pattern: "/repos/{owner}/{repo}/environments/{environment_name}/variables/{name}",
Method: "GET",
}

var PatchReposEnvironmentsVariablesByOwnerByRepoByEnvironmentNameByName EndpointPattern = EndpointPattern{
Pattern: "/repos/{owner}/{repo}/environments/{environment_name}/variables/{name}",
Method: "PATCH",
}

var DeleteReposEnvironmentsVariablesByOwnerByRepoByEnvironmentNameByName EndpointPattern = EndpointPattern{
Pattern: "/repos/{owner}/{repo}/environments/{environment_name}/variables/{name}",
Method: "DELETE",
}

var GetReposEventsByOwnerByRepo EndpointPattern = EndpointPattern{
Pattern: "/repos/{owner}/{repo}/events",
Method: "GET",
Expand Down Expand Up @@ -3232,6 +3297,11 @@ var GetReposPagesHealthByOwnerByRepo EndpointPattern = EndpointPattern{
Method: "GET",
}

var GetReposPrivateVulnerabilityReportingByOwnerByRepo EndpointPattern = EndpointPattern{
Pattern: "/repos/{owner}/{repo}/private-vulnerability-reporting",
Method: "GET",
}

var PutReposPrivateVulnerabilityReportingByOwnerByRepo EndpointPattern = EndpointPattern{
Pattern: "/repos/{owner}/{repo}/private-vulnerability-reporting",
Method: "PUT",
Expand Down Expand Up @@ -3752,56 +3822,6 @@ var GetRepositories EndpointPattern = EndpointPattern{
Method: "GET",
}

var GetRepositoriesEnvironmentsSecretsByRepositoryIdByEnvironmentName EndpointPattern = EndpointPattern{
Pattern: "/repositories/{repository_id}/environments/{environment_name}/secrets",
Method: "GET",
}

var GetRepositoriesEnvironmentsSecretsPublicKeyByRepositoryIdByEnvironmentName EndpointPattern = EndpointPattern{
Pattern: "/repositories/{repository_id}/environments/{environment_name}/secrets/public-key",
Method: "GET",
}

var GetRepositoriesEnvironmentsSecretsByRepositoryIdByEnvironmentNameBySecretName EndpointPattern = EndpointPattern{
Pattern: "/repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}",
Method: "GET",
}

var PutRepositoriesEnvironmentsSecretsByRepositoryIdByEnvironmentNameBySecretName EndpointPattern = EndpointPattern{
Pattern: "/repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}",
Method: "PUT",
}

var DeleteRepositoriesEnvironmentsSecretsByRepositoryIdByEnvironmentNameBySecretName EndpointPattern = EndpointPattern{
Pattern: "/repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}",
Method: "DELETE",
}

var GetRepositoriesEnvironmentsVariablesByRepositoryIdByEnvironmentName EndpointPattern = EndpointPattern{
Pattern: "/repositories/{repository_id}/environments/{environment_name}/variables",
Method: "GET",
}

var PostRepositoriesEnvironmentsVariablesByRepositoryIdByEnvironmentName EndpointPattern = EndpointPattern{
Pattern: "/repositories/{repository_id}/environments/{environment_name}/variables",
Method: "POST",
}

var GetRepositoriesEnvironmentsVariablesByRepositoryIdByEnvironmentNameByName EndpointPattern = EndpointPattern{
Pattern: "/repositories/{repository_id}/environments/{environment_name}/variables/{name}",
Method: "GET",
}

var PatchRepositoriesEnvironmentsVariablesByRepositoryIdByEnvironmentNameByName EndpointPattern = EndpointPattern{
Pattern: "/repositories/{repository_id}/environments/{environment_name}/variables/{name}",
Method: "PATCH",
}

var DeleteRepositoriesEnvironmentsVariablesByRepositoryIdByEnvironmentNameByName EndpointPattern = EndpointPattern{
Pattern: "/repositories/{repository_id}/environments/{environment_name}/variables/{name}",
Method: "DELETE",
}

var GetSearchCode EndpointPattern = EndpointPattern{
Pattern: "/search/code",
Method: "GET",
Expand Down
2 changes: 1 addition & 1 deletion src/mock/endpointpattern_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"testing"

"github.com/google/go-github/v59/github"
"github.com/google/go-github/v61/github"
)

func TestRepoGetContents(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion src/mock/server_options_external_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"
"time"

"github.com/google/go-github/v59/github"
"github.com/google/go-github/v61/github"
"github.com/migueleliasweb/go-github-mock/src/mock"
)

Expand Down
2 changes: 1 addition & 1 deletion src/mock/server_options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mock
import (
"testing"

"github.com/google/go-github/v59/github"
"github.com/google/go-github/v61/github"
"github.com/gorilla/mux"
)

Expand Down
2 changes: 1 addition & 1 deletion src/mock/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
"testing"

"github.com/google/go-github/v59/github"
"github.com/google/go-github/v61/github"
)

func TestNewMockedHTTPClient(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion src/mock/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"net/http"

"github.com/google/go-github/v59/github"
"github.com/google/go-github/v61/github"
)

// MustMarshal helper function that wraps json.Marshal
Expand Down

0 comments on commit 12eaf76

Please sign in to comment.