diff --git a/github/config.go b/github/config.go index 37bc75321e..8fe689ed67 100644 --- a/github/config.go +++ b/github/config.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging" "github.com/shurcooL/githubv4" "golang.org/x/oauth2" @@ -112,6 +112,9 @@ func (c *Config) NewRESTClient(client *http.Client) (*github.Client, error) { v3client.BaseURL = uv3 + //disabling go-github level retry check as retry check is performed at the transport layer of this provider + v3client.DisableRateLimitCheck = true + return v3client, nil } @@ -156,7 +159,6 @@ func (c *Config) Meta() (interface{}, error) { if err != nil { return nil, err } - v4client, err := c.NewGraphQLClient(client) if err != nil { return nil, err diff --git a/github/data_source_github_actions_environment_secrets.go b/github/data_source_github_actions_environment_secrets.go index 80b40c549c..17276f7365 100644 --- a/github/data_source_github_actions_environment_secrets.go +++ b/github/data_source_github_actions_environment_secrets.go @@ -5,7 +5,7 @@ import ( "fmt" "net/url" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_actions_environment_variables.go b/github/data_source_github_actions_environment_variables.go index 1a161e5c56..10a6066d47 100644 --- a/github/data_source_github_actions_environment_variables.go +++ b/github/data_source_github_actions_environment_variables.go @@ -5,7 +5,7 @@ import ( "fmt" "net/url" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_actions_organization_secrets.go b/github/data_source_github_actions_organization_secrets.go index 6e1efd9119..0a83d7fe17 100644 --- a/github/data_source_github_actions_organization_secrets.go +++ b/github/data_source_github_actions_organization_secrets.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_actions_organization_variables.go b/github/data_source_github_actions_organization_variables.go index 1b99598f30..73f13e890a 100644 --- a/github/data_source_github_actions_organization_variables.go +++ b/github/data_source_github_actions_organization_variables.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_actions_secrets.go b/github/data_source_github_actions_secrets.go index 8c719168b3..bb85b15019 100644 --- a/github/data_source_github_actions_secrets.go +++ b/github/data_source_github_actions_secrets.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_actions_variables.go b/github/data_source_github_actions_variables.go index 0319e27454..2ef93d9468 100644 --- a/github/data_source_github_actions_variables.go +++ b/github/data_source_github_actions_variables.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_app_token_test.go b/github/data_source_github_app_token_test.go index d6a693eb53..ae639c7108 100644 --- a/github/data_source_github_app_token_test.go +++ b/github/data_source_github_app_token_test.go @@ -7,7 +7,7 @@ import ( "os" "testing" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/stretchr/testify/assert" ) diff --git a/github/data_source_github_branch.go b/github/data_source_github_branch.go index e8fc1c747d..c75f0d9789 100644 --- a/github/data_source_github_branch.go +++ b/github/data_source_github_branch.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_codespaces_organization_secrets.go b/github/data_source_github_codespaces_organization_secrets.go index be8c6c58a5..cfaec1e725 100644 --- a/github/data_source_github_codespaces_organization_secrets.go +++ b/github/data_source_github_codespaces_organization_secrets.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_codespaces_secrets.go b/github/data_source_github_codespaces_secrets.go index 51160c13dd..7f2b7570ad 100644 --- a/github/data_source_github_codespaces_secrets.go +++ b/github/data_source_github_codespaces_secrets.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_codespaces_user_secrets.go b/github/data_source_github_codespaces_user_secrets.go index 567ed750c8..ee7c9cd5d7 100644 --- a/github/data_source_github_codespaces_user_secrets.go +++ b/github/data_source_github_codespaces_user_secrets.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_collaborators.go b/github/data_source_github_collaborators.go index c381f25590..fd478c86de 100644 --- a/github/data_source_github_collaborators.go +++ b/github/data_source_github_collaborators.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/data_source_github_dependabot_organization_secrets.go b/github/data_source_github_dependabot_organization_secrets.go index 1c15acecb4..745fc2b33d 100644 --- a/github/data_source_github_dependabot_organization_secrets.go +++ b/github/data_source_github_dependabot_organization_secrets.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_dependabot_secrets.go b/github/data_source_github_dependabot_secrets.go index 6e5a614148..f8c89c07f5 100644 --- a/github/data_source_github_dependabot_secrets.go +++ b/github/data_source_github_dependabot_secrets.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_external_groups.go b/github/data_source_github_external_groups.go index ac0833bb0f..3738526827 100644 --- a/github/data_source_github_external_groups.go +++ b/github/data_source_github_external_groups.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_issue_labels.go b/github/data_source_github_issue_labels.go index a17ee429c3..dadd7941df 100644 --- a/github/data_source_github_issue_labels.go +++ b/github/data_source_github_issue_labels.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_organization.go b/github/data_source_github_organization.go index 3869ff4ef5..6ceec87b03 100644 --- a/github/data_source_github_organization.go +++ b/github/data_source_github_organization.go @@ -3,7 +3,7 @@ package github import ( "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/shurcooL/githubv4" ) diff --git a/github/data_source_github_organization_custom_role.go b/github/data_source_github_organization_custom_role.go index a2ae97ffeb..2c1630b048 100644 --- a/github/data_source_github_organization_custom_role.go +++ b/github/data_source_github_organization_custom_role.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_organization_team_sync_groups.go b/github/data_source_github_organization_team_sync_groups.go index 07c08b67e3..d9a10a934f 100644 --- a/github/data_source_github_organization_team_sync_groups.go +++ b/github/data_source_github_organization_team_sync_groups.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_organization_webhooks.go b/github/data_source_github_organization_webhooks.go index 46e039273e..9f3184b8ce 100644 --- a/github/data_source_github_organization_webhooks.go +++ b/github/data_source_github_organization_webhooks.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_ref.go b/github/data_source_github_ref.go index dd148432ff..8c446c359e 100644 --- a/github/data_source_github_ref.go +++ b/github/data_source_github_ref.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_release.go b/github/data_source_github_release.go index c7c95c396a..0e3edd6c26 100644 --- a/github/data_source_github_release.go +++ b/github/data_source_github_release.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_repositories.go b/github/data_source_github_repositories.go index 38d56a5600..dec46f6ae0 100644 --- a/github/data_source_github_repositories.go +++ b/github/data_source_github_repositories.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/data_source_github_repository.go b/github/data_source_github_repository.go index ed2a30143b..1c981c2d5a 100644 --- a/github/data_source_github_repository.go +++ b/github/data_source_github_repository.go @@ -7,7 +7,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_repository_autolink_references.go b/github/data_source_github_repository_autolink_references.go index 3fd8136d9b..d17f53ba07 100644 --- a/github/data_source_github_repository_autolink_references.go +++ b/github/data_source_github_repository_autolink_references.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_repository_branches.go b/github/data_source_github_repository_branches.go index 91f527f2e1..48ce119da0 100644 --- a/github/data_source_github_repository_branches.go +++ b/github/data_source_github_repository_branches.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_repository_custom_properties.go b/github/data_source_github_repository_custom_properties.go index d4622861ff..0271324fca 100644 --- a/github/data_source_github_repository_custom_properties.go +++ b/github/data_source_github_repository_custom_properties.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_repository_deploy_keys.go b/github/data_source_github_repository_deploy_keys.go index df23755860..fbdc137749 100644 --- a/github/data_source_github_repository_deploy_keys.go +++ b/github/data_source_github_repository_deploy_keys.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_repository_environments.go b/github/data_source_github_repository_environments.go index 13e5dd8465..f9f70008f3 100644 --- a/github/data_source_github_repository_environments.go +++ b/github/data_source_github_repository_environments.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_repository_file.go b/github/data_source_github_repository_file.go index 27f9f5ceed..2352c0e060 100644 --- a/github/data_source_github_repository_file.go +++ b/github/data_source_github_repository_file.go @@ -8,7 +8,7 @@ import ( "net/url" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_repository_file_test.go b/github/data_source_github_repository_file_test.go index c4b3005a59..ee594f38c7 100644 --- a/github/data_source_github_repository_file_test.go +++ b/github/data_source_github_repository_file_test.go @@ -9,7 +9,7 @@ import ( "net/url" "testing" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/stretchr/testify/assert" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" diff --git a/github/data_source_github_repository_pull_requests.go b/github/data_source_github_repository_pull_requests.go index c7053ddc52..33d7610504 100644 --- a/github/data_source_github_repository_pull_requests.go +++ b/github/data_source_github_repository_pull_requests.go @@ -4,7 +4,7 @@ import ( "context" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/data_source_github_repository_teams.go b/github/data_source_github_repository_teams.go index 0354ae13e6..86fcc09dc7 100644 --- a/github/data_source_github_repository_teams.go +++ b/github/data_source_github_repository_teams.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_repository_webhooks.go b/github/data_source_github_repository_webhooks.go index 2b0b248504..a5e5133415 100644 --- a/github/data_source_github_repository_webhooks.go +++ b/github/data_source_github_repository_webhooks.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_team.go b/github/data_source_github_team.go index ea1ca66c39..c337ba543a 100644 --- a/github/data_source_github_team.go +++ b/github/data_source_github_team.go @@ -4,7 +4,7 @@ import ( "context" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/shurcooL/githubv4" diff --git a/github/repository_utils.go b/github/repository_utils.go index 7086a7b25a..6f5b8e9640 100644 --- a/github/repository_utils.go +++ b/github/repository_utils.go @@ -6,7 +6,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" ) // checkRepositoryBranchExists tests if a branch exists in a repository. diff --git a/github/resource_github_actions_environment_secret.go b/github/resource_github_actions_environment_secret.go index 1558084996..42f946bc4e 100644 --- a/github/resource_github_actions_environment_secret.go +++ b/github/resource_github_actions_environment_secret.go @@ -7,7 +7,7 @@ import ( "net/http" "net/url" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_actions_environment_variable.go b/github/resource_github_actions_environment_variable.go index a4b8132fdc..dde058cc19 100644 --- a/github/resource_github_actions_environment_variable.go +++ b/github/resource_github_actions_environment_variable.go @@ -6,7 +6,7 @@ import ( "net/http" "net/url" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_actions_organization_oidc_subject_claim_customization_template.go b/github/resource_github_actions_organization_oidc_subject_claim_customization_template.go index c4983efd9e..150d372c50 100644 --- a/github/resource_github_actions_organization_oidc_subject_claim_customization_template.go +++ b/github/resource_github_actions_organization_oidc_subject_claim_customization_template.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_actions_organization_permissions.go b/github/resource_github_actions_organization_permissions.go index 9f5174d8b3..e8e39173cd 100644 --- a/github/resource_github_actions_organization_permissions.go +++ b/github/resource_github_actions_organization_permissions.go @@ -5,7 +5,7 @@ import ( "errors" "log" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_actions_organization_secret.go b/github/resource_github_actions_organization_secret.go index 4c196f218d..8e1c1d2416 100644 --- a/github/resource_github_actions_organization_secret.go +++ b/github/resource_github_actions_organization_secret.go @@ -7,7 +7,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_actions_organization_secret_repositories.go b/github/resource_github_actions_organization_secret_repositories.go index 5328ffefee..7f903de820 100644 --- a/github/resource_github_actions_organization_secret_repositories.go +++ b/github/resource_github_actions_organization_secret_repositories.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_actions_organization_variable.go b/github/resource_github_actions_organization_variable.go index 2de03600d4..ef482711d5 100644 --- a/github/resource_github_actions_organization_variable.go +++ b/github/resource_github_actions_organization_variable.go @@ -6,7 +6,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_actions_repository_access_level.go b/github/resource_github_actions_repository_access_level.go index a6a8d72ceb..af37eadb1b 100644 --- a/github/resource_github_actions_repository_access_level.go +++ b/github/resource_github_actions_repository_access_level.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_actions_repository_oidc_subject_claim_customization_template.go b/github/resource_github_actions_repository_oidc_subject_claim_customization_template.go index c9f889b793..bbe3973158 100644 --- a/github/resource_github_actions_repository_oidc_subject_claim_customization_template.go +++ b/github/resource_github_actions_repository_oidc_subject_claim_customization_template.go @@ -4,7 +4,7 @@ import ( "context" "errors" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_actions_repository_permissions.go b/github/resource_github_actions_repository_permissions.go index c55ea7d289..3cbdd94c7e 100644 --- a/github/resource_github_actions_repository_permissions.go +++ b/github/resource_github_actions_repository_permissions.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_actions_runner_group.go b/github/resource_github_actions_runner_group.go index 0675429ea3..cf54989889 100644 --- a/github/resource_github_actions_runner_group.go +++ b/github/resource_github_actions_runner_group.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_actions_secret.go b/github/resource_github_actions_secret.go index 79fea4f729..e22f128771 100644 --- a/github/resource_github_actions_secret.go +++ b/github/resource_github_actions_secret.go @@ -8,7 +8,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "golang.org/x/crypto/nacl/box" ) diff --git a/github/resource_github_actions_variable.go b/github/resource_github_actions_variable.go index e8fa5c44a6..f72f2e32f4 100644 --- a/github/resource_github_actions_variable.go +++ b/github/resource_github_actions_variable.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_app_installation_repositories.go b/github/resource_github_app_installation_repositories.go index b84aa6eaa5..e563bcf453 100644 --- a/github/resource_github_app_installation_repositories.go +++ b/github/resource_github_app_installation_repositories.go @@ -5,7 +5,7 @@ import ( "log" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_app_installation_repository.go b/github/resource_github_app_installation_repository.go index 5b3ec71b1b..6f0798752d 100644 --- a/github/resource_github_app_installation_repository.go +++ b/github/resource_github_app_installation_repository.go @@ -5,7 +5,7 @@ import ( "log" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_branch.go b/github/resource_github_branch.go index 8e28c40588..e9b8a0f1a3 100644 --- a/github/resource_github_branch.go +++ b/github/resource_github_branch.go @@ -7,7 +7,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_branch_default.go b/github/resource_github_branch_default.go index 27781d275d..2f4797ccdf 100644 --- a/github/resource_github_branch_default.go +++ b/github/resource_github_branch_default.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_branch_protection_v3.go b/github/resource_github_branch_protection_v3.go index 9c4942d473..b4c9963f92 100644 --- a/github/resource_github_branch_protection_v3.go +++ b/github/resource_github_branch_protection_v3.go @@ -6,7 +6,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_branch_protection_v3_utils.go b/github/resource_github_branch_protection_v3_utils.go index 94f2ae8242..ea152d606b 100644 --- a/github/resource_github_branch_protection_v3_utils.go +++ b/github/resource_github_branch_protection_v3_utils.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_codespaces_organization_secret.go b/github/resource_github_codespaces_organization_secret.go index 95e997a330..77a5048a35 100644 --- a/github/resource_github_codespaces_organization_secret.go +++ b/github/resource_github_codespaces_organization_secret.go @@ -7,7 +7,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_codespaces_organization_secret_repositories.go b/github/resource_github_codespaces_organization_secret_repositories.go index 2712dbe330..91829e84f5 100644 --- a/github/resource_github_codespaces_organization_secret_repositories.go +++ b/github/resource_github_codespaces_organization_secret_repositories.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_codespaces_secret.go b/github/resource_github_codespaces_secret.go index 0090bb970c..d717282752 100644 --- a/github/resource_github_codespaces_secret.go +++ b/github/resource_github_codespaces_secret.go @@ -8,7 +8,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_codespaces_user_secret.go b/github/resource_github_codespaces_user_secret.go index dd0fde57ca..85f504449c 100644 --- a/github/resource_github_codespaces_user_secret.go +++ b/github/resource_github_codespaces_user_secret.go @@ -6,7 +6,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_dependabot_organization_secret.go b/github/resource_github_dependabot_organization_secret.go index 66d751a313..21c1b3fe4f 100644 --- a/github/resource_github_dependabot_organization_secret.go +++ b/github/resource_github_dependabot_organization_secret.go @@ -7,7 +7,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_dependabot_organization_secret_repositories.go b/github/resource_github_dependabot_organization_secret_repositories.go index c70fd9d189..4ab8577a50 100644 --- a/github/resource_github_dependabot_organization_secret_repositories.go +++ b/github/resource_github_dependabot_organization_secret_repositories.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_dependabot_secret.go b/github/resource_github_dependabot_secret.go index f2bc973aa4..9f789449c2 100644 --- a/github/resource_github_dependabot_secret.go +++ b/github/resource_github_dependabot_secret.go @@ -8,7 +8,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "golang.org/x/crypto/nacl/box" ) diff --git a/github/resource_github_emu_group_mapping.go b/github/resource_github_emu_group_mapping.go index f361e6fcad..8492f7ebc2 100644 --- a/github/resource_github_emu_group_mapping.go +++ b/github/resource_github_emu_group_mapping.go @@ -5,7 +5,7 @@ import ( "fmt" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_enterprise_actions_permissions.go b/github/resource_github_enterprise_actions_permissions.go index 7a7a78fcc1..1e186c21f2 100644 --- a/github/resource_github_enterprise_actions_permissions.go +++ b/github/resource_github_enterprise_actions_permissions.go @@ -4,7 +4,7 @@ import ( "context" "errors" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_enterprise_actions_runner_group.go b/github/resource_github_enterprise_actions_runner_group.go index a8350f7339..b2f0d95efb 100644 --- a/github/resource_github_enterprise_actions_runner_group.go +++ b/github/resource_github_enterprise_actions_runner_group.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_enterprise_organization.go b/github/resource_github_enterprise_organization.go index 041fdf1926..685806d4c3 100644 --- a/github/resource_github_enterprise_organization.go +++ b/github/resource_github_enterprise_organization.go @@ -6,7 +6,7 @@ import ( "log" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/shurcooL/githubv4" ) diff --git a/github/resource_github_issue.go b/github/resource_github_issue.go index 74811ba103..f3775b328e 100644 --- a/github/resource_github_issue.go +++ b/github/resource_github_issue.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_issue_label.go b/github/resource_github_issue_label.go index 47b5c7bc1a..849b435783 100644 --- a/github/resource_github_issue_label.go +++ b/github/resource_github_issue_label.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_issue_labels.go b/github/resource_github_issue_labels.go index 4351b40328..e2a61c78ec 100644 --- a/github/resource_github_issue_labels.go +++ b/github/resource_github_issue_labels.go @@ -5,7 +5,7 @@ import ( "log" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_membership.go b/github/resource_github_membership.go index de8f8addbb..5d774b6f79 100644 --- a/github/resource_github_membership.go +++ b/github/resource_github_membership.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_membership_test.go b/github/resource_github_membership_test.go index 33064f89b7..bf0802f219 100644 --- a/github/resource_github_membership_test.go +++ b/github/resource_github_membership_test.go @@ -6,7 +6,7 @@ import ( "fmt" "testing" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) diff --git a/github/resource_github_organization_custom_role.go b/github/resource_github_organization_custom_role.go index 8bed03804d..a98c3260d8 100644 --- a/github/resource_github_organization_custom_role.go +++ b/github/resource_github_organization_custom_role.go @@ -6,7 +6,7 @@ import ( "log" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_organization_project.go b/github/resource_github_organization_project.go index 9e4aa15e73..d616df4bc4 100644 --- a/github/resource_github_organization_project.go +++ b/github/resource_github_organization_project.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_organization_project_test.go b/github/resource_github_organization_project_test.go index f8e9e9eb42..abd5427136 100644 --- a/github/resource_github_organization_project_test.go +++ b/github/resource_github_organization_project_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) diff --git a/github/resource_github_organization_ruleset.go b/github/resource_github_organization_ruleset.go index 014b28ef65..57142a5872 100644 --- a/github/resource_github_organization_ruleset.go +++ b/github/resource_github_organization_ruleset.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_organization_security_manager.go b/github/resource_github_organization_security_manager.go index 9e0af73de8..44faa3f99e 100644 --- a/github/resource_github_organization_security_manager.go +++ b/github/resource_github_organization_security_manager.go @@ -6,7 +6,7 @@ import ( "log" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_organization_settings.go b/github/resource_github_organization_settings.go index 1af2b56e33..4badd31a4d 100644 --- a/github/resource_github_organization_settings.go +++ b/github/resource_github_organization_settings.go @@ -5,7 +5,7 @@ import ( "log" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_organization_webhook.go b/github/resource_github_organization_webhook.go index e263fca001..23a7e3f615 100644 --- a/github/resource_github_organization_webhook.go +++ b/github/resource_github_organization_webhook.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_project_card.go b/github/resource_github_project_card.go index 8b6dfec17c..a7486a97f2 100644 --- a/github/resource_github_project_card.go +++ b/github/resource_github_project_card.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_project_column.go b/github/resource_github_project_column.go index fa54106fe2..a8376357a7 100644 --- a/github/resource_github_project_column.go +++ b/github/resource_github_project_column.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_project_column_test.go b/github/resource_github_project_column_test.go index bc2e0dc75d..88a1392f1e 100644 --- a/github/resource_github_project_column_test.go +++ b/github/resource_github_project_column_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) diff --git a/github/resource_github_release.go b/github/resource_github_release.go index c70431d3ae..5bada0d1e4 100644 --- a/github/resource_github_release.go +++ b/github/resource_github_release.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_repository.go b/github/resource_github_repository.go index f28cc4c6e8..ada84b612a 100644 --- a/github/resource_github_repository.go +++ b/github/resource_github_repository.go @@ -9,7 +9,7 @@ import ( "regexp" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_repository_autolink_reference.go b/github/resource_github_repository_autolink_reference.go index e249e19550..d80f02f3c0 100644 --- a/github/resource_github_repository_autolink_reference.go +++ b/github/resource_github_repository_autolink_reference.go @@ -9,7 +9,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_repository_collaborator.go b/github/resource_github_repository_collaborator.go index b8e798805d..e04ebe69b3 100644 --- a/github/resource_github_repository_collaborator.go +++ b/github/resource_github_repository_collaborator.go @@ -7,7 +7,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_repository_collaborators.go b/github/resource_github_repository_collaborators.go index 54ee75d119..33ab1e36bc 100644 --- a/github/resource_github_repository_collaborators.go +++ b/github/resource_github_repository_collaborators.go @@ -8,7 +8,7 @@ import ( "sort" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_repository_collaborators_test.go b/github/resource_github_repository_collaborators_test.go index 53c6694bc3..c2efb4e814 100644 --- a/github/resource_github_repository_collaborators_test.go +++ b/github/resource_github_repository_collaborators_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" diff --git a/github/resource_github_repository_custom_property.go b/github/resource_github_repository_custom_property.go index 6de2a7dcee..c0cb380d34 100644 --- a/github/resource_github_repository_custom_property.go +++ b/github/resource_github_repository_custom_property.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_repository_deploy_key.go b/github/resource_github_repository_deploy_key.go index 4d970711fb..f4696042de 100644 --- a/github/resource_github_repository_deploy_key.go +++ b/github/resource_github_repository_deploy_key.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_repository_deployment_branch_policy.go b/github/resource_github_repository_deployment_branch_policy.go index 12cd03c9db..a418b1cf35 100644 --- a/github/resource_github_repository_deployment_branch_policy.go +++ b/github/resource_github_repository_deployment_branch_policy.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_repository_environment.go b/github/resource_github_repository_environment.go index 305087257b..f9bb4aacab 100644 --- a/github/resource_github_repository_environment.go +++ b/github/resource_github_repository_environment.go @@ -6,7 +6,7 @@ import ( "net/http" "net/url" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_repository_environment_deployment_policy.go b/github/resource_github_repository_environment_deployment_policy.go index bfe6f619df..993f317d14 100644 --- a/github/resource_github_repository_environment_deployment_policy.go +++ b/github/resource_github_repository_environment_deployment_policy.go @@ -8,7 +8,7 @@ import ( "net/url" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_repository_file.go b/github/resource_github_repository_file.go index c84a8a1953..2504e956d7 100644 --- a/github/resource_github_repository_file.go +++ b/github/resource_github_repository_file.go @@ -10,7 +10,7 @@ import ( "fmt" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_repository_milestone.go b/github/resource_github_repository_milestone.go index f4e72798b2..922a6aa76c 100644 --- a/github/resource_github_repository_milestone.go +++ b/github/resource_github_repository_milestone.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_repository_project.go b/github/resource_github_repository_project.go index 278900c7fe..81cdcebd66 100644 --- a/github/resource_github_repository_project.go +++ b/github/resource_github_repository_project.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_repository_pull_request.go b/github/resource_github_repository_pull_request.go index 385824a5cd..d95b4f3839 100644 --- a/github/resource_github_repository_pull_request.go +++ b/github/resource_github_repository_pull_request.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_repository_ruleset.go b/github/resource_github_repository_ruleset.go index cac6630249..0f2e361aa4 100644 --- a/github/resource_github_repository_ruleset.go +++ b/github/resource_github_repository_ruleset.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_repository_topics.go b/github/resource_github_repository_topics.go index e8cee9a68b..4f03a43af4 100644 --- a/github/resource_github_repository_topics.go +++ b/github/resource_github_repository_topics.go @@ -6,7 +6,7 @@ import ( "net/http" "regexp" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_repository_webhook.go b/github/resource_github_repository_webhook.go index a6c516d439..96c79c73f7 100644 --- a/github/resource_github_repository_webhook.go +++ b/github/resource_github_repository_webhook.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_team.go b/github/resource_github_team.go index d862540afd..0f445ee3fa 100644 --- a/github/resource_github_team.go +++ b/github/resource_github_team.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/shurcooL/githubv4" diff --git a/github/resource_github_team_members.go b/github/resource_github_team_members.go index 54c39eb0cf..fff76724e9 100644 --- a/github/resource_github_team_members.go +++ b/github/resource_github_team_members.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/shurcooL/githubv4" ) diff --git a/github/resource_github_team_members_test.go b/github/resource_github_team_members_test.go index fc9a1ff568..927ab06375 100644 --- a/github/resource_github_team_members_test.go +++ b/github/resource_github_team_members_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" diff --git a/github/resource_github_team_membership.go b/github/resource_github_team_membership.go index 6001c2fca3..81cce81806 100644 --- a/github/resource_github_team_membership.go +++ b/github/resource_github_team_membership.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_team_membership_test.go b/github/resource_github_team_membership_test.go index 13c113722e..c876506af9 100644 --- a/github/resource_github_team_membership_test.go +++ b/github/resource_github_team_membership_test.go @@ -7,7 +7,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" diff --git a/github/resource_github_team_repository.go b/github/resource_github_team_repository.go index 65aeff843d..22fa2b5a63 100644 --- a/github/resource_github_team_repository.go +++ b/github/resource_github_team_repository.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_team_sync_group_mapping.go b/github/resource_github_team_sync_group_mapping.go index e9a4482df6..35793b209f 100644 --- a/github/resource_github_team_sync_group_mapping.go +++ b/github/resource_github_team_sync_group_mapping.go @@ -6,7 +6,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_team_sync_group_mapping_test.go b/github/resource_github_team_sync_group_mapping_test.go index a0488f2080..ae9fcf74c3 100644 --- a/github/resource_github_team_sync_group_mapping_test.go +++ b/github/resource_github_team_sync_group_mapping_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" diff --git a/github/resource_github_user_gpg_key.go b/github/resource_github_user_gpg_key.go index ba9c0adb4c..b69d77ab5d 100644 --- a/github/resource_github_user_gpg_key.go +++ b/github/resource_github_user_gpg_key.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_user_ssh_key.go b/github/resource_github_user_ssh_key.go index 7e196ab234..ab039691df 100644 --- a/github/resource_github_user_ssh_key.go +++ b/github/resource_github_user_ssh_key.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_organization_block.go b/github/resource_organization_block.go index 33bfe0f7ed..ffac677bba 100644 --- a/github/resource_organization_block.go +++ b/github/resource_organization_block.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/respository_rules_utils.go b/github/respository_rules_utils.go index 44ccb27de1..7cee27ef5f 100644 --- a/github/respository_rules_utils.go +++ b/github/respository_rules_utils.go @@ -6,11 +6,11 @@ import ( "reflect" "sort" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourceGithubRulesetObject(d *schema.ResourceData, org string) *github.Ruleset { +func resourceGithubRulesetObject(d *schema.ResourceData, org string) *github.RulesetTarget { isOrgLevel := len(org) > 0 var source, sourceType string @@ -22,7 +22,7 @@ func resourceGithubRulesetObject(d *schema.ResourceData, org string) *github.Rul sourceType = "Repository" } - return &github.Ruleset{ + return &github.RulesetTarget{ Name: d.Get("name").(string), Target: github.String(d.Get("target").(string)), Source: source, diff --git a/github/transport.go b/github/transport.go index d091fc01bd..e88bbaa59b 100644 --- a/github/transport.go +++ b/github/transport.go @@ -8,7 +8,7 @@ import ( "sync" "time" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" ) const ( diff --git a/github/transport_test.go b/github/transport_test.go index 47b6fd257e..7352e881b1 100644 --- a/github/transport_test.go +++ b/github/transport_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" ) func TestEtagTransport(t *testing.T) { diff --git a/github/util.go b/github/util.go index 321a201fb4..a3748fb336 100644 --- a/github/util.go +++ b/github/util.go @@ -12,7 +12,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v74/github" "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/go.mod b/go.mod index 7e6346a1fd..4fcee9eb83 100644 --- a/go.mod +++ b/go.mod @@ -1,14 +1,14 @@ module github.com/integrations/terraform-provider-github/v6 -go 1.21 +go 1.23.0 -toolchain go1.22.0 +toolchain go1.24.5 require ( github.com/client9/misspell v0.3.4 github.com/go-jose/go-jose/v3 v3.0.3 github.com/golangci/golangci-lint v1.59.1 - github.com/google/go-github/v66 v66.0.1-0.20241027130611-9e5757d5a766 + github.com/google/go-github/v74 v74.0.0 github.com/google/uuid v1.6.0 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 @@ -87,7 +87,7 @@ require ( github.com/golangci/plugin-module-register v0.1.1 // indirect github.com/golangci/revgrep v0.5.3 // indirect github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed // indirect - github.com/google/go-cmp v0.6.0 // indirect + github.com/google/go-cmp v0.7.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/gordonklaus/ineffassign v0.1.0 // indirect github.com/gostaticanalysis/analysisutil v0.7.1 // indirect diff --git a/go.sum b/go.sum index 833e973361..e88a1cdc28 100644 --- a/go.sum +++ b/go.sum @@ -288,10 +288,10 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -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/v66 v66.0.1-0.20241027130611-9e5757d5a766 h1:Ne77zoI0NHPnZ/GPRzTVsedUUrkrI2UcnS821dfqp28= -github.com/google/go-github/v66 v66.0.1-0.20241027130611-9e5757d5a766/go.mod h1:+4SO9Zkuyf8ytMj0csN1NR/5OTR+MfqPp8P8dVlcvY4= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/go-github/v74 v74.0.0 h1:yZcddTUn8DPbj11GxnMrNiAnXH14gNs559AsUpNpPgM= +github.com/google/go-github/v74 v74.0.0/go.mod h1:ubn/YdyftV80VPSI26nSJvaEsTOnsjrxG3o9kJhcyak= 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/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= diff --git a/vendor/github.com/google/go-cmp/cmp/internal/function/func.go b/vendor/github.com/google/go-cmp/cmp/internal/function/func.go index d127d43623..def01a6be3 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/function/func.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/function/func.go @@ -19,6 +19,7 @@ const ( tbFunc // func(T) bool ttbFunc // func(T, T) bool + ttiFunc // func(T, T) int trbFunc // func(T, R) bool tibFunc // func(T, I) bool trFunc // func(T) R @@ -28,11 +29,13 @@ const ( Transformer = trFunc // func(T) R ValueFilter = ttbFunc // func(T, T) bool Less = ttbFunc // func(T, T) bool + Compare = ttiFunc // func(T, T) int ValuePredicate = tbFunc // func(T) bool KeyValuePredicate = trbFunc // func(T, R) bool ) var boolType = reflect.TypeOf(true) +var intType = reflect.TypeOf(0) // IsType reports whether the reflect.Type is of the specified function type. func IsType(t reflect.Type, ft funcType) bool { @@ -49,6 +52,10 @@ func IsType(t reflect.Type, ft funcType) bool { if ni == 2 && no == 1 && t.In(0) == t.In(1) && t.Out(0) == boolType { return true } + case ttiFunc: // func(T, T) int + if ni == 2 && no == 1 && t.In(0) == t.In(1) && t.Out(0) == intType { + return true + } case trbFunc: // func(T, R) bool if ni == 2 && no == 1 && t.Out(0) == boolType { return true diff --git a/vendor/github.com/google/go-cmp/cmp/options.go b/vendor/github.com/google/go-cmp/cmp/options.go index 754496f3b3..ba3fce81ff 100644 --- a/vendor/github.com/google/go-cmp/cmp/options.go +++ b/vendor/github.com/google/go-cmp/cmp/options.go @@ -232,7 +232,15 @@ func (validator) apply(s *state, vx, vy reflect.Value) { if t := s.curPath.Index(-2).Type(); t.Name() != "" { // Named type with unexported fields. name = fmt.Sprintf("%q.%v", t.PkgPath(), t.Name()) // e.g., "path/to/package".MyType - if _, ok := reflect.New(t).Interface().(error); ok { + isProtoMessage := func(t reflect.Type) bool { + m, ok := reflect.PointerTo(t).MethodByName("ProtoReflect") + return ok && m.Type.NumIn() == 1 && m.Type.NumOut() == 1 && + m.Type.Out(0).PkgPath() == "google.golang.org/protobuf/reflect/protoreflect" && + m.Type.Out(0).Name() == "Message" + } + if isProtoMessage(t) { + help = `consider using "google.golang.org/protobuf/testing/protocmp".Transform to compare proto.Message types` + } else if _, ok := reflect.New(t).Interface().(error); ok { help = "consider using cmpopts.EquateErrors to compare error values" } else if t.Comparable() { help = "consider using cmpopts.EquateComparable to compare comparable Go types" diff --git a/vendor/github.com/google/go-github/v66/github/actions_required_workflows.go b/vendor/github.com/google/go-github/v66/github/actions_required_workflows.go deleted file mode 100644 index b89741a82a..0000000000 --- a/vendor/github.com/google/go-github/v66/github/actions_required_workflows.go +++ /dev/null @@ -1,267 +0,0 @@ -// Copyright 2023 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package github - -import ( - "context" - "fmt" -) - -// OrgRequiredWorkflow represents a required workflow object at the org level. -type OrgRequiredWorkflow struct { - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Path *string `json:"path,omitempty"` - Scope *string `json:"scope,omitempty"` - Ref *string `json:"ref,omitempty"` - State *string `json:"state,omitempty"` - SelectedRepositoriesURL *string `json:"selected_repositories_url,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - Repository *Repository `json:"repository,omitempty"` -} - -// OrgRequiredWorkflows represents the required workflows for the org. -type OrgRequiredWorkflows struct { - TotalCount *int `json:"total_count,omitempty"` - RequiredWorkflows []*OrgRequiredWorkflow `json:"required_workflows,omitempty"` -} - -// CreateUpdateRequiredWorkflowOptions represents the input object used to create or update required workflows. -type CreateUpdateRequiredWorkflowOptions struct { - WorkflowFilePath *string `json:"workflow_file_path,omitempty"` - RepositoryID *int64 `json:"repository_id,omitempty"` - Scope *string `json:"scope,omitempty"` - SelectedRepositoryIDs *SelectedRepoIDs `json:"selected_repository_ids,omitempty"` -} - -// RequiredWorkflowSelectedRepos represents the repos that a required workflow is applied to. -type RequiredWorkflowSelectedRepos struct { - TotalCount *int `json:"total_count,omitempty"` - Repositories []*Repository `json:"repositories,omitempty"` -} - -// RepoRequiredWorkflow represents a required workflow object at the repo level. -type RepoRequiredWorkflow struct { - ID *int64 `json:"id,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Name *string `json:"name,omitempty"` - Path *string `json:"path,omitempty"` - State *string `json:"state,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - BadgeURL *string `json:"badge_url,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - SourceRepository *Repository `json:"source_repository,omitempty"` -} - -// RepoRequiredWorkflows represents the required workflows for a repo. -type RepoRequiredWorkflows struct { - TotalCount *int `json:"total_count,omitempty"` - RequiredWorkflows []*RepoRequiredWorkflow `json:"required_workflows,omitempty"` -} - -// ListOrgRequiredWorkflows lists the RequiredWorkflows for an org. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation GET /orgs/{org}/actions/required_workflows -func (s *ActionsService) ListOrgRequiredWorkflows(ctx context.Context, org string, opts *ListOptions) (*OrgRequiredWorkflows, *Response, error) { - url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) - u, err := addOptions(url, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - requiredWorkflows := new(OrgRequiredWorkflows) - resp, err := s.client.Do(ctx, req, &requiredWorkflows) - if err != nil { - return nil, resp, err - } - - return requiredWorkflows, resp, nil -} - -// CreateRequiredWorkflow creates the required workflow in an org. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation POST /orgs/{org}/actions/required_workflows -func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, createRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) { - url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) - req, err := s.client.NewRequest("POST", url, createRequiredWorkflowOptions) - if err != nil { - return nil, nil, err - } - - orgRequiredWorkflow := new(OrgRequiredWorkflow) - resp, err := s.client.Do(ctx, req, orgRequiredWorkflow) - if err != nil { - return nil, resp, err - } - - return orgRequiredWorkflow, resp, nil -} - -// GetRequiredWorkflowByID get the RequiredWorkflows for an org by its ID. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation GET /orgs/{org}/actions/required_workflows/{workflow_id} -func (s *ActionsService) GetRequiredWorkflowByID(ctx context.Context, owner string, requiredWorkflowID int64) (*OrgRequiredWorkflow, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", owner, requiredWorkflowID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - requiredWorkflow := new(OrgRequiredWorkflow) - resp, err := s.client.Do(ctx, req, &requiredWorkflow) - if err != nil { - return nil, resp, err - } - - return requiredWorkflow, resp, nil -} - -// UpdateRequiredWorkflow updates a required workflow in an org. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation PATCH /orgs/{org}/actions/required_workflows/{workflow_id} -func (s *ActionsService) UpdateRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64, updateRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) { - url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", org, requiredWorkflowID) - req, err := s.client.NewRequest("PATCH", url, updateRequiredWorkflowOptions) - if err != nil { - return nil, nil, err - } - - orgRequiredWorkflow := new(OrgRequiredWorkflow) - resp, err := s.client.Do(ctx, req, orgRequiredWorkflow) - if err != nil { - return nil, resp, err - } - - return orgRequiredWorkflow, resp, nil -} - -// DeleteRequiredWorkflow deletes a required workflow in an org. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation DELETE /orgs/{org}/actions/required_workflows/{workflow_id} -func (s *ActionsService) DeleteRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64) (*Response, error) { - url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", org, requiredWorkflowID) - req, err := s.client.NewRequest("DELETE", url, nil) - if err != nil { - return nil, err - } - return s.client.Do(ctx, req, nil) -} - -// ListRequiredWorkflowSelectedRepos lists the Repositories selected for a workflow. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation GET /orgs/{org}/actions/required_workflows/{workflow_id}/repositories -func (s *ActionsService) ListRequiredWorkflowSelectedRepos(ctx context.Context, org string, requiredWorkflowID int64, opts *ListOptions) (*RequiredWorkflowSelectedRepos, *Response, error) { - url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories", org, requiredWorkflowID) - u, err := addOptions(url, opts) - if err != nil { - return nil, nil, err - } - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - requiredWorkflowRepos := new(RequiredWorkflowSelectedRepos) - resp, err := s.client.Do(ctx, req, &requiredWorkflowRepos) - if err != nil { - return nil, resp, err - } - - return requiredWorkflowRepos, resp, nil -} - -// SetRequiredWorkflowSelectedRepos sets the Repositories selected for a workflow. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation PUT /orgs/{org}/actions/required_workflows/{workflow_id}/repositories -func (s *ActionsService) SetRequiredWorkflowSelectedRepos(ctx context.Context, org string, requiredWorkflowID int64, ids SelectedRepoIDs) (*Response, error) { - type repoIDs struct { - SelectedIDs SelectedRepoIDs `json:"selected_repository_ids"` - } - url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories", org, requiredWorkflowID) - req, err := s.client.NewRequest("PUT", url, repoIDs{SelectedIDs: ids}) - if err != nil { - return nil, err - } - - return s.client.Do(ctx, req, nil) -} - -// AddRepoToRequiredWorkflow adds the Repository to a required workflow. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation PUT /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} -func (s *ActionsService) AddRepoToRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID, repoID int64) (*Response, error) { - url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories/%v", org, requiredWorkflowID, repoID) - req, err := s.client.NewRequest("PUT", url, nil) - if err != nil { - return nil, err - } - return s.client.Do(ctx, req, nil) -} - -// RemoveRepoFromRequiredWorkflow removes the Repository from a required workflow. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation DELETE /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} -func (s *ActionsService) RemoveRepoFromRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID, repoID int64) (*Response, error) { - url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories/%v", org, requiredWorkflowID, repoID) - req, err := s.client.NewRequest("DELETE", url, nil) - if err != nil { - return nil, err - } - return s.client.Do(ctx, req, nil) -} - -// ListRepoRequiredWorkflows lists the RequiredWorkflows for a repo. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation GET /repos/{owner}/{repo}/actions/required_workflows -func (s *ActionsService) ListRepoRequiredWorkflows(ctx context.Context, owner, repo string, opts *ListOptions) (*RepoRequiredWorkflows, *Response, error) { - url := fmt.Sprintf("repos/%v/%v/actions/required_workflows", owner, repo) - u, err := addOptions(url, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - requiredWorkflows := new(RepoRequiredWorkflows) - resp, err := s.client.Do(ctx, req, &requiredWorkflows) - if err != nil { - return nil, resp, err - } - - return requiredWorkflows, resp, nil -} diff --git a/vendor/github.com/google/go-github/v66/github/dependency_graph.go b/vendor/github.com/google/go-github/v66/github/dependency_graph.go deleted file mode 100644 index 86a1fe48b9..0000000000 --- a/vendor/github.com/google/go-github/v66/github/dependency_graph.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2023 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package github - -import ( - "context" - "fmt" -) - -type DependencyGraphService service - -// SBOM represents a software bill of materials, which describes the -// packages/libraries that a repository depends on. -type SBOM struct { - SBOM *SBOMInfo `json:"sbom,omitempty"` -} - -// CreationInfo represents when the SBOM was created and who created it. -type CreationInfo struct { - Created *Timestamp `json:"created,omitempty"` - Creators []string `json:"creators,omitempty"` -} - -// RepoDependencies represents the dependencies of a repo. -type RepoDependencies struct { - SPDXID *string `json:"SPDXID,omitempty"` - // Package name - Name *string `json:"name,omitempty"` - VersionInfo *string `json:"versionInfo,omitempty"` - DownloadLocation *string `json:"downloadLocation,omitempty"` - FilesAnalyzed *bool `json:"filesAnalyzed,omitempty"` - LicenseConcluded *string `json:"licenseConcluded,omitempty"` - LicenseDeclared *string `json:"licenseDeclared,omitempty"` -} - -// SBOMInfo represents a software bill of materials (SBOM) using SPDX. -// SPDX is an open standard for SBOMs that -// identifies and catalogs components, licenses, copyrights, security -// references, and other metadata relating to software. -type SBOMInfo struct { - SPDXID *string `json:"SPDXID,omitempty"` - SPDXVersion *string `json:"spdxVersion,omitempty"` - CreationInfo *CreationInfo `json:"creationInfo,omitempty"` - - // Repo name - Name *string `json:"name,omitempty"` - DataLicense *string `json:"dataLicense,omitempty"` - DocumentDescribes []string `json:"documentDescribes,omitempty"` - DocumentNamespace *string `json:"documentNamespace,omitempty"` - - // List of packages dependencies - Packages []*RepoDependencies `json:"packages,omitempty"` -} - -func (s SBOM) String() string { - return Stringify(s) -} - -// GetSBOM fetches the software bill of materials for a repository. -// -// GitHub API docs: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository -// -//meta:operation GET /repos/{owner}/{repo}/dependency-graph/sbom -func (s *DependencyGraphService) GetSBOM(ctx context.Context, owner, repo string) (*SBOM, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/dependency-graph/sbom", owner, repo) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var sbom *SBOM - resp, err := s.client.Do(ctx, req, &sbom) - if err != nil { - return nil, resp, err - } - - return sbom, resp, nil -} diff --git a/vendor/github.com/google/go-github/v66/github/orgs_projects.go b/vendor/github.com/google/go-github/v66/github/orgs_projects.go deleted file mode 100644 index 454d8cf1c3..0000000000 --- a/vendor/github.com/google/go-github/v66/github/orgs_projects.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2017 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package github - -import ( - "context" - "fmt" -) - -// ListProjects lists the projects for an organization. -// -// GitHub API docs: https://docs.github.com/rest/projects/projects#list-organization-projects -// -//meta:operation GET /orgs/{org}/projects -func (s *OrganizationsService) ListProjects(ctx context.Context, org string, opts *ProjectListOptions) ([]*Project, *Response, error) { - u := fmt.Sprintf("orgs/%v/projects", org) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - var projects []*Project - resp, err := s.client.Do(ctx, req, &projects) - if err != nil { - return nil, resp, err - } - - return projects, resp, nil -} - -// CreateProject creates a GitHub Project for the specified organization. -// -// GitHub API docs: https://docs.github.com/rest/projects/projects#create-an-organization-project -// -//meta:operation POST /orgs/{org}/projects -func (s *OrganizationsService) CreateProject(ctx context.Context, org string, opts *ProjectOptions) (*Project, *Response, error) { - u := fmt.Sprintf("orgs/%v/projects", org) - req, err := s.client.NewRequest("POST", u, opts) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - project := &Project{} - resp, err := s.client.Do(ctx, req, project) - if err != nil { - return nil, resp, err - } - - return project, resp, nil -} diff --git a/vendor/github.com/google/go-github/v66/github/orgs_rules.go b/vendor/github.com/google/go-github/v66/github/orgs_rules.go deleted file mode 100644 index 37c06a7333..0000000000 --- a/vendor/github.com/google/go-github/v66/github/orgs_rules.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2023 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package github - -import ( - "context" - "fmt" -) - -// GetAllOrganizationRulesets gets all the rulesets for the specified organization. -// -// GitHub API docs: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets -// -//meta:operation GET /orgs/{org}/rulesets -func (s *OrganizationsService) GetAllOrganizationRulesets(ctx context.Context, org string) ([]*Ruleset, *Response, error) { - u := fmt.Sprintf("orgs/%v/rulesets", org) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var rulesets []*Ruleset - resp, err := s.client.Do(ctx, req, &rulesets) - if err != nil { - return nil, resp, err - } - - return rulesets, resp, nil -} - -// CreateOrganizationRuleset creates a ruleset for the specified organization. -// -// GitHub API docs: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset -// -//meta:operation POST /orgs/{org}/rulesets -func (s *OrganizationsService) CreateOrganizationRuleset(ctx context.Context, org string, rs *Ruleset) (*Ruleset, *Response, error) { - u := fmt.Sprintf("orgs/%v/rulesets", org) - - req, err := s.client.NewRequest("POST", u, rs) - if err != nil { - return nil, nil, err - } - - var ruleset *Ruleset - resp, err := s.client.Do(ctx, req, &ruleset) - if err != nil { - return nil, resp, err - } - - return ruleset, resp, nil -} - -// GetOrganizationRuleset gets a ruleset from the specified organization. -// -// GitHub API docs: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset -// -//meta:operation GET /orgs/{org}/rulesets/{ruleset_id} -func (s *OrganizationsService) GetOrganizationRuleset(ctx context.Context, org string, rulesetID int64) (*Ruleset, *Response, error) { - u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var ruleset *Ruleset - resp, err := s.client.Do(ctx, req, &ruleset) - if err != nil { - return nil, resp, err - } - - return ruleset, resp, nil -} - -// UpdateOrganizationRuleset updates a ruleset from the specified organization. -// -// GitHub API docs: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset -// -//meta:operation PUT /orgs/{org}/rulesets/{ruleset_id} -func (s *OrganizationsService) UpdateOrganizationRuleset(ctx context.Context, org string, rulesetID int64, rs *Ruleset) (*Ruleset, *Response, error) { - u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) - - req, err := s.client.NewRequest("PUT", u, rs) - if err != nil { - return nil, nil, err - } - - var ruleset *Ruleset - resp, err := s.client.Do(ctx, req, &ruleset) - if err != nil { - return nil, resp, err - } - - return ruleset, resp, nil -} - -// DeleteOrganizationRuleset deletes a ruleset from the specified organization. -// -// GitHub API docs: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset -// -//meta:operation DELETE /orgs/{org}/rulesets/{ruleset_id} -func (s *OrganizationsService) DeleteOrganizationRuleset(ctx context.Context, org string, rulesetID int64) (*Response, error) { - u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) - - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - return s.client.Do(ctx, req, nil) -} diff --git a/vendor/github.com/google/go-github/v66/github/packages.go b/vendor/github.com/google/go-github/v66/github/packages.go deleted file mode 100644 index ef7df07405..0000000000 --- a/vendor/github.com/google/go-github/v66/github/packages.go +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright 2020 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package github - -// Package represents a GitHub package. -type Package struct { - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - PackageType *string `json:"package_type,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - Owner *User `json:"owner,omitempty"` - PackageVersion *PackageVersion `json:"package_version,omitempty"` - Registry *PackageRegistry `json:"registry,omitempty"` - URL *string `json:"url,omitempty"` - VersionCount *int64 `json:"version_count,omitempty"` - Visibility *string `json:"visibility,omitempty"` - Repository *Repository `json:"repository,omitempty"` -} - -func (p Package) String() string { - return Stringify(p) -} - -// PackageVersion represents a GitHub package version. -type PackageVersion struct { - ID *int64 `json:"id,omitempty"` - Version *string `json:"version,omitempty"` - Summary *string `json:"summary,omitempty"` - Body *string `json:"body,omitempty"` - BodyHTML *string `json:"body_html,omitempty"` - Release *PackageRelease `json:"release,omitempty"` - Manifest *string `json:"manifest,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - TagName *string `json:"tag_name,omitempty"` - TargetCommitish *string `json:"target_commitish,omitempty"` - TargetOID *string `json:"target_oid,omitempty"` - Draft *bool `json:"draft,omitempty"` - Prerelease *bool `json:"prerelease,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - PackageFiles []*PackageFile `json:"package_files,omitempty"` - Author *User `json:"author,omitempty"` - InstallationCommand *string `json:"installation_command,omitempty"` - Metadata *PackageMetadata `json:"metadata,omitempty"` - PackageHTMLURL *string `json:"package_html_url,omitempty"` - Name *string `json:"name,omitempty"` - URL *string `json:"url,omitempty"` -} - -func (pv PackageVersion) String() string { - return Stringify(pv) -} - -// PackageRelease represents a GitHub package version release. -type PackageRelease struct { - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - ID *int64 `json:"id,omitempty"` - TagName *string `json:"tag_name,omitempty"` - TargetCommitish *string `json:"target_commitish,omitempty"` - Name *string `json:"name,omitempty"` - Draft *bool `json:"draft,omitempty"` - Author *User `json:"author,omitempty"` - Prerelease *bool `json:"prerelease,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - PublishedAt *Timestamp `json:"published_at,omitempty"` -} - -func (r PackageRelease) String() string { - return Stringify(r) -} - -// PackageFile represents a GitHub package version release file. -type PackageFile struct { - DownloadURL *string `json:"download_url,omitempty"` - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SHA256 *string `json:"sha256,omitempty"` - SHA1 *string `json:"sha1,omitempty"` - MD5 *string `json:"md5,omitempty"` - ContentType *string `json:"content_type,omitempty"` - State *string `json:"state,omitempty"` - Author *User `json:"author,omitempty"` - Size *int64 `json:"size,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` -} - -func (pf PackageFile) String() string { - return Stringify(pf) -} - -// PackageRegistry represents a GitHub package registry. -type PackageRegistry struct { - AboutURL *string `json:"about_url,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - URL *string `json:"url,omitempty"` - Vendor *string `json:"vendor,omitempty"` -} - -func (r PackageRegistry) String() string { - return Stringify(r) -} - -// PackageListOptions represents the optional list options for a package. -type PackageListOptions struct { - // Visibility of packages "public", "internal" or "private". - Visibility *string `url:"visibility,omitempty"` - - // PackageType represents the type of package. - // It can be one of "npm", "maven", "rubygems", "nuget", "docker", or "container". - PackageType *string `url:"package_type,omitempty"` - - // State of package either "active" or "deleted". - State *string `url:"state,omitempty"` - - ListOptions -} - -// PackageMetadata represents metadata from a package. -type PackageMetadata struct { - PackageType *string `json:"package_type,omitempty"` - Container *PackageContainerMetadata `json:"container,omitempty"` -} - -func (r PackageMetadata) String() string { - return Stringify(r) -} - -// PackageContainerMetadata represents container metadata for docker container packages. -type PackageContainerMetadata struct { - Tags []string `json:"tags,omitempty"` -} - -func (r PackageContainerMetadata) String() string { - return Stringify(r) -} diff --git a/vendor/github.com/google/go-github/v66/github/projects.go b/vendor/github.com/google/go-github/v66/github/projects.go deleted file mode 100644 index c5c42f8939..0000000000 --- a/vendor/github.com/google/go-github/v66/github/projects.go +++ /dev/null @@ -1,634 +0,0 @@ -// Copyright 2016 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package github - -import ( - "context" - "fmt" -) - -// ProjectsService provides access to the projects functions in the -// GitHub API. -// -// GitHub API docs: https://docs.github.com/rest/projects -type ProjectsService service - -// Project represents a GitHub Project. -type Project struct { - ID *int64 `json:"id,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - ColumnsURL *string `json:"columns_url,omitempty"` - OwnerURL *string `json:"owner_url,omitempty"` - Name *string `json:"name,omitempty"` - Body *string `json:"body,omitempty"` - Number *int `json:"number,omitempty"` - State *string `json:"state,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - NodeID *string `json:"node_id,omitempty"` - OrganizationPermission *string `json:"organization_permission,omitempty"` - Private *bool `json:"private,omitempty"` - - // The User object that generated the project. - Creator *User `json:"creator,omitempty"` -} - -func (p Project) String() string { - return Stringify(p) -} - -// GetProject gets a GitHub Project for a repo. -// -// GitHub API docs: https://docs.github.com/rest/projects/projects#get-a-project -// -//meta:operation GET /projects/{project_id} -func (s *ProjectsService) GetProject(ctx context.Context, id int64) (*Project, *Response, error) { - u := fmt.Sprintf("projects/%v", id) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - project := &Project{} - resp, err := s.client.Do(ctx, req, project) - if err != nil { - return nil, resp, err - } - - return project, resp, nil -} - -// ProjectOptions specifies the parameters to the -// RepositoriesService.CreateProject and -// ProjectsService.UpdateProject methods. -type ProjectOptions struct { - // The name of the project. (Required for creation; optional for update.) - Name *string `json:"name,omitempty"` - // The body of the project. (Optional.) - Body *string `json:"body,omitempty"` - - // The following field(s) are only applicable for update. - // They should be left with zero values for creation. - - // State of the project. Either "open" or "closed". (Optional.) - State *string `json:"state,omitempty"` - // The permission level that all members of the project's organization - // will have on this project. - // Setting the organization permission is only available - // for organization projects. (Optional.) - OrganizationPermission *string `json:"organization_permission,omitempty"` - // Sets visibility of the project within the organization. - // Setting visibility is only available - // for organization projects.(Optional.) - Private *bool `json:"private,omitempty"` -} - -// UpdateProject updates a repository project. -// -// GitHub API docs: https://docs.github.com/rest/projects/projects#update-a-project -// -//meta:operation PATCH /projects/{project_id} -func (s *ProjectsService) UpdateProject(ctx context.Context, id int64, opts *ProjectOptions) (*Project, *Response, error) { - u := fmt.Sprintf("projects/%v", id) - req, err := s.client.NewRequest("PATCH", u, opts) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - project := &Project{} - resp, err := s.client.Do(ctx, req, project) - if err != nil { - return nil, resp, err - } - - return project, resp, nil -} - -// DeleteProject deletes a GitHub Project from a repository. -// -// GitHub API docs: https://docs.github.com/rest/projects/projects#delete-a-project -// -//meta:operation DELETE /projects/{project_id} -func (s *ProjectsService) DeleteProject(ctx context.Context, id int64) (*Response, error) { - u := fmt.Sprintf("projects/%v", id) - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - return s.client.Do(ctx, req, nil) -} - -// ProjectColumn represents a column of a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/repos/projects/ -type ProjectColumn struct { - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - URL *string `json:"url,omitempty"` - ProjectURL *string `json:"project_url,omitempty"` - CardsURL *string `json:"cards_url,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - NodeID *string `json:"node_id,omitempty"` -} - -// ListProjectColumns lists the columns of a GitHub Project for a repo. -// -// GitHub API docs: https://docs.github.com/rest/projects/columns#list-project-columns -// -//meta:operation GET /projects/{project_id}/columns -func (s *ProjectsService) ListProjectColumns(ctx context.Context, projectID int64, opts *ListOptions) ([]*ProjectColumn, *Response, error) { - u := fmt.Sprintf("projects/%v/columns", projectID) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - columns := []*ProjectColumn{} - resp, err := s.client.Do(ctx, req, &columns) - if err != nil { - return nil, resp, err - } - - return columns, resp, nil -} - -// GetProjectColumn gets a column of a GitHub Project for a repo. -// -// GitHub API docs: https://docs.github.com/rest/projects/columns#get-a-project-column -// -//meta:operation GET /projects/columns/{column_id} -func (s *ProjectsService) GetProjectColumn(ctx context.Context, id int64) (*ProjectColumn, *Response, error) { - u := fmt.Sprintf("projects/columns/%v", id) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - column := &ProjectColumn{} - resp, err := s.client.Do(ctx, req, column) - if err != nil { - return nil, resp, err - } - - return column, resp, nil -} - -// ProjectColumnOptions specifies the parameters to the -// ProjectsService.CreateProjectColumn and -// ProjectsService.UpdateProjectColumn methods. -type ProjectColumnOptions struct { - // The name of the project column. (Required for creation and update.) - Name string `json:"name"` -} - -// CreateProjectColumn creates a column for the specified (by number) project. -// -// GitHub API docs: https://docs.github.com/rest/projects/columns#create-a-project-column -// -//meta:operation POST /projects/{project_id}/columns -func (s *ProjectsService) CreateProjectColumn(ctx context.Context, projectID int64, opts *ProjectColumnOptions) (*ProjectColumn, *Response, error) { - u := fmt.Sprintf("projects/%v/columns", projectID) - req, err := s.client.NewRequest("POST", u, opts) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - column := &ProjectColumn{} - resp, err := s.client.Do(ctx, req, column) - if err != nil { - return nil, resp, err - } - - return column, resp, nil -} - -// UpdateProjectColumn updates a column of a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/projects/columns#update-an-existing-project-column -// -//meta:operation PATCH /projects/columns/{column_id} -func (s *ProjectsService) UpdateProjectColumn(ctx context.Context, columnID int64, opts *ProjectColumnOptions) (*ProjectColumn, *Response, error) { - u := fmt.Sprintf("projects/columns/%v", columnID) - req, err := s.client.NewRequest("PATCH", u, opts) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - column := &ProjectColumn{} - resp, err := s.client.Do(ctx, req, column) - if err != nil { - return nil, resp, err - } - - return column, resp, nil -} - -// DeleteProjectColumn deletes a column from a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/projects/columns#delete-a-project-column -// -//meta:operation DELETE /projects/columns/{column_id} -func (s *ProjectsService) DeleteProjectColumn(ctx context.Context, columnID int64) (*Response, error) { - u := fmt.Sprintf("projects/columns/%v", columnID) - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - return s.client.Do(ctx, req, nil) -} - -// ProjectColumnMoveOptions specifies the parameters to the -// ProjectsService.MoveProjectColumn method. -type ProjectColumnMoveOptions struct { - // Position can be one of "first", "last", or "after:", where - // is the ID of a column in the same project. (Required.) - Position string `json:"position"` -} - -// MoveProjectColumn moves a column within a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/projects/columns#move-a-project-column -// -//meta:operation POST /projects/columns/{column_id}/moves -func (s *ProjectsService) MoveProjectColumn(ctx context.Context, columnID int64, opts *ProjectColumnMoveOptions) (*Response, error) { - u := fmt.Sprintf("projects/columns/%v/moves", columnID) - req, err := s.client.NewRequest("POST", u, opts) - if err != nil { - return nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - return s.client.Do(ctx, req, nil) -} - -// ProjectCard represents a card in a column of a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/projects/cards/#get-a-project-card -type ProjectCard struct { - URL *string `json:"url,omitempty"` - ColumnURL *string `json:"column_url,omitempty"` - ContentURL *string `json:"content_url,omitempty"` - ID *int64 `json:"id,omitempty"` - Note *string `json:"note,omitempty"` - Creator *User `json:"creator,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Archived *bool `json:"archived,omitempty"` - - // The following fields are only populated by Webhook events. - ColumnID *int64 `json:"column_id,omitempty"` - - // The following fields are only populated by Events API. - ProjectID *int64 `json:"project_id,omitempty"` - ProjectURL *string `json:"project_url,omitempty"` - ColumnName *string `json:"column_name,omitempty"` - PreviousColumnName *string `json:"previous_column_name,omitempty"` // Populated in "moved_columns_in_project" event deliveries. -} - -// ProjectCardListOptions specifies the optional parameters to the -// ProjectsService.ListProjectCards method. -type ProjectCardListOptions struct { - // ArchivedState is used to list all, archived, or not_archived project cards. - // Defaults to not_archived when you omit this parameter. - ArchivedState *string `url:"archived_state,omitempty"` - - ListOptions -} - -// ListProjectCards lists the cards in a column of a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/projects/cards#list-project-cards -// -//meta:operation GET /projects/columns/{column_id}/cards -func (s *ProjectsService) ListProjectCards(ctx context.Context, columnID int64, opts *ProjectCardListOptions) ([]*ProjectCard, *Response, error) { - u := fmt.Sprintf("projects/columns/%v/cards", columnID) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - cards := []*ProjectCard{} - resp, err := s.client.Do(ctx, req, &cards) - if err != nil { - return nil, resp, err - } - - return cards, resp, nil -} - -// GetProjectCard gets a card in a column of a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/projects/cards#get-a-project-card -// -//meta:operation GET /projects/columns/cards/{card_id} -func (s *ProjectsService) GetProjectCard(ctx context.Context, cardID int64) (*ProjectCard, *Response, error) { - u := fmt.Sprintf("projects/columns/cards/%v", cardID) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - card := &ProjectCard{} - resp, err := s.client.Do(ctx, req, card) - if err != nil { - return nil, resp, err - } - - return card, resp, nil -} - -// ProjectCardOptions specifies the parameters to the -// ProjectsService.CreateProjectCard and -// ProjectsService.UpdateProjectCard methods. -type ProjectCardOptions struct { - // The note of the card. Note and ContentID are mutually exclusive. - Note string `json:"note,omitempty"` - // The ID (not Number) of the Issue to associate with this card. - // Note and ContentID are mutually exclusive. - ContentID int64 `json:"content_id,omitempty"` - // The type of content to associate with this card. Possible values are: "Issue" and "PullRequest". - ContentType string `json:"content_type,omitempty"` - // Use true to archive a project card. - // Specify false if you need to restore a previously archived project card. - Archived *bool `json:"archived,omitempty"` -} - -// CreateProjectCard creates a card in the specified column of a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/projects/cards#create-a-project-card -// -//meta:operation POST /projects/columns/{column_id}/cards -func (s *ProjectsService) CreateProjectCard(ctx context.Context, columnID int64, opts *ProjectCardOptions) (*ProjectCard, *Response, error) { - u := fmt.Sprintf("projects/columns/%v/cards", columnID) - req, err := s.client.NewRequest("POST", u, opts) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - card := &ProjectCard{} - resp, err := s.client.Do(ctx, req, card) - if err != nil { - return nil, resp, err - } - - return card, resp, nil -} - -// UpdateProjectCard updates a card of a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/projects/cards#update-an-existing-project-card -// -//meta:operation PATCH /projects/columns/cards/{card_id} -func (s *ProjectsService) UpdateProjectCard(ctx context.Context, cardID int64, opts *ProjectCardOptions) (*ProjectCard, *Response, error) { - u := fmt.Sprintf("projects/columns/cards/%v", cardID) - req, err := s.client.NewRequest("PATCH", u, opts) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - card := &ProjectCard{} - resp, err := s.client.Do(ctx, req, card) - if err != nil { - return nil, resp, err - } - - return card, resp, nil -} - -// DeleteProjectCard deletes a card from a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/projects/cards#delete-a-project-card -// -//meta:operation DELETE /projects/columns/cards/{card_id} -func (s *ProjectsService) DeleteProjectCard(ctx context.Context, cardID int64) (*Response, error) { - u := fmt.Sprintf("projects/columns/cards/%v", cardID) - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - return s.client.Do(ctx, req, nil) -} - -// ProjectCardMoveOptions specifies the parameters to the -// ProjectsService.MoveProjectCard method. -type ProjectCardMoveOptions struct { - // Position can be one of "top", "bottom", or "after:", where - // is the ID of a card in the same project. - Position string `json:"position"` - // ColumnID is the ID of a column in the same project. Note that ColumnID - // is required when using Position "after:" when that card is in - // another column; otherwise it is optional. - ColumnID int64 `json:"column_id,omitempty"` -} - -// MoveProjectCard moves a card within a GitHub Project. -// -// GitHub API docs: https://docs.github.com/rest/projects/cards#move-a-project-card -// -//meta:operation POST /projects/columns/cards/{card_id}/moves -func (s *ProjectsService) MoveProjectCard(ctx context.Context, cardID int64, opts *ProjectCardMoveOptions) (*Response, error) { - u := fmt.Sprintf("projects/columns/cards/%v/moves", cardID) - req, err := s.client.NewRequest("POST", u, opts) - if err != nil { - return nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - return s.client.Do(ctx, req, nil) -} - -// ProjectCollaboratorOptions specifies the optional parameters to the -// ProjectsService.AddProjectCollaborator method. -type ProjectCollaboratorOptions struct { - // Permission specifies the permission to grant to the collaborator. - // Possible values are: - // "read" - can read, but not write to or administer this project. - // "write" - can read and write, but not administer this project. - // "admin" - can read, write and administer this project. - // - // Default value is "write" - Permission *string `json:"permission,omitempty"` -} - -// AddProjectCollaborator adds a collaborator to an organization project and sets -// their permission level. You must be an organization owner or a project admin to add a collaborator. -// -// GitHub API docs: https://docs.github.com/rest/projects/collaborators#add-project-collaborator -// -//meta:operation PUT /projects/{project_id}/collaborators/{username} -func (s *ProjectsService) AddProjectCollaborator(ctx context.Context, id int64, username string, opts *ProjectCollaboratorOptions) (*Response, error) { - u := fmt.Sprintf("projects/%v/collaborators/%v", id, username) - req, err := s.client.NewRequest("PUT", u, opts) - if err != nil { - return nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - return s.client.Do(ctx, req, nil) -} - -// RemoveProjectCollaborator removes a collaborator from an organization project. -// You must be an organization owner or a project admin to remove a collaborator. -// -// GitHub API docs: https://docs.github.com/rest/projects/collaborators#remove-user-as-a-collaborator -// -//meta:operation DELETE /projects/{project_id}/collaborators/{username} -func (s *ProjectsService) RemoveProjectCollaborator(ctx context.Context, id int64, username string) (*Response, error) { - u := fmt.Sprintf("projects/%v/collaborators/%v", id, username) - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - return s.client.Do(ctx, req, nil) -} - -// ListCollaboratorOptions specifies the optional parameters to the -// ProjectsService.ListProjectCollaborators method. -type ListCollaboratorOptions struct { - // Affiliation specifies how collaborators should be filtered by their affiliation. - // Possible values are: - // "outside" - All outside collaborators of an organization-owned repository - // "direct" - All collaborators with permissions to an organization-owned repository, - // regardless of organization membership status - // "all" - All collaborators the authenticated user can see - // - // Default value is "all". - Affiliation *string `url:"affiliation,omitempty"` - - ListOptions -} - -// ListProjectCollaborators lists the collaborators for an organization project. For a project, -// the list of collaborators includes outside collaborators, organization members that are direct -// collaborators, organization members with access through team memberships, organization members -// with access through default organization permissions, and organization owners. You must be an -// organization owner or a project admin to list collaborators. -// -// GitHub API docs: https://docs.github.com/rest/projects/collaborators#list-project-collaborators -// -//meta:operation GET /projects/{project_id}/collaborators -func (s *ProjectsService) ListProjectCollaborators(ctx context.Context, id int64, opts *ListCollaboratorOptions) ([]*User, *Response, error) { - u := fmt.Sprintf("projects/%v/collaborators", id) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - var users []*User - resp, err := s.client.Do(ctx, req, &users) - if err != nil { - return nil, resp, err - } - - return users, resp, nil -} - -// ProjectPermissionLevel represents the permission level an organization -// member has for a given project. -type ProjectPermissionLevel struct { - // Possible values: "admin", "write", "read", "none" - Permission *string `json:"permission,omitempty"` - - User *User `json:"user,omitempty"` -} - -// ReviewProjectCollaboratorPermission returns the collaborator's permission level for an organization -// project. Possible values for the permission key: "admin", "write", "read", "none". -// You must be an organization owner or a project admin to review a user's permission level. -// -// GitHub API docs: https://docs.github.com/rest/projects/collaborators#get-project-permission-for-a-user -// -//meta:operation GET /projects/{project_id}/collaborators/{username}/permission -func (s *ProjectsService) ReviewProjectCollaboratorPermission(ctx context.Context, id int64, username string) (*ProjectPermissionLevel, *Response, error) { - u := fmt.Sprintf("projects/%v/collaborators/%v/permission", id, username) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - ppl := new(ProjectPermissionLevel) - resp, err := s.client.Do(ctx, req, ppl) - if err != nil { - return nil, resp, err - } - return ppl, resp, nil -} diff --git a/vendor/github.com/google/go-github/v66/github/repos_projects.go b/vendor/github.com/google/go-github/v66/github/repos_projects.go deleted file mode 100644 index 9269d4e95c..0000000000 --- a/vendor/github.com/google/go-github/v66/github/repos_projects.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2017 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package github - -import ( - "context" - "fmt" -) - -// ProjectListOptions specifies the optional parameters to the -// OrganizationsService.ListProjects and RepositoriesService.ListProjects methods. -type ProjectListOptions struct { - // Indicates the state of the projects to return. Can be either open, closed, or all. Default: open - State string `url:"state,omitempty"` - - ListOptions -} - -// ListProjects lists the projects for a repo. -// -// GitHub API docs: https://docs.github.com/rest/projects/projects#list-repository-projects -// -//meta:operation GET /repos/{owner}/{repo}/projects -func (s *RepositoriesService) ListProjects(ctx context.Context, owner, repo string, opts *ProjectListOptions) ([]*Project, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/projects", owner, repo) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - var projects []*Project - resp, err := s.client.Do(ctx, req, &projects) - if err != nil { - return nil, resp, err - } - - return projects, resp, nil -} - -// CreateProject creates a GitHub Project for the specified repository. -// -// GitHub API docs: https://docs.github.com/rest/projects/projects#create-a-repository-project -// -//meta:operation POST /repos/{owner}/{repo}/projects -func (s *RepositoriesService) CreateProject(ctx context.Context, owner, repo string, opts *ProjectOptions) (*Project, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/projects", owner, repo) - req, err := s.client.NewRequest("POST", u, opts) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept headers when APIs fully launch. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - project := &Project{} - resp, err := s.client.Do(ctx, req, project) - if err != nil { - return nil, resp, err - } - - return project, resp, nil -} diff --git a/vendor/github.com/google/go-github/v66/github/repos_rules.go b/vendor/github.com/google/go-github/v66/github/repos_rules.go deleted file mode 100644 index 0d5052a4b1..0000000000 --- a/vendor/github.com/google/go-github/v66/github/repos_rules.go +++ /dev/null @@ -1,995 +0,0 @@ -// Copyright 2023 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package github - -import ( - "context" - "encoding/json" - "fmt" -) - -// BypassActor represents the bypass actors from a ruleset. -type BypassActor struct { - ActorID *int64 `json:"actor_id,omitempty"` - // Possible values for ActorType are: RepositoryRole, Team, Integration, OrganizationAdmin - ActorType *string `json:"actor_type,omitempty"` - // Possible values for BypassMode are: always, pull_request - BypassMode *string `json:"bypass_mode,omitempty"` -} - -// RulesetLink represents a single link object from GitHub ruleset request _links. -type RulesetLink struct { - HRef *string `json:"href,omitempty"` -} - -// RulesetLinks represents the "_links" object in a Ruleset. -type RulesetLinks struct { - Self *RulesetLink `json:"self,omitempty"` -} - -// RulesetRefConditionParameters represents the conditions object for ref_names. -type RulesetRefConditionParameters struct { - Include []string `json:"include"` - Exclude []string `json:"exclude"` -} - -// RulesetRepositoryNamesConditionParameters represents the conditions object for repository_names. -type RulesetRepositoryNamesConditionParameters struct { - Include []string `json:"include"` - Exclude []string `json:"exclude"` - Protected *bool `json:"protected,omitempty"` -} - -// RulesetRepositoryIDsConditionParameters represents the conditions object for repository_ids. -type RulesetRepositoryIDsConditionParameters struct { - RepositoryIDs []int64 `json:"repository_ids,omitempty"` -} - -// RulesetRepositoryPropertyTargetParameters represents a repository_property name and values to be used for targeting. -type RulesetRepositoryPropertyTargetParameters struct { - Name string `json:"name"` - Values []string `json:"property_values"` - Source *string `json:"source,omitempty"` -} - -// RulesetRepositoryPropertyConditionParameters represents the conditions object for repository_property. -type RulesetRepositoryPropertyConditionParameters struct { - Include []RulesetRepositoryPropertyTargetParameters `json:"include"` - Exclude []RulesetRepositoryPropertyTargetParameters `json:"exclude"` -} - -// RulesetConditions represents the conditions object in a ruleset. -// Set either RepositoryName or RepositoryID or RepositoryProperty, not more than one. -type RulesetConditions struct { - RefName *RulesetRefConditionParameters `json:"ref_name,omitempty"` - RepositoryName *RulesetRepositoryNamesConditionParameters `json:"repository_name,omitempty"` - RepositoryID *RulesetRepositoryIDsConditionParameters `json:"repository_id,omitempty"` - RepositoryProperty *RulesetRepositoryPropertyConditionParameters `json:"repository_property,omitempty"` -} - -// RulePatternParameters represents the rule pattern parameters. -type RulePatternParameters struct { - Name *string `json:"name,omitempty"` - // If Negate is true, the rule will fail if the pattern matches. - Negate *bool `json:"negate,omitempty"` - // Possible values for Operator are: starts_with, ends_with, contains, regex - Operator string `json:"operator"` - Pattern string `json:"pattern"` -} - -// RuleFileParameters represents a list of file paths. -type RuleFileParameters struct { - RestrictedFilePaths *[]string `json:"restricted_file_paths"` -} - -// RuleMaxFilePathLengthParameters represents the max_file_path_length rule parameters. -type RuleMaxFilePathLengthParameters struct { - MaxFilePathLength int `json:"max_file_path_length"` -} - -// RuleFileExtensionRestrictionParameters represents the file_extension_restriction rule parameters. -type RuleFileExtensionRestrictionParameters struct { - RestrictedFileExtensions []string `json:"restricted_file_extensions"` -} - -// RuleMaxFileSizeParameters represents the max_file_size rule parameters. -type RuleMaxFileSizeParameters struct { - MaxFileSize int64 `json:"max_file_size"` -} - -// UpdateAllowsFetchAndMergeRuleParameters represents the update rule parameters. -type UpdateAllowsFetchAndMergeRuleParameters struct { - UpdateAllowsFetchAndMerge bool `json:"update_allows_fetch_and_merge"` -} - -// RequiredDeploymentEnvironmentsRuleParameters represents the required_deployments rule parameters. -type RequiredDeploymentEnvironmentsRuleParameters struct { - RequiredDeploymentEnvironments []string `json:"required_deployment_environments"` -} - -// PullRequestRuleParameters represents the pull_request rule parameters. -type PullRequestRuleParameters struct { - DismissStaleReviewsOnPush bool `json:"dismiss_stale_reviews_on_push"` - RequireCodeOwnerReview bool `json:"require_code_owner_review"` - RequireLastPushApproval bool `json:"require_last_push_approval"` - RequiredApprovingReviewCount int `json:"required_approving_review_count"` - RequiredReviewThreadResolution bool `json:"required_review_thread_resolution"` -} - -// RuleRequiredStatusChecks represents the RequiredStatusChecks for the RequiredStatusChecksRuleParameters object. -type RuleRequiredStatusChecks struct { - Context string `json:"context"` - IntegrationID *int64 `json:"integration_id,omitempty"` -} - -// MergeQueueRuleParameters represents the merge_queue rule parameters. -type MergeQueueRuleParameters struct { - CheckResponseTimeoutMinutes int `json:"check_response_timeout_minutes"` - // Possible values for GroupingStrategy are: ALLGREEN, HEADGREEN - GroupingStrategy string `json:"grouping_strategy"` - MaxEntriesToBuild int `json:"max_entries_to_build"` - MaxEntriesToMerge int `json:"max_entries_to_merge"` - // Possible values for MergeMethod are: MERGE, SQUASH, REBASE - MergeMethod string `json:"merge_method"` - MinEntriesToMerge int `json:"min_entries_to_merge"` - MinEntriesToMergeWaitMinutes int `json:"min_entries_to_merge_wait_minutes"` -} - -// RequiredStatusChecksRuleParameters represents the required_status_checks rule parameters. -type RequiredStatusChecksRuleParameters struct { - DoNotEnforceOnCreate *bool `json:"do_not_enforce_on_create,omitempty"` - RequiredStatusChecks []RuleRequiredStatusChecks `json:"required_status_checks"` - StrictRequiredStatusChecksPolicy bool `json:"strict_required_status_checks_policy"` -} - -// RuleRequiredWorkflow represents the Workflow for the RequireWorkflowsRuleParameters object. -type RuleRequiredWorkflow struct { - Path string `json:"path"` - Ref *string `json:"ref,omitempty"` - RepositoryID *int64 `json:"repository_id,omitempty"` - Sha *string `json:"sha,omitempty"` -} - -// RequiredWorkflowsRuleParameters represents the workflows rule parameters. -type RequiredWorkflowsRuleParameters struct { - DoNotEnforceOnCreate bool `json:"do_not_enforce_on_create,omitempty"` - RequiredWorkflows []*RuleRequiredWorkflow `json:"workflows"` -} - -// RuleRequiredCodeScanningTool represents a single required code-scanning tool for the RequiredCodeScanningParameters object. -type RuleRequiredCodeScanningTool struct { - AlertsThreshold string `json:"alerts_threshold"` - SecurityAlertsThreshold string `json:"security_alerts_threshold"` - Tool string `json:"tool"` -} - -// RequiredCodeScanningRuleParameters represents the code_scanning rule parameters. -type RequiredCodeScanningRuleParameters struct { - RequiredCodeScanningTools []*RuleRequiredCodeScanningTool `json:"code_scanning_tools"` -} - -// RepositoryRule represents a GitHub Rule. -type RepositoryRule struct { - Type string `json:"type"` - Parameters *json.RawMessage `json:"parameters,omitempty"` - RulesetSourceType string `json:"ruleset_source_type"` - RulesetSource string `json:"ruleset_source"` - RulesetID int64 `json:"ruleset_id"` -} - -// RepositoryRulesetEditedChanges represents the changes made to a repository ruleset. -type RepositoryRulesetEditedChanges struct { - Name *RepositoryRulesetEditedSource `json:"name,omitempty"` - Enforcement *RepositoryRulesetEditedSource `json:"enforcement,omitempty"` - Conditions *RepositoryRulesetEditedConditions `json:"conditions,omitempty"` - Rules *RepositoryRulesetEditedRules `json:"rules,omitempty"` -} - -// RepositoryRulesetEditedSource represents a source change for the ruleset. -type RepositoryRulesetEditedSource struct { - From *string `json:"from,omitempty"` -} - -// RepositoryRulesetEditedSources represents multiple source changes for the ruleset. -type RepositoryRulesetEditedSources struct { - From []string `json:"from,omitempty"` -} - -// RepositoryRulesetEditedConditions holds changes to conditions in a ruleset. -type RepositoryRulesetEditedConditions struct { - Added []*RepositoryRulesetRefCondition `json:"added,omitempty"` - Deleted []*RepositoryRulesetRefCondition `json:"deleted,omitempty"` - Updated []*RepositoryRulesetEditedUpdatedConditions `json:"updated,omitempty"` -} - -// RepositoryRulesetEditedRules holds changes to rules in a ruleset. -type RepositoryRulesetEditedRules struct { - Added []*RepositoryRulesetRule `json:"added,omitempty"` - Deleted []*RepositoryRulesetRule `json:"deleted,omitempty"` - Updated []*RepositoryRulesetUpdatedRules `json:"updated,omitempty"` -} - -// RepositoryRulesetRefCondition represents a reference condition for the ruleset. -type RepositoryRulesetRefCondition struct { - RefName *RulesetRefConditionParameters `json:"ref_name,omitempty"` -} - -// RepositoryRulesetEditedUpdatedConditions holds updates to conditions in a ruleset. -type RepositoryRulesetEditedUpdatedConditions struct { - Condition *RepositoryRulesetRefCondition `json:"condition,omitempty"` - Changes *RepositoryRulesetUpdatedConditionsEdited `json:"changes,omitempty"` -} - -// RepositoryRulesetUpdatedConditionsEdited holds the edited updates to conditions in a ruleset. -type RepositoryRulesetUpdatedConditionsEdited struct { - ConditionType *RepositoryRulesetEditedSource `json:"condition_type,omitempty"` - Target *RepositoryRulesetEditedSource `json:"target,omitempty"` - Include *RepositoryRulesetEditedSources `json:"include,omitempty"` - Exclude *RepositoryRulesetEditedSources `json:"exclude,omitempty"` -} - -// RepositoryRulesetUpdatedRules holds updates to rules in a ruleset. -type RepositoryRulesetUpdatedRules struct { - Rule *RepositoryRulesetRule `json:"rule,omitempty"` - Changes *RepositoryRulesetEditedRuleChanges `json:"changes,omitempty"` -} - -// RepositoryRulesetEditedRuleChanges holds changes made to a rule in a ruleset. -type RepositoryRulesetEditedRuleChanges struct { - Configuration *RepositoryRulesetEditedSources `json:"configuration,omitempty"` - RuleType *RepositoryRulesetEditedSources `json:"rule_type,omitempty"` - Pattern *RepositoryRulesetEditedSources `json:"pattern,omitempty"` -} - -// RepositoryRuleset represents the structure of a ruleset associated with a GitHub repository. -type RepositoryRuleset struct { - ID int64 `json:"id"` - Name string `json:"name"` - // Possible values for target: "branch", "tag", "push" - Target *string `json:"target,omitempty"` - // Possible values for source type: "Repository", "Organization" - SourceType *string `json:"source_type,omitempty"` - Source string `json:"source"` - // Possible values for enforcement: "disabled", "active", "evaluate" - Enforcement string `json:"enforcement"` - BypassActors []*BypassActor `json:"bypass_actors,omitempty"` - // Possible values for current user can bypass: "always", "pull_requests_only", "never" - CurrentUserCanBypass *string `json:"current_user_can_bypass,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Links *RepositoryRulesetLink `json:"_links,omitempty"` - Conditions json.RawMessage `json:"conditions,omitempty"` - Rules []*RepositoryRulesetRule `json:"rules,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` -} - -// RepositoryRulesetRule represents individual rules which are present in a repository's ruleset. -type RepositoryRulesetRule struct { - Creation *RepositoryRulesetRuleType `json:"creation,omitempty"` - Update *RepositoryRulesetUpdateRule `json:"update,omitempty"` - Deletion *RepositoryRulesetRuleType `json:"deletion,omitempty"` - RequiredLinearHistory *RepositoryRulesetRuleType `json:"required_linear_history,omitempty"` - MergeQueue *RepositoryRulesetMergeQueueRule `json:"merge_queue,omitempty"` - RequiredDeployments *RepositoryRulesetRequiredDeploymentsRule `json:"required_deployments,omitempty"` - RequiredSignatures *RepositoryRulesetRuleType `json:"required_signatures,omitempty"` - PullRequest *RepositoryRulesetPullRequestRule `json:"pull_request,omitempty"` - RequiredStatusChecks *RepositoryRulesetRequiredStatusChecksRule `json:"required_status_checks,omitempty"` - NonFastForward *RepositoryRulesetRuleType `json:"non_fast_forward,omitempty"` - CommitMessagePattern *RepositoryRulesetPatternRule `json:"commit_message_pattern,omitempty"` - CommitAuthorEmailPattern *RepositoryRulesetPatternRule `json:"commit_author_email_pattern,omitempty"` - CommitterEmailPattern *RepositoryRulesetPatternRule `json:"committer_email_pattern,omitempty"` - BranchNamePattern *RepositoryRulesetPatternRule `json:"branch_name_pattern,omitempty"` - TagNamePattern *RepositoryRulesetPatternRule `json:"tag_name_pattern,omitempty"` - FilePathRestriction *RepositoryRulesetFilePathRestrictionRule `json:"file_path_restriction,omitempty"` - MaxFilePathLength *RepositoryRulesetMaxFilePathLengthRule `json:"max_file_path_length,omitempty"` - FileExtensionRestriction *RepositoryRulesetFileExtensionRestrictionRule `json:"file_extension_restriction,omitempty"` - MaxFileSize *RepositoryRulesetMaxFileSizeRule `json:"max_file_size,omitempty"` - Workflows *RepositoryRulesetWorkflowsRule `json:"workflows,omitempty"` - CodeScanning *RepositoryRulesetCodeScanningRule `json:"code_scanning,omitempty"` -} - -// RepositoryRulesetLink represents Links associated with a repository's rulesets. These links are used to provide more information about the ruleset. -type RepositoryRulesetLink struct { - Self *RulesetLink `json:"self,omitempty"` - HTML *RulesetLink `json:"html,omitempty"` -} - -// RepositoryRulesetRuleType represents the type of a ruleset rule. -type RepositoryRulesetRuleType struct { - Type string `json:"type"` -} - -// RepositoryRulesetUpdateRule defines an update rule for the repository. -type RepositoryRulesetUpdateRule struct { - // Type can be one of: "update". - Type string `json:"type"` - Parameters *UpdateAllowsFetchAndMergeRuleParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetMergeQueueRule defines a merge queue rule for the repository. -type RepositoryRulesetMergeQueueRule struct { - // Type can be one of: "merge_queue". - Type string `json:"type"` - Parameters *MergeQueueRuleParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetRequiredDeploymentsRule defines a rule for required deployments. -type RepositoryRulesetRequiredDeploymentsRule struct { - // Type can be one of: "required_deployments". - Type string `json:"type"` - Parameters *RequiredDeploymentEnvironmentsRuleParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetPullRequestRule defines a rule for pull requests. -type RepositoryRulesetPullRequestRule struct { - // Type can be one of: "pull_request". - - Type string `json:"type"` - Parameters *PullRequestRuleParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetRequiredStatusChecksRule defines a rule for required status checks. -type RepositoryRulesetRequiredStatusChecksRule struct { - // Type can be one of: "required_status_checks". - - Type string `json:"type"` - Parameters *RequiredStatusChecksRuleParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetPatternRule defines a pattern rule for the repository. -type RepositoryRulesetPatternRule struct { - Type string `json:"type"` - Parameters *RulePatternParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetFilePathRestrictionRule defines a file path restriction rule for the repository. -type RepositoryRulesetFilePathRestrictionRule struct { - // Type can be one of: "file_path_restriction". - Type string `json:"type"` - Parameters *RuleFileParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetMaxFilePathLengthRule defines a maximum file path length rule for the repository. -type RepositoryRulesetMaxFilePathLengthRule struct { - // Type can be one of: "max_file_path_length". - - Type string `json:"type"` - Parameters *RuleMaxFilePathLengthParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetFileExtensionRestrictionRule defines a file extension restriction rule for the repository. -type RepositoryRulesetFileExtensionRestrictionRule struct { - // Type can be one of: "file_extension_restriction". - Type string `json:"type"` - Parameters *RuleFileExtensionRestrictionParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetMaxFileSizeRule defines a maximum file size rule for the repository. -type RepositoryRulesetMaxFileSizeRule struct { - // Type can be one of: "max_file_size". - Type string `json:"type"` - Parameters *RuleMaxFileSizeParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetWorkflowsRule defines a workflow rule for the repository. -type RepositoryRulesetWorkflowsRule struct { - // Type can be one of: "workflows". - Type string `json:"type"` - Parameters *RequiredWorkflowsRuleParameters `json:"parameters,omitempty"` -} - -// RepositoryRulesetCodeScanningRule defines a code scanning rule for the repository. -type RepositoryRulesetCodeScanningRule struct { - // Type can be one of: "code_scanning". - Type string `json:"type"` - Parameters *RuleCodeScanningParameters `json:"parameters,omitempty"` -} - -// RuleCodeScanningParameters defines parameters for code scanning rules. -type RuleCodeScanningParameters struct { - CodeScanningTools []*CodeScanningTool `json:"code_scanning_tools,omitempty"` -} - -// CodeScanningTool defines a specific tool used for code scanning. -type CodeScanningTool struct { - AlertsThreshold string `json:"alerts_threshold"` - SecurityAlertsThreshold string `json:"security_alerts_threshold"` - Tool string `json:"tool"` -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -// This helps us handle the fact that RepositoryRule parameter field can be of numerous types. -func (r *RepositoryRule) UnmarshalJSON(data []byte) error { - type rule RepositoryRule - var RepositoryRule rule - if err := json.Unmarshal(data, &RepositoryRule); err != nil { - return err - } - - r.RulesetID = RepositoryRule.RulesetID - r.RulesetSourceType = RepositoryRule.RulesetSourceType - r.RulesetSource = RepositoryRule.RulesetSource - r.Type = RepositoryRule.Type - - switch RepositoryRule.Type { - case "creation", "deletion", "non_fast_forward", "required_linear_history", "required_signatures": - r.Parameters = nil - case "update": - if RepositoryRule.Parameters == nil { - r.Parameters = nil - return nil - } - params := UpdateAllowsFetchAndMergeRuleParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { - return err - } - - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "merge_queue": - if RepositoryRule.Parameters == nil { - r.Parameters = nil - return nil - } - params := MergeQueueRuleParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { - return err - } - - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "required_deployments": - params := RequiredDeploymentEnvironmentsRuleParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { - return err - } - - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "commit_message_pattern", "commit_author_email_pattern", "committer_email_pattern", "branch_name_pattern", "tag_name_pattern": - params := RulePatternParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { - return err - } - - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "pull_request": - params := PullRequestRuleParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { - return err - } - - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "required_status_checks": - params := RequiredStatusChecksRuleParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { - return err - } - - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "workflows": - params := RequiredWorkflowsRuleParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { - return err - } - - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "file_path_restriction": - params := RuleFileParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { - return err - } - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "code_scanning": - params := RequiredCodeScanningRuleParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { - return err - } - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "max_file_path_length": - params := RuleMaxFilePathLengthParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { - return err - } - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "file_extension_restriction": - params := RuleFileExtensionRestrictionParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { - return err - } - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "max_file_size": - params := RuleMaxFileSizeParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { - return err - } - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - default: - r.Type = "" - r.Parameters = nil - return fmt.Errorf("RepositoryRule.Type %q is not yet implemented, unable to unmarshal (%#v)", RepositoryRule.Type, RepositoryRule) - } - - return nil -} - -// NewMergeQueueRule creates a rule to only allow merges via a merge queue. -func NewMergeQueueRule(params *MergeQueueRuleParameters) (rule *RepositoryRule) { - if params != nil { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "merge_queue", - Parameters: &rawParams, - } - } - return &RepositoryRule{ - Type: "merge_queue", - } -} - -// NewCreationRule creates a rule to only allow users with bypass permission to create matching refs. -func NewCreationRule() (rule *RepositoryRule) { - return &RepositoryRule{ - Type: "creation", - } -} - -// NewUpdateRule creates a rule to only allow users with bypass permission to update matching refs. -func NewUpdateRule(params *UpdateAllowsFetchAndMergeRuleParameters) (rule *RepositoryRule) { - if params != nil { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "update", - Parameters: &rawParams, - } - } - return &RepositoryRule{ - Type: "update", - } -} - -// NewDeletionRule creates a rule to only allow users with bypass permissions to delete matching refs. -func NewDeletionRule() (rule *RepositoryRule) { - return &RepositoryRule{ - Type: "deletion", - } -} - -// NewRequiredLinearHistoryRule creates a rule to prevent merge commits from being pushed to matching branches. -func NewRequiredLinearHistoryRule() (rule *RepositoryRule) { - return &RepositoryRule{ - Type: "required_linear_history", - } -} - -// NewRequiredDeploymentsRule creates a rule to require environments to be successfully deployed before they can be merged into the matching branches. -func NewRequiredDeploymentsRule(params *RequiredDeploymentEnvironmentsRuleParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "required_deployments", - Parameters: &rawParams, - } -} - -// NewRequiredSignaturesRule creates a rule a to require commits pushed to matching branches to have verified signatures. -func NewRequiredSignaturesRule() (rule *RepositoryRule) { - return &RepositoryRule{ - Type: "required_signatures", - } -} - -// NewPullRequestRule creates a rule to require all commits be made to a non-target branch and submitted via a pull request before they can be merged. -func NewPullRequestRule(params *PullRequestRuleParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "pull_request", - Parameters: &rawParams, - } -} - -// NewRequiredStatusChecksRule creates a rule to require which status checks must pass before branches can be merged into a branch rule. -func NewRequiredStatusChecksRule(params *RequiredStatusChecksRuleParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "required_status_checks", - Parameters: &rawParams, - } -} - -// NewNonFastForwardRule creates a rule as part to prevent users with push access from force pushing to matching branches. -func NewNonFastForwardRule() (rule *RepositoryRule) { - return &RepositoryRule{ - Type: "non_fast_forward", - } -} - -// NewCommitMessagePatternRule creates a rule to restrict commit message patterns being pushed to matching branches. -func NewCommitMessagePatternRule(params *RulePatternParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "commit_message_pattern", - Parameters: &rawParams, - } -} - -// NewCommitAuthorEmailPatternRule creates a rule to restrict commits with author email patterns being merged into matching branches. -func NewCommitAuthorEmailPatternRule(params *RulePatternParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "commit_author_email_pattern", - Parameters: &rawParams, - } -} - -// NewCommitterEmailPatternRule creates a rule to restrict commits with committer email patterns being merged into matching branches. -func NewCommitterEmailPatternRule(params *RulePatternParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "committer_email_pattern", - Parameters: &rawParams, - } -} - -// NewBranchNamePatternRule creates a rule to restrict branch patterns from being merged into matching branches. -func NewBranchNamePatternRule(params *RulePatternParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "branch_name_pattern", - Parameters: &rawParams, - } -} - -// NewTagNamePatternRule creates a rule to restrict tag patterns contained in non-target branches from being merged into matching branches. -func NewTagNamePatternRule(params *RulePatternParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "tag_name_pattern", - Parameters: &rawParams, - } -} - -// NewRequiredWorkflowsRule creates a rule to require which status checks must pass before branches can be merged into a branch rule. -func NewRequiredWorkflowsRule(params *RequiredWorkflowsRuleParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "workflows", - Parameters: &rawParams, - } -} - -// NewRequiredCodeScanningRule creates a rule to require which tools must provide code scanning results before the reference is updated. -func NewRequiredCodeScanningRule(params *RequiredCodeScanningRuleParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "code_scanning", - Parameters: &rawParams, - } -} - -// NewFilePathRestrictionRule creates a rule to restrict file paths from being pushed to. -func NewFilePathRestrictionRule(params *RuleFileParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "file_path_restriction", - Parameters: &rawParams, - } -} - -// NewMaxFilePathLengthRule creates a rule to restrict file paths longer than the limit from being pushed. -func NewMaxFilePathLengthRule(params *RuleMaxFilePathLengthParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "max_file_path_length", - Parameters: &rawParams, - } -} - -// NewFileExtensionRestrictionRule creates a rule to restrict file extensions from being pushed to a commit. -func NewFileExtensionRestrictionRule(params *RuleFileExtensionRestrictionParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "file_extension_restriction", - Parameters: &rawParams, - } -} - -// NewMaxFileSizeRule creates a rule to restrict file sizes from being pushed to a commit. -func NewMaxFileSizeRule(params *RuleMaxFileSizeParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "max_file_size", - Parameters: &rawParams, - } -} - -// Ruleset represents a GitHub ruleset object. -type Ruleset struct { - ID *int64 `json:"id,omitempty"` - Name string `json:"name"` - // Possible values for Target are branch, tag, push - Target *string `json:"target,omitempty"` - // Possible values for SourceType are: Repository, Organization - SourceType *string `json:"source_type,omitempty"` - Source string `json:"source"` - // Possible values for Enforcement are: disabled, active, evaluate - Enforcement string `json:"enforcement"` - BypassActors []*BypassActor `json:"bypass_actors,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Links *RulesetLinks `json:"_links,omitempty"` - Conditions *RulesetConditions `json:"conditions,omitempty"` - Rules []*RepositoryRule `json:"rules,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` -} - -// rulesetNoOmitBypassActors represents a GitHub ruleset object. The struct does not omit bypassActors if the field is nil or an empty array is passed. -type rulesetNoOmitBypassActors struct { - ID *int64 `json:"id,omitempty"` - Name string `json:"name"` - // Possible values for Target are branch, tag - Target *string `json:"target,omitempty"` - // Possible values for SourceType are: Repository, Organization - SourceType *string `json:"source_type,omitempty"` - Source string `json:"source"` - // Possible values for Enforcement are: disabled, active, evaluate - Enforcement string `json:"enforcement"` - BypassActors []*BypassActor `json:"bypass_actors"` - NodeID *string `json:"node_id,omitempty"` - Links *RulesetLinks `json:"_links,omitempty"` - Conditions *RulesetConditions `json:"conditions,omitempty"` - Rules []*RepositoryRule `json:"rules,omitempty"` -} - -// GetRulesForBranch gets all the rules that apply to the specified branch. -// -// GitHub API docs: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch -// -//meta:operation GET /repos/{owner}/{repo}/rules/branches/{branch} -func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo, branch string) ([]*RepositoryRule, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/rules/branches/%v", owner, repo, branch) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var rules []*RepositoryRule - resp, err := s.client.Do(ctx, req, &rules) - if err != nil { - return nil, resp, err - } - - return rules, resp, nil -} - -// GetAllRulesets gets all the rules that apply to the specified repository. -// If includesParents is true, rulesets configured at the organization level that apply to the repository will be returned. -// -// GitHub API docs: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets -// -//meta:operation GET /repos/{owner}/{repo}/rulesets -func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo string, includesParents bool) ([]*Ruleset, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/rulesets?includes_parents=%v", owner, repo, includesParents) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var ruleset []*Ruleset - resp, err := s.client.Do(ctx, req, &ruleset) - if err != nil { - return nil, resp, err - } - - return ruleset, resp, nil -} - -// CreateRuleset creates a ruleset for the specified repository. -// -// GitHub API docs: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset -// -//meta:operation POST /repos/{owner}/{repo}/rulesets -func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo string, rs *Ruleset) (*Ruleset, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/rulesets", owner, repo) - - req, err := s.client.NewRequest("POST", u, rs) - if err != nil { - return nil, nil, err - } - - var ruleset *Ruleset - resp, err := s.client.Do(ctx, req, &ruleset) - if err != nil { - return nil, resp, err - } - - return ruleset, resp, nil -} - -// GetRuleset gets a ruleset for the specified repository. -// If includesParents is true, rulesets configured at the organization level that apply to the repository will be returned. -// -// GitHub API docs: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset -// -//meta:operation GET /repos/{owner}/{repo}/rulesets/{ruleset_id} -func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string, rulesetID int64, includesParents bool) (*Ruleset, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/rulesets/%v?includes_parents=%v", owner, repo, rulesetID, includesParents) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var ruleset *Ruleset - resp, err := s.client.Do(ctx, req, &ruleset) - if err != nil { - return nil, resp, err - } - - return ruleset, resp, nil -} - -// UpdateRuleset updates a ruleset for the specified repository. -// -// GitHub API docs: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset -// -//meta:operation PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} -func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo string, rulesetID int64, rs *Ruleset) (*Ruleset, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) - - req, err := s.client.NewRequest("PUT", u, rs) - if err != nil { - return nil, nil, err - } - - var ruleset *Ruleset - resp, err := s.client.Do(ctx, req, &ruleset) - if err != nil { - return nil, resp, err - } - - return ruleset, resp, nil -} - -// UpdateRulesetNoBypassActor updates a ruleset for the specified repository. -// -// This function is necessary as the UpdateRuleset function does not marshal ByPassActor if passed as nil or an empty array. -// -// GitHub API docs: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset -// -//meta:operation PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} -func (s *RepositoriesService) UpdateRulesetNoBypassActor(ctx context.Context, owner, repo string, rulesetID int64, rs *Ruleset) (*Ruleset, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) - - rsNoBypassActor := &rulesetNoOmitBypassActors{} - - if rs != nil { - rsNoBypassActor = &rulesetNoOmitBypassActors{ - ID: rs.ID, - Name: rs.Name, - Target: rs.Target, - SourceType: rs.SourceType, - Source: rs.Source, - Enforcement: rs.Enforcement, - BypassActors: rs.BypassActors, - NodeID: rs.NodeID, - Links: rs.Links, - Conditions: rs.Conditions, - Rules: rs.Rules, - } - } - - req, err := s.client.NewRequest("PUT", u, rsNoBypassActor) - if err != nil { - return nil, nil, err - } - - var ruleSet *Ruleset - resp, err := s.client.Do(ctx, req, &ruleSet) - if err != nil { - return nil, resp, err - } - - return ruleSet, resp, nil -} - -// DeleteRuleset deletes a ruleset for the specified repository. -// -// GitHub API docs: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset -// -//meta:operation DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id} -func (s *RepositoriesService) DeleteRuleset(ctx context.Context, owner, repo string, rulesetID int64) (*Response, error) { - u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) - - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - return s.client.Do(ctx, req, nil) -} diff --git a/vendor/github.com/google/go-github/v66/github/users_projects.go b/vendor/github.com/google/go-github/v66/github/users_projects.go deleted file mode 100644 index 0ab57e5c23..0000000000 --- a/vendor/github.com/google/go-github/v66/github/users_projects.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2019 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package github - -import ( - "context" - "fmt" -) - -// ListProjects lists the projects for the specified user. -// -// GitHub API docs: https://docs.github.com/rest/projects/projects#list-user-projects -// -//meta:operation GET /users/{username}/projects -func (s *UsersService) ListProjects(ctx context.Context, user string, opts *ProjectListOptions) ([]*Project, *Response, error) { - u := fmt.Sprintf("users/%v/projects", user) - u, err := addOptions(u, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - var projects []*Project - resp, err := s.client.Do(ctx, req, &projects) - if err != nil { - return nil, resp, err - } - - return projects, resp, nil -} - -// CreateUserProjectOptions specifies the parameters to the UsersService.CreateProject method. -type CreateUserProjectOptions struct { - // The name of the project. (Required.) - Name string `json:"name"` - // The description of the project. (Optional.) - Body *string `json:"body,omitempty"` -} - -// CreateProject creates a GitHub Project for the current user. -// -// GitHub API docs: https://docs.github.com/rest/projects/projects#create-a-user-project -// -//meta:operation POST /user/projects -func (s *UsersService) CreateProject(ctx context.Context, opts *CreateUserProjectOptions) (*Project, *Response, error) { - u := "user/projects" - req, err := s.client.NewRequest("POST", u, opts) - if err != nil { - return nil, nil, err - } - - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeProjectsPreview) - - project := &Project{} - resp, err := s.client.Do(ctx, req, project) - if err != nil { - return nil, resp, err - } - - return project, resp, nil -} diff --git a/vendor/github.com/google/go-github/v66/AUTHORS b/vendor/github.com/google/go-github/v74/AUTHORS similarity index 97% rename from vendor/github.com/google/go-github/v66/AUTHORS rename to vendor/github.com/google/go-github/v74/AUTHORS index d211645098..a6104ffa9a 100644 --- a/vendor/github.com/google/go-github/v66/AUTHORS +++ b/vendor/github.com/google/go-github/v74/AUTHORS @@ -20,6 +20,7 @@ Abhishek Sharma Abhishek Veeramalla aboy Adam Kohring +Aditya Mahendrakar adrienzieba afdesk Ahmad Nurus S @@ -39,6 +40,7 @@ Alex Su Alex Unger Alexander Harkness Alexey Alekhin +Alexis Couvreur Alexis Gauthiez Ali Farooq Alin Balutoiu @@ -48,6 +50,7 @@ Amey Sakhadeo Anders Janmyr Andreas Deininger Andreas Garnæs +Andrew Gillis Andrew Ryabchun Andrew Svoboda Andriyun @@ -110,6 +113,7 @@ chandresh-pancholi Charles Fenwick Elliott Charlie Yan Chmouel Boudjnah +Chris Allen Lane Chris King Chris Mc Chris Raborg @@ -170,6 +174,7 @@ eperm Erick Fejta Erik Elkins Erik Nobel +Erwan Finot erwinvaneyk Evan Anderson Evan Elias @@ -207,6 +212,7 @@ Hari haran Harikesh00 haya14busa haya14busa +Henrik Lundström Hiroki Ito Hubot Jr Huy Tr @@ -219,6 +225,7 @@ Ioannis Georgoulas Isao Jonas ishan upadhyay isqua +Ivan Martos Jacob Valdemar Jake Krammer Jake Scaltreto @@ -343,6 +350,7 @@ MichaÅ‚ Glapa Michelangelo Morrillo Miguel Elias dos Santos Mike Chen +Miles Crabill Mishin Nikolai mohammad ali <2018cs92@student.uet.edu.pk> Mohammed AlDujaili @@ -373,6 +381,7 @@ ns-cweber nxya Ole Orhagen Oleg Kovalov +Oleksandr Redko OndÅ™ej Kupka Ori Talmor Osama Faqhruldin @@ -472,6 +481,7 @@ SoundCloud, Ltd. Sridhar Mocherla SriVignessh Pss Stefan Sedich +Steve Hipwell Steve Teuber Stian Eikeland Suhaib Mujahid diff --git a/vendor/github.com/google/go-github/v66/LICENSE b/vendor/github.com/google/go-github/v74/LICENSE similarity index 100% rename from vendor/github.com/google/go-github/v66/LICENSE rename to vendor/github.com/google/go-github/v74/LICENSE diff --git a/vendor/github.com/google/go-github/v66/github/actions.go b/vendor/github.com/google/go-github/v74/github/actions.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/actions.go rename to vendor/github.com/google/go-github/v74/github/actions.go diff --git a/vendor/github.com/google/go-github/v66/github/actions_artifacts.go b/vendor/github.com/google/go-github/v74/github/actions_artifacts.go similarity index 74% rename from vendor/github.com/google/go-github/v66/github/actions_artifacts.go rename to vendor/github.com/google/go-github/v74/github/actions_artifacts.go index e05a9a8402..73641559db 100644 --- a/vendor/github.com/google/go-github/v66/github/actions_artifacts.go +++ b/vendor/github.com/google/go-github/v74/github/actions_artifacts.go @@ -29,17 +29,21 @@ type ArtifactWorkflowRun struct { // // GitHub API docs: https://docs.github.com/rest/actions/artifacts type Artifact struct { - ID *int64 `json:"id,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Name *string `json:"name,omitempty"` - SizeInBytes *int64 `json:"size_in_bytes,omitempty"` - URL *string `json:"url,omitempty"` - ArchiveDownloadURL *string `json:"archive_download_url,omitempty"` - Expired *bool `json:"expired,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - ExpiresAt *Timestamp `json:"expires_at,omitempty"` - WorkflowRun *ArtifactWorkflowRun `json:"workflow_run,omitempty"` + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Name *string `json:"name,omitempty"` + SizeInBytes *int64 `json:"size_in_bytes,omitempty"` + URL *string `json:"url,omitempty"` + ArchiveDownloadURL *string `json:"archive_download_url,omitempty"` + Expired *bool `json:"expired,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + ExpiresAt *Timestamp `json:"expires_at,omitempty"` + // Digest is the SHA256 digest of the artifact. + // This field will only be populated on artifacts uploaded with upload-artifact v4 or newer. + // For older versions, this field will be null. + Digest *string `json:"digest,omitempty"` + WorkflowRun *ArtifactWorkflowRun `json:"workflow_run,omitempty"` } // ArtifactList represents a list of GitHub artifacts. @@ -142,6 +146,14 @@ func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, ar func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo string, artifactID int64, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v/zip", owner, repo, artifactID) + if s.client.RateLimitRedirectionalEndpoints { + return s.downloadArtifactWithRateLimit(ctx, u, maxRedirects) + } + + return s.downloadArtifactWithoutRateLimit(ctx, u, maxRedirects) +} + +func (s *ActionsService) downloadArtifactWithoutRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects) if err != nil { return nil, nil, err @@ -149,7 +161,7 @@ func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo strin defer resp.Body.Close() if resp.StatusCode != http.StatusFound { - return nil, newResponse(resp), fmt.Errorf("unexpected status code: %s", resp.Status) + return nil, newResponse(resp), fmt.Errorf("unexpected status code: %v", resp.Status) } parsedURL, err := url.Parse(resp.Header.Get("Location")) @@ -160,6 +172,26 @@ func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo strin return parsedURL, newResponse(resp), nil } +func (s *ActionsService) downloadArtifactWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + url, resp, err := s.client.bareDoUntilFound(ctx, req, maxRedirects) + if err != nil { + return nil, resp, err + } + defer resp.Body.Close() + + // If we didn't receive a valid Location in a 302 response + if url == nil { + return nil, resp, fmt.Errorf("unexpected status code: %v", resp.Status) + } + + return url, resp, nil +} + // DeleteArtifact deletes a workflow run artifact. // // GitHub API docs: https://docs.github.com/rest/actions/artifacts#delete-an-artifact diff --git a/vendor/github.com/google/go-github/v66/github/actions_cache.go b/vendor/github.com/google/go-github/v74/github/actions_cache.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/actions_cache.go rename to vendor/github.com/google/go-github/v74/github/actions_cache.go diff --git a/vendor/github.com/google/go-github/v74/github/actions_hosted_runners.go b/vendor/github.com/google/go-github/v74/github/actions_hosted_runners.go new file mode 100644 index 0000000000..dbe1f6b5b1 --- /dev/null +++ b/vendor/github.com/google/go-github/v74/github/actions_hosted_runners.go @@ -0,0 +1,376 @@ +// Copyright 2025 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "errors" + "fmt" +) + +// HostedRunnerPublicIP represents the details of a public IP for GitHub-hosted runner. +type HostedRunnerPublicIP struct { + Enabled bool `json:"enabled"` // Whether public IP is enabled. + Prefix string `json:"prefix"` // The prefix for the public IP. Example: 20.80.208.150 + Length int `json:"length"` // The length of the IP prefix. Example: 28 +} + +// HostedRunnerMachineSpec represents the details of a particular machine specification for GitHub-hosted runner. +type HostedRunnerMachineSpec struct { + ID string `json:"id"` // The ID used for the `size` parameter when creating a new runner. Example: 8-core + CPUCores int `json:"cpu_cores"` // The number of cores. Example: 8 + MemoryGB int `json:"memory_gb"` // The available RAM for the machine spec. Example: 32 + StorageGB int `json:"storage_gb"` // The available SSD storage for the machine spec. Example: 300 +} + +// HostedRunner represents a single GitHub-hosted runner with additional details. +type HostedRunner struct { + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + RunnerGroupID *int64 `json:"runner_group_id,omitempty"` + Platform *string `json:"platform,omitempty"` + ImageDetails *HostedRunnerImageDetail `json:"image_details,omitempty"` + MachineSizeDetails *HostedRunnerMachineSpec `json:"machine_size_details,omitempty"` + Status *string `json:"status,omitempty"` + MaximumRunners *int64 `json:"maximum_runners,omitempty"` + PublicIPEnabled *bool `json:"public_ip_enabled,omitempty"` + PublicIPs []*HostedRunnerPublicIP `json:"public_ips,omitempty"` + LastActiveOn *Timestamp `json:"last_active_on,omitempty"` +} + +// HostedRunnerImageDetail represents the image details of a GitHub-hosted runners. +type HostedRunnerImageDetail struct { + ID *string `json:"id"` // The ID of the image. Use this ID for the `image` parameter when creating a new larger runner. Example: ubuntu-20.04 + SizeGB *int64 `json:"size_gb"` // Image size in GB. Example: 86 + DisplayName *string `json:"display_name"` // Display name for this image. Example: 20.04 + Source *string `json:"source"` // The image provider. Example: github, partner, custom + Version *string `json:"version"` // The image version of the hosted runner pool. Example: latest +} + +// HostedRunners represents a collection of GitHub-hosted runners for an organization. +type HostedRunners struct { + TotalCount int `json:"total_count"` + Runners []*HostedRunner `json:"runners"` +} + +// ListHostedRunners lists all the GitHub-hosted runners for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#list-github-hosted-runners-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners +func (s *ActionsService) ListHostedRunners(ctx context.Context, org string, opts *ListOptions) (*HostedRunners, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + runners := &HostedRunners{} + resp, err := s.client.Do(ctx, req, &runners) + if err != nil { + return nil, resp, err + } + + return runners, resp, nil +} + +// HostedRunnerImage represents the image of GitHub-hosted runners. +// To list all available images, use GET /actions/hosted-runners/images/github-owned or GET /actions/hosted-runners/images/partner. +type HostedRunnerImage struct { + ID string `json:"id"` + Source string `json:"source"` + Version string `json:"version"` +} + +// HostedRunnerRequest specifies body parameters to Hosted Runner configuration. +type HostedRunnerRequest struct { + Name string `json:"name,omitempty"` + Image HostedRunnerImage `json:"image,omitempty"` + RunnerGroupID int64 `json:"runner_group_id,omitempty"` + Size string `json:"size,omitempty"` + MaximumRunners int64 `json:"maximum_runners,omitempty"` + EnableStaticIP bool `json:"enable_static_ip,omitempty"` + ImageVersion string `json:"image_version,omitempty"` +} + +// validateCreateHostedRunnerRequest validates the provided HostedRunnerRequest to ensure +// that all required fields are properly set and that no invalid fields are present for hosted runner create request. +// +// If any of these conditions are violated, an appropriate error message is returned. +// Otherwise, nil is returned, indicating the request is valid. +func validateCreateHostedRunnerRequest(request *HostedRunnerRequest) error { + if request.Size == "" { + return errors.New("size is required for creating a hosted runner") + } + if request.Image == (HostedRunnerImage{}) { + return errors.New("image is required for creating a hosted runner") + } + if request.Name == "" { + return errors.New("name is required for creating a hosted runner") + } + if request.RunnerGroupID == 0 { + return errors.New("runner group ID is required for creating a hosted runner") + } + if request.ImageVersion != "" { + return errors.New("imageVersion should not be set directly; use the Image struct to specify image details") + } + return nil +} + +// CreateHostedRunner creates a GitHub-hosted runner for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#create-a-github-hosted-runner-for-an-organization +// +//meta:operation POST /orgs/{org}/actions/hosted-runners +func (s *ActionsService) CreateHostedRunner(ctx context.Context, org string, request *HostedRunnerRequest) (*HostedRunner, *Response, error) { + if err := validateCreateHostedRunnerRequest(request); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("orgs/%v/actions/hosted-runners", org) + req, err := s.client.NewRequest("POST", u, request) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// HostedRunnerImageSpecs represents the details of a GitHub-hosted runner image. +type HostedRunnerImageSpecs struct { + ID string `json:"id"` + Platform string `json:"platform"` + SizeGB int `json:"size_gb"` + DisplayName string `json:"display_name"` + Source string `json:"source"` +} + +// HostedRunnerImages represents the response containing the total count and details of runner images. +type HostedRunnerImages struct { + TotalCount int `json:"total_count"` + Images []*HostedRunnerImageSpecs `json:"images"` +} + +// GetHostedRunnerGitHubOwnedImages gets the list of GitHub-owned images available for GitHub-hosted runners for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-github-owned-images-for-github-hosted-runners-in-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/images/github-owned +func (s *ActionsService) GetHostedRunnerGitHubOwnedImages(ctx context.Context, org string) (*HostedRunnerImages, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/github-owned", org) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunnerImages := new(HostedRunnerImages) + resp, err := s.client.Do(ctx, req, hostedRunnerImages) + if err != nil { + return nil, resp, err + } + + return hostedRunnerImages, resp, nil +} + +// GetHostedRunnerPartnerImages gets the list of partner images available for GitHub-hosted runners for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-partner-images-for-github-hosted-runners-in-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/images/partner +func (s *ActionsService) GetHostedRunnerPartnerImages(ctx context.Context, org string) (*HostedRunnerImages, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/partner", org) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunnerImages := new(HostedRunnerImages) + resp, err := s.client.Do(ctx, req, hostedRunnerImages) + if err != nil { + return nil, resp, err + } + + return hostedRunnerImages, resp, nil +} + +// HostedRunnerPublicIPLimits represents the static public IP limits for GitHub-hosted runners. +type HostedRunnerPublicIPLimits struct { + PublicIPs *PublicIPUsage `json:"public_ips"` +} + +// PublicIPUsage provides details of static public IP limits for GitHub-hosted runners. +type PublicIPUsage struct { + Maximum int64 `json:"maximum"` // The maximum number of static public IP addresses that can be used for Hosted Runners. Example: 50 + CurrentUsage int64 `json:"current_usage"` // The current number of static public IP addresses in use by Hosted Runners. Example: 17 +} + +// GetHostedRunnerLimits gets the GitHub-hosted runners Static public IP Limits for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-limits-on-github-hosted-runners-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/limits +func (s *ActionsService) GetHostedRunnerLimits(ctx context.Context, org string) (*HostedRunnerPublicIPLimits, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/limits", org) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + publicIPLimits := new(HostedRunnerPublicIPLimits) + resp, err := s.client.Do(ctx, req, publicIPLimits) + if err != nil { + return nil, resp, err + } + + return publicIPLimits, resp, nil +} + +// HostedRunnerMachineSpecs represents the response containing the total count and details of machine specs for GitHub-hosted runners. +type HostedRunnerMachineSpecs struct { + TotalCount int `json:"total_count"` + MachineSpecs []*HostedRunnerMachineSpec `json:"machine_specs"` +} + +// GetHostedRunnerMachineSpecs gets the list of machine specs available for GitHub-hosted runners for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-github-hosted-runners-machine-specs-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/machine-sizes +func (s *ActionsService) GetHostedRunnerMachineSpecs(ctx context.Context, org string) (*HostedRunnerMachineSpecs, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/machine-sizes", org) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + machineSpecs := new(HostedRunnerMachineSpecs) + resp, err := s.client.Do(ctx, req, machineSpecs) + if err != nil { + return nil, resp, err + } + + return machineSpecs, resp, nil +} + +// HostedRunnerPlatforms represents the response containing the total count and platforms for GitHub-hosted runners. +type HostedRunnerPlatforms struct { + TotalCount int `json:"total_count"` + Platforms []string `json:"platforms"` +} + +// GetHostedRunnerPlatforms gets list of platforms available for GitHub-hosted runners for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-platforms-for-github-hosted-runners-in-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/platforms +func (s *ActionsService) GetHostedRunnerPlatforms(ctx context.Context, org string) (*HostedRunnerPlatforms, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/platforms", org) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + platforms := new(HostedRunnerPlatforms) + resp, err := s.client.Do(ctx, req, platforms) + if err != nil { + return nil, resp, err + } + + return platforms, resp, nil +} + +// GetHostedRunner gets a GitHub-hosted runner in an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-a-github-hosted-runner-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id} +func (s *ActionsService) GetHostedRunner(ctx context.Context, org string, runnerID int64) (*HostedRunner, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/%v", org, runnerID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// validateUpdateHostedRunnerRequest validates the provided HostedRunnerRequest to ensure +// that no disallowed updates are made for a hosted runner update request. +// +// If any of these conditions are violated, an appropriate error message is returned. +// Otherwise, nil is returned, indicating the request is valid for an update. +func validateUpdateHostedRunnerRequest(request *HostedRunnerRequest) error { + if request.Size != "" { + return errors.New("size cannot be updated, API does not support updating size") + } + if request.Image != (HostedRunnerImage{}) { + return errors.New("image struct should not be set directly; use the ImageVersion to specify version details") + } + return nil +} + +// UpdateHostedRunner updates a GitHub-hosted runner for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#update-a-github-hosted-runner-for-an-organization +// +//meta:operation PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id} +func (s *ActionsService) UpdateHostedRunner(ctx context.Context, org string, runnerID int64, updateReq HostedRunnerRequest) (*HostedRunner, *Response, error) { + if err := validateUpdateHostedRunnerRequest(&updateReq); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/%v", org, runnerID) + req, err := s.client.NewRequest("PATCH", u, updateReq) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// DeleteHostedRunner deletes GitHub-hosted runner from an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#delete-a-github-hosted-runner-for-an-organization +// +//meta:operation DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id} +func (s *ActionsService) DeleteHostedRunner(ctx context.Context, org string, runnerID int64) (*HostedRunner, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/%v", org, runnerID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} diff --git a/vendor/github.com/google/go-github/v66/github/actions_oidc.go b/vendor/github.com/google/go-github/v74/github/actions_oidc.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/actions_oidc.go rename to vendor/github.com/google/go-github/v74/github/actions_oidc.go diff --git a/vendor/github.com/google/go-github/v66/github/actions_permissions_enterprise.go b/vendor/github.com/google/go-github/v74/github/actions_permissions_enterprise.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/actions_permissions_enterprise.go rename to vendor/github.com/google/go-github/v74/github/actions_permissions_enterprise.go diff --git a/vendor/github.com/google/go-github/v66/github/actions_permissions_orgs.go b/vendor/github.com/google/go-github/v74/github/actions_permissions_orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/actions_permissions_orgs.go rename to vendor/github.com/google/go-github/v74/github/actions_permissions_orgs.go diff --git a/vendor/github.com/google/go-github/v66/github/actions_runner_groups.go b/vendor/github.com/google/go-github/v74/github/actions_runner_groups.go similarity index 84% rename from vendor/github.com/google/go-github/v66/github/actions_runner_groups.go rename to vendor/github.com/google/go-github/v74/github/actions_runner_groups.go index a1f453f3c6..b2ee32f614 100644 --- a/vendor/github.com/google/go-github/v66/github/actions_runner_groups.go +++ b/vendor/github.com/google/go-github/v74/github/actions_runner_groups.go @@ -80,7 +80,7 @@ type ListOrgRunnerGroupOptions struct { // ListOrganizationRunnerGroups lists all self-hosted runner groups configured in an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization // //meta:operation GET /orgs/{org}/actions/runner-groups func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org string, opts *ListOrgRunnerGroupOptions) (*RunnerGroups, *Response, error) { @@ -106,7 +106,7 @@ func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org s // GetOrganizationRunnerGroup gets a specific self-hosted runner group for an organization using its RunnerGroup ID. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization // //meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id} func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*RunnerGroup, *Response, error) { @@ -127,7 +127,7 @@ func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org str // DeleteOrganizationRunnerGroup deletes a self-hosted runner group from an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization // //meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id} func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*Response, error) { @@ -143,7 +143,7 @@ func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org // CreateOrganizationRunnerGroup creates a new self-hosted runner group for an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization // //meta:operation POST /orgs/{org}/actions/runner-groups func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org string, createReq CreateRunnerGroupRequest) (*RunnerGroup, *Response, error) { @@ -164,7 +164,7 @@ func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org // UpdateOrganizationRunnerGroup updates a self-hosted runner group for an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization // //meta:operation PATCH /orgs/{org}/actions/runner-groups/{runner_group_id} func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org string, groupID int64, updateReq UpdateRunnerGroupRequest) (*RunnerGroup, *Response, error) { @@ -185,7 +185,7 @@ func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org // ListRepositoryAccessRunnerGroup lists the repositories with access to a self-hosted runner group configured in an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization // //meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, opts *ListOptions) (*ListRepositories, *Response, error) { @@ -212,7 +212,7 @@ func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, or // SetRepositoryAccessRunnerGroup replaces the list of repositories that have access to a self-hosted runner group configured in an organization // with a new List of repositories. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization // //meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, ids SetRepoAccessRunnerGroupRequest) (*Response, error) { @@ -229,7 +229,7 @@ func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org // AddRepositoryAccessRunnerGroup adds a repository to the list of selected repositories that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization // //meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { @@ -246,7 +246,7 @@ func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org // RemoveRepositoryAccessRunnerGroup removes a repository from the list of selected repositories that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization // //meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { @@ -262,7 +262,7 @@ func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, // ListRunnerGroupRunners lists self-hosted runners that are in a specific organization group. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization // //meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, groupID int64, opts *ListOptions) (*Runners, *Response, error) { @@ -289,7 +289,7 @@ func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, // SetRunnerGroupRunners replaces the list of self-hosted runners that are part of an organization runner group // with a new list of runners. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization // //meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error) { @@ -305,7 +305,7 @@ func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, // AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization // //meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { @@ -322,7 +322,7 @@ func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, // RemoveRunnerGroupRunners removes a self-hosted runner from a group configured in an organization. // The runner is then returned to the default group. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization // //meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *ActionsService) RemoveRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v66/github/actions_runners.go b/vendor/github.com/google/go-github/v74/github/actions_runners.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/actions_runners.go rename to vendor/github.com/google/go-github/v74/github/actions_runners.go diff --git a/vendor/github.com/google/go-github/v66/github/actions_secrets.go b/vendor/github.com/google/go-github/v74/github/actions_secrets.go similarity index 99% rename from vendor/github.com/google/go-github/v66/github/actions_secrets.go rename to vendor/github.com/google/go-github/v74/github/actions_secrets.go index ec519838ea..ff09b4ee58 100644 --- a/vendor/github.com/google/go-github/v66/github/actions_secrets.go +++ b/vendor/github.com/google/go-github/v74/github/actions_secrets.go @@ -23,8 +23,8 @@ type PublicKey struct { // do not error out when unmarshaling. func (p *PublicKey) UnmarshalJSON(data []byte) error { var pk struct { - KeyID interface{} `json:"key_id"` - Key *string `json:"key"` + KeyID any `json:"key_id"` + Key *string `json:"key"` } if err := json.Unmarshal(data, &pk); err != nil { @@ -39,7 +39,7 @@ func (p *PublicKey) UnmarshalJSON(data []byte) error { case string: p.KeyID = &v case float64: - p.KeyID = String(strconv.FormatFloat(v, 'f', -1, 64)) + p.KeyID = Ptr(strconv.FormatFloat(v, 'f', -1, 64)) default: return fmt.Errorf("unable to unmarshal %T as a string", v) } diff --git a/vendor/github.com/google/go-github/v66/github/actions_variables.go b/vendor/github.com/google/go-github/v74/github/actions_variables.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/actions_variables.go rename to vendor/github.com/google/go-github/v74/github/actions_variables.go diff --git a/vendor/github.com/google/go-github/v66/github/actions_workflow_jobs.go b/vendor/github.com/google/go-github/v74/github/actions_workflow_jobs.go similarity index 86% rename from vendor/github.com/google/go-github/v66/github/actions_workflow_jobs.go rename to vendor/github.com/google/go-github/v74/github/actions_workflow_jobs.go index 84bbe5aa46..10067c8b26 100644 --- a/vendor/github.com/google/go-github/v66/github/actions_workflow_jobs.go +++ b/vendor/github.com/google/go-github/v74/github/actions_workflow_jobs.go @@ -150,6 +150,14 @@ func (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo str func (s *ActionsService) GetWorkflowJobLogs(ctx context.Context, owner, repo string, jobID int64, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/jobs/%v/logs", owner, repo, jobID) + if s.client.RateLimitRedirectionalEndpoints { + return s.getWorkflowJobLogsWithRateLimit(ctx, u, maxRedirects) + } + + return s.getWorkflowJobLogsWithoutRateLimit(ctx, u, maxRedirects) +} + +func (s *ActionsService) getWorkflowJobLogsWithoutRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects) if err != nil { return nil, nil, err @@ -157,9 +165,29 @@ func (s *ActionsService) GetWorkflowJobLogs(ctx context.Context, owner, repo str defer resp.Body.Close() if resp.StatusCode != http.StatusFound { - return nil, newResponse(resp), fmt.Errorf("unexpected status code: %s", resp.Status) + return nil, newResponse(resp), fmt.Errorf("unexpected status code: %v", resp.Status) } parsedURL, err := url.Parse(resp.Header.Get("Location")) return parsedURL, newResponse(resp), err } + +func (s *ActionsService) getWorkflowJobLogsWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + url, resp, err := s.client.bareDoUntilFound(ctx, req, maxRedirects) + if err != nil { + return nil, resp, err + } + defer resp.Body.Close() + + // If we didn't receive a valid Location in a 302 response + if url == nil { + return nil, resp, fmt.Errorf("unexpected status code: %v", resp.Status) + } + + return url, resp, nil +} diff --git a/vendor/github.com/google/go-github/v66/github/actions_workflow_runs.go b/vendor/github.com/google/go-github/v74/github/actions_workflow_runs.go similarity index 82% rename from vendor/github.com/google/go-github/v66/github/actions_workflow_runs.go rename to vendor/github.com/google/go-github/v74/github/actions_workflow_runs.go index 122ea1d0e2..20b9cfcd50 100644 --- a/vendor/github.com/google/go-github/v66/github/actions_workflow_runs.go +++ b/vendor/github.com/google/go-github/v74/github/actions_workflow_runs.go @@ -204,6 +204,7 @@ func (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, } // GetWorkflowRunByID gets a specific workflow run by ID. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run // @@ -226,6 +227,7 @@ func (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo str } // GetWorkflowRunAttempt gets a specific workflow run attempt. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run-attempt // @@ -252,6 +254,7 @@ func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo } // GetWorkflowRunAttemptLogs gets a redirect URL to download a plain text file of logs for a workflow run for attempt number. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve a workflow run ID from the DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs // @@ -259,6 +262,14 @@ func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, repo string, runID int64, attemptNumber int, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/attempts/%v/logs", owner, repo, runID, attemptNumber) + if s.client.RateLimitRedirectionalEndpoints { + return s.getWorkflowRunAttemptLogsWithRateLimit(ctx, u, maxRedirects) + } + + return s.getWorkflowRunAttemptLogsWithoutRateLimit(ctx, u, maxRedirects) +} + +func (s *ActionsService) getWorkflowRunAttemptLogsWithoutRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects) if err != nil { return nil, nil, err @@ -266,14 +277,35 @@ func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, r defer resp.Body.Close() if resp.StatusCode != http.StatusFound { - return nil, newResponse(resp), fmt.Errorf("unexpected status code: %s", resp.Status) + return nil, newResponse(resp), fmt.Errorf("unexpected status code: %v", resp.Status) } parsedURL, err := url.Parse(resp.Header.Get("Location")) return parsedURL, newResponse(resp), err } +func (s *ActionsService) getWorkflowRunAttemptLogsWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + url, resp, err := s.client.bareDoUntilFound(ctx, req, maxRedirects) + if err != nil { + return nil, resp, err + } + defer resp.Body.Close() + + // If we didn't receive a valid Location in a 302 response + if url == nil { + return nil, resp, fmt.Errorf("unexpected status code: %v", resp.Status) + } + + return url, resp, nil +} + // RerunWorkflowByID re-runs a workflow by ID. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID a the DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow // @@ -290,6 +322,7 @@ func (s *ActionsService) RerunWorkflowByID(ctx context.Context, owner, repo stri } // RerunFailedJobsByID re-runs all of the failed jobs and their dependent jobs in a workflow run by ID. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run // @@ -307,6 +340,8 @@ func (s *ActionsService) RerunFailedJobsByID(ctx context.Context, owner, repo st // RerunJobByID re-runs a job and its dependent jobs in a workflow run by ID. // +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. +// // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run // //meta:operation POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun @@ -322,6 +357,7 @@ func (s *ActionsService) RerunJobByID(ctx context.Context, owner, repo string, j } // CancelWorkflowRunByID cancels a workflow run by ID. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run // @@ -338,6 +374,7 @@ func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo } // GetWorkflowRunLogs gets a redirect URL to download a plain text file of logs for a workflow run. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs // @@ -345,6 +382,14 @@ func (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/logs", owner, repo, runID) + if s.client.RateLimitRedirectionalEndpoints { + return s.getWorkflowRunLogsWithRateLimit(ctx, u, maxRedirects) + } + + return s.getWorkflowRunLogsWithoutRateLimit(ctx, u, maxRedirects) +} + +func (s *ActionsService) getWorkflowRunLogsWithoutRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects) if err != nil { return nil, nil, err @@ -359,7 +404,28 @@ func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo str return parsedURL, newResponse(resp), err } +func (s *ActionsService) getWorkflowRunLogsWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + url, resp, err := s.client.bareDoUntilFound(ctx, req, maxRedirects) + if err != nil { + return nil, resp, err + } + defer resp.Body.Close() + + // If we didn't receive a valid Location in a 302 response + if url == nil { + return nil, resp, fmt.Errorf("unexpected status code: %v", resp.Status) + } + + return url, resp, nil +} + // DeleteWorkflowRun deletes a workflow run by ID. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run // @@ -376,6 +442,7 @@ func (s *ActionsService) DeleteWorkflowRun(ctx context.Context, owner, repo stri } // DeleteWorkflowRunLogs deletes all logs for a workflow run. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs // @@ -392,6 +459,7 @@ func (s *ActionsService) DeleteWorkflowRunLogs(ctx context.Context, owner, repo } // GetWorkflowRunUsageByID gets a specific workflow usage run by run ID in the unit of billable milliseconds. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage // @@ -414,6 +482,7 @@ func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, rep } // GetPendingDeployments get all deployment environments for a workflow run that are waiting for protection rules to pass. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-pending-deployments-for-a-workflow-run // @@ -436,6 +505,7 @@ func (s *ActionsService) GetPendingDeployments(ctx context.Context, owner, repo } // PendingDeployments approve or reject pending deployments that are waiting on approval by a required reviewer. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run // @@ -458,6 +528,7 @@ func (s *ActionsService) PendingDeployments(ctx context.Context, owner, repo str } // ReviewCustomDeploymentProtectionRule approves or rejects custom deployment protection rules provided by a GitHub App for a workflow run. +// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run // diff --git a/vendor/github.com/google/go-github/v66/github/actions_workflows.go b/vendor/github.com/google/go-github/v74/github/actions_workflows.go similarity index 99% rename from vendor/github.com/google/go-github/v66/github/actions_workflows.go rename to vendor/github.com/google/go-github/v74/github/actions_workflows.go index 0214e6abff..4d9df69eb0 100644 --- a/vendor/github.com/google/go-github/v66/github/actions_workflows.go +++ b/vendor/github.com/google/go-github/v74/github/actions_workflows.go @@ -53,7 +53,7 @@ type CreateWorkflowDispatchEventRequest struct { // Inputs represents input keys and values configured in the workflow file. // The maximum number of properties is 10. // Default: Any default properties configured in the workflow file will be used when `inputs` are omitted. - Inputs map[string]interface{} `json:"inputs,omitempty"` + Inputs map[string]any `json:"inputs,omitempty"` } // ListWorkflows lists all workflows in a repository. diff --git a/vendor/github.com/google/go-github/v66/github/activity.go b/vendor/github.com/google/go-github/v74/github/activity.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/activity.go rename to vendor/github.com/google/go-github/v74/github/activity.go diff --git a/vendor/github.com/google/go-github/v66/github/activity_events.go b/vendor/github.com/google/go-github/v74/github/activity_events.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/activity_events.go rename to vendor/github.com/google/go-github/v74/github/activity_events.go diff --git a/vendor/github.com/google/go-github/v66/github/activity_notifications.go b/vendor/github.com/google/go-github/v74/github/activity_notifications.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/activity_notifications.go rename to vendor/github.com/google/go-github/v74/github/activity_notifications.go diff --git a/vendor/github.com/google/go-github/v66/github/activity_star.go b/vendor/github.com/google/go-github/v74/github/activity_star.go similarity index 94% rename from vendor/github.com/google/go-github/v66/github/activity_star.go rename to vendor/github.com/google/go-github/v74/github/activity_star.go index cebdacf76a..782c09884d 100644 --- a/vendor/github.com/google/go-github/v66/github/activity_star.go +++ b/vendor/github.com/google/go-github/v74/github/activity_star.go @@ -40,8 +40,7 @@ func (s *ActivityService) ListStargazers(ctx context.Context, owner, repo string return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeStarringPreview) + req.Header.Set("Accept", mediaTypeStarring) var stargazers []*Stargazer resp, err := s.client.Do(ctx, req, &stargazers) @@ -91,8 +90,7 @@ func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *Ac return nil, nil, err } - // TODO: remove custom Accept header when APIs fully launch - acceptHeaders := []string{mediaTypeStarringPreview, mediaTypeTopicsPreview} + acceptHeaders := []string{mediaTypeStarring, mediaTypeTopicsPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) var repos []*StarredRepository diff --git a/vendor/github.com/google/go-github/v66/github/activity_watching.go b/vendor/github.com/google/go-github/v74/github/activity_watching.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/activity_watching.go rename to vendor/github.com/google/go-github/v74/github/activity_watching.go diff --git a/vendor/github.com/google/go-github/v66/github/admin.go b/vendor/github.com/google/go-github/v74/github/admin.go similarity index 97% rename from vendor/github.com/google/go-github/v66/github/admin.go rename to vendor/github.com/google/go-github/v74/github/admin.go index c932cbe6ad..021a12ad8c 100644 --- a/vendor/github.com/google/go-github/v66/github/admin.go +++ b/vendor/github.com/google/go-github/v74/github/admin.go @@ -82,7 +82,7 @@ func (m Enterprise) String() string { // UpdateUserLDAPMapping updates the mapping between a GitHub user and an LDAP user. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user // //meta:operation PATCH /admin/ldap/users/{username}/mapping func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, mapping *UserLDAPMapping) (*UserLDAPMapping, *Response, error) { @@ -103,7 +103,7 @@ func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, m // UpdateTeamLDAPMapping updates the mapping between a GitHub team and an LDAP group. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team // //meta:operation PATCH /admin/ldap/teams/{team_id}/mapping func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error) { diff --git a/vendor/github.com/google/go-github/v66/github/admin_orgs.go b/vendor/github.com/google/go-github/v74/github/admin_orgs.go similarity index 93% rename from vendor/github.com/google/go-github/v66/github/admin_orgs.go rename to vendor/github.com/google/go-github/v74/github/admin_orgs.go index f1e728707d..f111d36ce9 100644 --- a/vendor/github.com/google/go-github/v66/github/admin_orgs.go +++ b/vendor/github.com/google/go-github/v74/github/admin_orgs.go @@ -22,7 +22,7 @@ type createOrgRequest struct { // Note that only a subset of the org fields are used and org must // not be nil. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/orgs#create-an-organization +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/orgs#create-an-organization // //meta:operation POST /admin/organizations func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error) { @@ -61,7 +61,7 @@ type RenameOrgResponse struct { // RenameOrg renames an organization in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/orgs#update-an-organization-name // //meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error) { @@ -70,7 +70,7 @@ func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName // RenameOrgByName renames an organization in GitHub Enterprise using its current name. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/orgs#update-an-organization-name // //meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error) { diff --git a/vendor/github.com/google/go-github/v66/github/admin_stats.go b/vendor/github.com/google/go-github/v74/github/admin_stats.go similarity index 93% rename from vendor/github.com/google/go-github/v66/github/admin_stats.go rename to vendor/github.com/google/go-github/v74/github/admin_stats.go index 51b7d86fc3..07465b8d62 100644 --- a/vendor/github.com/google/go-github/v66/github/admin_stats.go +++ b/vendor/github.com/google/go-github/v74/github/admin_stats.go @@ -118,13 +118,13 @@ func (s GistStats) String() string { return Stringify(s) } -// PullStats represents the number of total, merged, mergable and unmergeable +// PullStats represents the number of total, merged, mergeable and unmergeable // pull-requests. type PullStats struct { - TotalPulls *int `json:"total_pulls,omitempty"` - MergedPulls *int `json:"merged_pulls,omitempty"` - MergablePulls *int `json:"mergeable_pulls,omitempty"` - UnmergablePulls *int `json:"unmergeable_pulls,omitempty"` + TotalPulls *int `json:"total_pulls,omitempty"` + MergedPulls *int `json:"merged_pulls,omitempty"` + MergeablePulls *int `json:"mergeable_pulls,omitempty"` + UnmergeablePulls *int `json:"unmergeable_pulls,omitempty"` } func (s PullStats) String() string { @@ -152,7 +152,7 @@ func (s RepoStats) String() string { // Please note that this is only available to site administrators, // otherwise it will error with a 404 not found (instead of 401 or 403). // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-all-statistics +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/admin-stats#get-all-statistics // //meta:operation GET /enterprise/stats/all func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) { diff --git a/vendor/github.com/google/go-github/v66/github/admin_users.go b/vendor/github.com/google/go-github/v74/github/admin_users.go similarity index 94% rename from vendor/github.com/google/go-github/v66/github/admin_users.go rename to vendor/github.com/google/go-github/v74/github/admin_users.go index e447f002ac..843a177be9 100644 --- a/vendor/github.com/google/go-github/v66/github/admin_users.go +++ b/vendor/github.com/google/go-github/v74/github/admin_users.go @@ -20,7 +20,7 @@ type CreateUserRequest struct { // CreateUser creates a new user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#create-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#create-a-user // //meta:operation POST /admin/users func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest) (*User, *Response, error) { @@ -42,7 +42,7 @@ func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest // DeleteUser deletes a user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#delete-a-user // //meta:operation DELETE /admin/users/{username} func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) { @@ -95,7 +95,7 @@ type UserAuthorization struct { // CreateUserImpersonation creates an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#create-an-impersonation-oauth-token // //meta:operation POST /admin/users/{username}/authorizations func (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error) { @@ -117,7 +117,7 @@ func (s *AdminService) CreateUserImpersonation(ctx context.Context, username str // DeleteUserImpersonation deletes an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#delete-an-impersonation-oauth-token // //meta:operation DELETE /admin/users/{username}/authorizations func (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v66/github/apps.go b/vendor/github.com/google/go-github/v74/github/apps.go similarity index 87% rename from vendor/github.com/google/go-github/v66/github/apps.go rename to vendor/github.com/google/go-github/v74/github/apps.go index 2f74c2c263..3dd392d083 100644 --- a/vendor/github.com/google/go-github/v66/github/apps.go +++ b/vendor/github.com/google/go-github/v74/github/apps.go @@ -80,22 +80,47 @@ type InstallationPermissions struct { Actions *string `json:"actions,omitempty"` ActionsVariables *string `json:"actions_variables,omitempty"` Administration *string `json:"administration,omitempty"` + Attestations *string `json:"attestations,omitempty"` Blocking *string `json:"blocking,omitempty"` Checks *string `json:"checks,omitempty"` + Codespaces *string `json:"codespaces,omitempty"` + CodespacesLifecycleAdmin *string `json:"codespaces_lifecycle_admin,omitempty"` + CodespacesMetadata *string `json:"codespaces_metadata,omitempty"` + CodespacesSecrets *string `json:"codespaces_secrets,omitempty"` + CodespacesUserSecrets *string `json:"codespaces_user_secrets,omitempty"` Contents *string `json:"contents,omitempty"` ContentReferences *string `json:"content_references,omitempty"` + CopilotMessages *string `json:"copilot_messages,omitempty"` + DependabotSecrets *string `json:"dependabot_secrets,omitempty"` Deployments *string `json:"deployments,omitempty"` + Discussions *string `json:"discussions,omitempty"` Emails *string `json:"emails,omitempty"` Environments *string `json:"environments,omitempty"` Followers *string `json:"followers,omitempty"` + Gists *string `json:"gists,omitempty"` + GitSigningSSHPublicKeys *string `json:"git_signing_ssh_public_keys,omitempty"` + GPGKeys *string `json:"gpg_keys,omitempty"` + InteractionLimits *string `json:"interaction_limits,omitempty"` Issues *string `json:"issues,omitempty"` + Keys *string `json:"keys,omitempty"` Metadata *string `json:"metadata,omitempty"` Members *string `json:"members,omitempty"` + MergeQueues *string `json:"merge_queues,omitempty"` + OrganizationActionsVariables *string `json:"organization_actions_variables,omitempty"` OrganizationAdministration *string `json:"organization_administration,omitempty"` + OrganizationAnnouncementBanners *string `json:"organization_announcement_banners,omitempty"` + OrganizationAPIInsights *string `json:"organization_api_insights,omitempty"` + OrganizationCodespaces *string `json:"organization_codespaces,omitempty"` + OrganizationCodespacesSecrets *string `json:"organization_codespaces_secrets,omitempty"` + OrganizationCodespacesSettings *string `json:"organization_codespaces_settings,omitempty"` + OrganizationCopilotSeatManagement *string `json:"organization_copilot_seat_management,omitempty"` OrganizationCustomProperties *string `json:"organization_custom_properties,omitempty"` OrganizationCustomRoles *string `json:"organization_custom_roles,omitempty"` OrganizationCustomOrgRoles *string `json:"organization_custom_org_roles,omitempty"` + OrganizationDependabotSecrets *string `json:"organization_dependabot_secrets,omitempty"` + OrganizationEvents *string `json:"organization_events,omitempty"` OrganizationHooks *string `json:"organization_hooks,omitempty"` + OrganizationKnowledgeBases *string `json:"organization_knowledge_bases,omitempty"` OrganizationPackages *string `json:"organization_packages,omitempty"` OrganizationPersonalAccessTokens *string `json:"organization_personal_access_tokens,omitempty"` OrganizationPersonalAccessTokenRequests *string `json:"organization_personal_access_token_requests,omitempty"` @@ -107,7 +132,11 @@ type InstallationPermissions struct { OrganizationUserBlocking *string `json:"organization_user_blocking,omitempty"` Packages *string `json:"packages,omitempty"` Pages *string `json:"pages,omitempty"` + Plan *string `json:"plan,omitempty"` + Profile *string `json:"profile,omitempty"` PullRequests *string `json:"pull_requests,omitempty"` + RepositoryAdvisories *string `json:"repository_advisories,omitempty"` + RepositoryCustomProperties *string `json:"repository_custom_properties,omitempty"` RepositoryHooks *string `json:"repository_hooks,omitempty"` RepositoryProjects *string `json:"repository_projects,omitempty"` RepositoryPreReceiveHooks *string `json:"repository_pre_receive_hooks,omitempty"` @@ -115,9 +144,12 @@ type InstallationPermissions struct { SecretScanningAlerts *string `json:"secret_scanning_alerts,omitempty"` SecurityEvents *string `json:"security_events,omitempty"` SingleFile *string `json:"single_file,omitempty"` + Starring *string `json:"starring,omitempty"` Statuses *string `json:"statuses,omitempty"` TeamDiscussions *string `json:"team_discussions,omitempty"` + UserEvents *string `json:"user_events,omitempty"` VulnerabilityAlerts *string `json:"vulnerability_alerts,omitempty"` + Watching *string `json:"watching,omitempty"` Workflows *string `json:"workflows,omitempty"` } @@ -393,7 +425,7 @@ func (s *AppsService) CreateInstallationTokenListRepos(ctx context.Context, id i //meta:operation POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments func (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID int64, title, body string) (*Attachment, *Response, error) { u := fmt.Sprintf("content_references/%v/attachments", contentReferenceID) - payload := &Attachment{Title: String(title), Body: String(body)} + payload := &Attachment{Title: Ptr(title), Body: Ptr(body)} req, err := s.client.NewRequest("POST", u, payload) if err != nil { return nil, nil, err diff --git a/vendor/github.com/google/go-github/v66/github/apps_hooks.go b/vendor/github.com/google/go-github/v74/github/apps_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/apps_hooks.go rename to vendor/github.com/google/go-github/v74/github/apps_hooks.go diff --git a/vendor/github.com/google/go-github/v66/github/apps_hooks_deliveries.go b/vendor/github.com/google/go-github/v74/github/apps_hooks_deliveries.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/apps_hooks_deliveries.go rename to vendor/github.com/google/go-github/v74/github/apps_hooks_deliveries.go diff --git a/vendor/github.com/google/go-github/v66/github/apps_installation.go b/vendor/github.com/google/go-github/v74/github/apps_installation.go similarity index 87% rename from vendor/github.com/google/go-github/v66/github/apps_installation.go rename to vendor/github.com/google/go-github/v74/github/apps_installation.go index d430511d07..57d6b4e76e 100644 --- a/vendor/github.com/google/go-github/v66/github/apps_installation.go +++ b/vendor/github.com/google/go-github/v74/github/apps_installation.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "strings" ) // ListRepositories represents the response from the list repos endpoints. @@ -33,14 +32,6 @@ func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) (*ListRe return nil, nil, err } - // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{ - mediaTypeTopicsPreview, - mediaTypeRepositoryVisibilityPreview, - mediaTypeRepositoryTemplatePreview, - } - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - var r *ListRepositories resp, err := s.client.Do(ctx, req, &r) @@ -69,14 +60,6 @@ func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOpt return nil, nil, err } - // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{ - mediaTypeTopicsPreview, - mediaTypeRepositoryVisibilityPreview, - mediaTypeRepositoryTemplatePreview, - } - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - var r *ListRepositories resp, err := s.client.Do(ctx, req, &r) if err != nil { diff --git a/vendor/github.com/google/go-github/v66/github/apps_manifest.go b/vendor/github.com/google/go-github/v74/github/apps_manifest.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/apps_manifest.go rename to vendor/github.com/google/go-github/v74/github/apps_manifest.go diff --git a/vendor/github.com/google/go-github/v66/github/apps_marketplace.go b/vendor/github.com/google/go-github/v74/github/apps_marketplace.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/apps_marketplace.go rename to vendor/github.com/google/go-github/v74/github/apps_marketplace.go diff --git a/vendor/github.com/google/go-github/v66/github/attestations.go b/vendor/github.com/google/go-github/v74/github/attestations.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/attestations.go rename to vendor/github.com/google/go-github/v74/github/attestations.go diff --git a/vendor/github.com/google/go-github/v66/github/authorizations.go b/vendor/github.com/google/go-github/v74/github/authorizations.go similarity index 98% rename from vendor/github.com/google/go-github/v66/github/authorizations.go rename to vendor/github.com/google/go-github/v74/github/authorizations.go index 5e63a3efb9..6f22e40a16 100644 --- a/vendor/github.com/google/go-github/v66/github/authorizations.go +++ b/vendor/github.com/google/go-github/v74/github/authorizations.go @@ -257,7 +257,7 @@ func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, acces // you can e.g. create or delete a user's public SSH key. NOTE: creating a // new token automatically revokes an existing one. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#create-an-impersonation-oauth-token // //meta:operation POST /admin/users/{username}/authorizations func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error) { @@ -279,7 +279,7 @@ func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, usernam // // NOTE: there can be only one at a time. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#delete-an-impersonation-oauth-token // //meta:operation DELETE /admin/users/{username}/authorizations func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v66/github/billing.go b/vendor/github.com/google/go-github/v74/github/billing.go similarity index 69% rename from vendor/github.com/google/go-github/v66/github/billing.go rename to vendor/github.com/google/go-github/v74/github/billing.go index 09b1a5d017..0776358cdb 100644 --- a/vendor/github.com/google/go-github/v66/github/billing.go +++ b/vendor/github.com/google/go-github/v74/github/billing.go @@ -63,6 +63,46 @@ type AdvancedSecurityCommittersBreakdown struct { LastPushedDate *string `json:"last_pushed_date,omitempty"` } +// UsageReportOptions specifies optional parameters for the enhanced billing platform usage report. +type UsageReportOptions struct { + // If specified, only return results for a single year. The value of year is an integer with four digits representing a year. For example, 2025. + // Default value is the current year. + Year *int `url:"year,omitempty"` + + // If specified, only return results for a single month. The value of month is an integer between 1 and 12. + // If no year is specified the default year is used. + Month *int `url:"month,omitempty"` + + // If specified, only return results for a single day. The value of day is an integer between 1 and 31. + // If no year or month is specified, the default year and month are used. + Day *int `url:"day,omitempty"` + + // If specified, only return results for a single hour. The value of hour is an integer between 0 and 23. + // If no year, month, or day is specified, the default year, month, and day are used. + Hour *int `url:"hour,omitempty"` +} + +// UsageItem represents a single usage item in the enhanced billing platform report. +type UsageItem struct { + Date *string `json:"date"` + Product *string `json:"product"` + SKU *string `json:"sku"` + Quantity *float64 `json:"quantity"` + UnitType *string `json:"unitType"` + PricePerUnit *float64 `json:"pricePerUnit"` + GrossAmount *float64 `json:"grossAmount"` + DiscountAmount *float64 `json:"discountAmount"` + NetAmount *float64 `json:"netAmount"` + RepositoryName *string `json:"repositoryName,omitempty"` + // Organization name is only used for organization-level reports. + OrganizationName *string `json:"organizationName,omitempty"` +} + +// UsageReport represents the enhanced billing platform usage report response. +type UsageReport struct { + UsageItems []*UsageItem `json:"usageItems,omitempty"` +} + // GetActionsBillingOrg returns the summary of the free and paid GitHub Actions minutes used for an Org. // // GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-an-organization @@ -216,3 +256,59 @@ func (s *BillingService) GetStorageBillingUser(ctx context.Context, user string) return storageUserBilling, resp, nil } + +// GetUsageReportOrg returns a report of the total usage for an organization using the enhanced billing platform. +// +// Note: This endpoint is only available to organizations with access to the enhanced billing platform. +// +// GitHub API docs: https://docs.github.com/rest/billing/enhanced-billing#get-billing-usage-report-for-an-organization +// +//meta:operation GET /organizations/{org}/settings/billing/usage +func (s *BillingService) GetUsageReportOrg(ctx context.Context, org string, opts *UsageReportOptions) (*UsageReport, *Response, error) { + u := fmt.Sprintf("organizations/%v/settings/billing/usage", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + usageReport := new(UsageReport) + resp, err := s.client.Do(ctx, req, usageReport) + if err != nil { + return nil, resp, err + } + + return usageReport, resp, nil +} + +// GetUsageReportUser returns a report of the total usage for a user using the enhanced billing platform. +// +// Note: This endpoint is only available to users with access to the enhanced billing platform. +// +// GitHub API docs: https://docs.github.com/rest/billing/enhanced-billing#get-billing-usage-report-for-a-user +// +//meta:operation GET /users/{username}/settings/billing/usage +func (s *BillingService) GetUsageReportUser(ctx context.Context, user string, opts *UsageReportOptions) (*UsageReport, *Response, error) { + u := fmt.Sprintf("users/%v/settings/billing/usage", user) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + usageReport := new(UsageReport) + resp, err := s.client.Do(ctx, req, usageReport) + if err != nil { + return nil, resp, err + } + + return usageReport, resp, nil +} diff --git a/vendor/github.com/google/go-github/v66/github/checks.go b/vendor/github.com/google/go-github/v74/github/checks.go similarity index 99% rename from vendor/github.com/google/go-github/v66/github/checks.go rename to vendor/github.com/google/go-github/v74/github/checks.go index 711be207c2..6f9c4191cd 100644 --- a/vendor/github.com/google/go-github/v66/github/checks.go +++ b/vendor/github.com/google/go-github/v74/github/checks.go @@ -87,8 +87,8 @@ type CheckSuite struct { // The following fields are only populated by Webhook events. HeadCommit *Commit `json:"head_commit,omitempty"` LatestCheckRunsCount *int64 `json:"latest_check_runs_count,omitempty"` - Rerequstable *bool `json:"rerequestable,omitempty"` - RunsRerequstable *bool `json:"runs_rerequestable,omitempty"` + Rerequestable *bool `json:"rerequestable,omitempty"` + RunsRerequestable *bool `json:"runs_rerequestable,omitempty"` } func (c CheckRun) String() string { @@ -345,7 +345,7 @@ func (s *ChecksService) ReRequestCheckRun(ctx context.Context, owner, repo strin // ListCheckSuiteOptions represents parameters to list check suites. type ListCheckSuiteOptions struct { CheckName *string `url:"check_name,omitempty"` // Filters checks suites by the name of the check run. - AppID *int `url:"app_id,omitempty"` // Filters check suites by GitHub App id. + AppID *int64 `url:"app_id,omitempty"` // Filters check suites by GitHub App id. ListOptions } diff --git a/vendor/github.com/google/go-github/v66/github/code-scanning.go b/vendor/github.com/google/go-github/v74/github/code_scanning.go similarity index 98% rename from vendor/github.com/google/go-github/v66/github/code-scanning.go rename to vendor/github.com/google/go-github/v74/github/code_scanning.go index a8fca98a92..19a88241d3 100644 --- a/vendor/github.com/google/go-github/v66/github/code-scanning.go +++ b/vendor/github.com/google/go-github/v74/github/code_scanning.go @@ -141,6 +141,15 @@ type AlertListOptions struct { // The name of a code scanning tool. Only results by this tool will be listed. ToolName string `url:"tool_name,omitempty"` + // The GUID of a code scanning tool. Only results by this tool will be listed. + ToolGUID string `url:"tool_guid,omitempty"` + + // The direction to sort the results by. Possible values are: asc, desc. Default: desc. + Direction string `url:"direction,omitempty"` + + // The property by which to sort the results. Possible values are: created, updated. Default: created. + Sort string `url:"sort,omitempty"` + ListCursorOptions // Add ListOptions so offset pagination with integer type "page" query parameter is accepted @@ -391,7 +400,7 @@ func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo strin return nil, nil, err } - // This will always return an error without unmarshalling the data + // This will always return an error without unmarshaling the data resp, err := s.client.Do(ctx, req, nil) // Even though there was an error, we still return the response // in case the caller wants to inspect it further. diff --git a/vendor/github.com/google/go-github/v66/github/codesofconduct.go b/vendor/github.com/google/go-github/v74/github/codesofconduct.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/codesofconduct.go rename to vendor/github.com/google/go-github/v74/github/codesofconduct.go diff --git a/vendor/github.com/google/go-github/v66/github/codespaces.go b/vendor/github.com/google/go-github/v74/github/codespaces.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/codespaces.go rename to vendor/github.com/google/go-github/v74/github/codespaces.go diff --git a/vendor/github.com/google/go-github/v66/github/codespaces_secrets.go b/vendor/github.com/google/go-github/v74/github/codespaces_secrets.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/codespaces_secrets.go rename to vendor/github.com/google/go-github/v74/github/codespaces_secrets.go diff --git a/vendor/github.com/google/go-github/v66/github/copilot.go b/vendor/github.com/google/go-github/v74/github/copilot.go similarity index 56% rename from vendor/github.com/google/go-github/v66/github/copilot.go rename to vendor/github.com/google/go-github/v74/github/copilot.go index 7ea13bd7c8..b4f21ad39a 100644 --- a/vendor/github.com/google/go-github/v66/github/copilot.go +++ b/vendor/github.com/google/go-github/v74/github/copilot.go @@ -46,14 +46,14 @@ type ListCopilotSeatsResponse struct { // CopilotSeatDetails represents the details of a Copilot for Business seat. type CopilotSeatDetails struct { // Assignee can either be a User, Team, or Organization. - Assignee interface{} `json:"assignee"` - AssigningTeam *Team `json:"assigning_team,omitempty"` - PendingCancellationDate *string `json:"pending_cancellation_date,omitempty"` - LastActivityAt *Timestamp `json:"last_activity_at,omitempty"` - LastActivityEditor *string `json:"last_activity_editor,omitempty"` - CreatedAt *Timestamp `json:"created_at"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - PlanType *string `json:"plan_type,omitempty"` + Assignee any `json:"assignee"` + AssigningTeam *Team `json:"assigning_team,omitempty"` + PendingCancellationDate *string `json:"pending_cancellation_date,omitempty"` + LastActivityAt *Timestamp `json:"last_activity_at,omitempty"` + LastActivityEditor *string `json:"last_activity_editor,omitempty"` + CreatedAt *Timestamp `json:"created_at"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + PlanType *string `json:"plan_type,omitempty"` } // SeatAssignments represents the number of seats assigned. @@ -66,37 +66,123 @@ type SeatCancellations struct { SeatsCancelled int `json:"seats_cancelled"` } -// CopilotUsageSummaryListOptions represents the optional parameters to the CopilotService.GetOrganizationUsage method. -type CopilotUsageSummaryListOptions struct { +// CopilotMetricsListOptions represents the optional parameters to the CopilotService get metrics methods. +type CopilotMetricsListOptions struct { Since *time.Time `url:"since,omitempty"` Until *time.Time `url:"until,omitempty"` ListOptions } -// CopilotUsageBreakdown represents the breakdown of Copilot usage for a specific language and editor. -type CopilotUsageBreakdown struct { - Language string `json:"language"` - Editor string `json:"editor"` - SuggestionsCount int64 `json:"suggestions_count"` - AcceptancesCount int64 `json:"acceptances_count"` - LinesSuggested int64 `json:"lines_suggested"` - LinesAccepted int64 `json:"lines_accepted"` - ActiveUsers int `json:"active_users"` +// CopilotIDECodeCompletionsLanguage represents Copilot usage metrics for completions in the IDE for a language. +type CopilotIDECodeCompletionsLanguage struct { + Name string `json:"name"` + TotalEngagedUsers int `json:"total_engaged_users"` } -// CopilotUsageSummary represents the daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE across an organization. -type CopilotUsageSummary struct { - Day string `json:"day"` - TotalSuggestionsCount int64 `json:"total_suggestions_count"` - TotalAcceptancesCount int64 `json:"total_acceptances_count"` - TotalLinesSuggested int64 `json:"total_lines_suggested"` - TotalLinesAccepted int64 `json:"total_lines_accepted"` - TotalActiveUsers int64 `json:"total_active_users"` - TotalChatAcceptances int64 `json:"total_chat_acceptances"` - TotalChatTurns int64 `json:"total_chat_turns"` - TotalActiveChatUsers int `json:"total_active_chat_users"` - Breakdown []*CopilotUsageBreakdown `json:"breakdown"` +// CopilotIDECodeCompletionsModelLanguage represents Copilot usage metrics for completions in the IDE for a model and language. +type CopilotIDECodeCompletionsModelLanguage struct { + Name string `json:"name"` + TotalEngagedUsers int `json:"total_engaged_users"` + TotalCodeSuggestions int `json:"total_code_suggestions"` + TotalCodeAcceptances int `json:"total_code_acceptances"` + TotalCodeLinesSuggested int `json:"total_code_lines_suggested"` + TotalCodeLinesAccepted int `json:"total_code_lines_accepted"` +} + +// CopilotIDECodeCompletionsModel represents Copilot usage metrics for completions in the IDE for a model. +type CopilotIDECodeCompletionsModel struct { + Name string `json:"name"` + IsCustomModel bool `json:"is_custom_model"` + CustomModelTrainingDate *string `json:"custom_model_training_date,omitempty"` + TotalEngagedUsers int `json:"total_engaged_users"` + Languages []*CopilotIDECodeCompletionsModelLanguage `json:"languages"` +} + +// CopilotIDECodeCompletionsEditor represents Copilot usage metrics for completions in the IDE for an editor. +type CopilotIDECodeCompletionsEditor struct { + Name string `json:"name"` + TotalEngagedUsers int `json:"total_engaged_users"` + Models []*CopilotIDECodeCompletionsModel `json:"models"` +} + +// CopilotIDECodeCompletions represents Copilot usage metrics for Copilot code completions in the IDE, categorized by editor, model and language. +type CopilotIDECodeCompletions struct { + TotalEngagedUsers int `json:"total_engaged_users"` + Languages []*CopilotIDECodeCompletionsLanguage `json:"languages"` + Editors []*CopilotIDECodeCompletionsEditor `json:"editors"` +} + +// CopilotIDEChatModel represents Copilot usage metrics for chatting with a model in the IDE. +type CopilotIDEChatModel struct { + Name string `json:"name"` + IsCustomModel bool `json:"is_custom_model"` + CustomModelTrainingDate *string `json:"custom_model_training_date,omitempty"` + TotalEngagedUsers int `json:"total_engaged_users"` + TotalChats int `json:"total_chats"` + TotalChatInsertionEvents int `json:"total_chat_insertion_events"` + TotalChatCopyEvents int `json:"total_chat_copy_events"` +} + +// CopilotIDEChatEditor represents Copilot usage metrics for chatting with a model in the IDE, categorized by editor and model. +type CopilotIDEChatEditor struct { + Name string `json:"name"` + TotalEngagedUsers int `json:"total_engaged_users"` + Models []*CopilotIDEChatModel `json:"models"` +} + +// CopilotIDEChat represents Copilot usage metrics for Copilot Chat in the IDE, categorized by editor and model. +type CopilotIDEChat struct { + TotalEngagedUsers int `json:"total_engaged_users"` + Editors []*CopilotIDEChatEditor `json:"editors"` +} + +// CopilotDotcomChatModel represents Copilot usage metrics for chatting with a model in the webbrowser. +type CopilotDotcomChatModel struct { + Name string `json:"name"` + IsCustomModel bool `json:"is_custom_model"` + CustomModelTrainingDate *string `json:"custom_model_training_date,omitempty"` + TotalEngagedUsers int `json:"total_engaged_users"` + TotalChats int `json:"total_chats"` +} + +// CopilotDotcomChat represents Copilot usage metrics for Copilot Chat in the webbrowser, categorized by model. +type CopilotDotcomChat struct { + TotalEngagedUsers int `json:"total_engaged_users"` + Models []*CopilotDotcomChatModel `json:"models"` +} + +// CopilotDotcomPullRequestsModel represents Copilot usage metrics for pull requests in the webbrowser, categorized by model. +type CopilotDotcomPullRequestsModel struct { + Name string `json:"name"` + IsCustomModel bool `json:"is_custom_model"` + CustomModelTrainingDate *string `json:"custom_model_training_date,omitempty"` + TotalPRSummariesCreated int `json:"total_pr_summaries_created"` + TotalEngagedUsers int `json:"total_engaged_users"` +} + +// CopilotDotcomPullRequestsRepository represents Copilot usage metrics for pull requests in the webbrowser, categorized by repository. +type CopilotDotcomPullRequestsRepository struct { + Name string `json:"name"` + TotalEngagedUsers int `json:"total_engaged_users"` + Models []*CopilotDotcomPullRequestsModel `json:"models"` +} + +// CopilotDotcomPullRequests represents Copilot usage metrics for pull requests in the webbrowser, categorized by repository and model. +type CopilotDotcomPullRequests struct { + TotalEngagedUsers int `json:"total_engaged_users"` + Repositories []*CopilotDotcomPullRequestsRepository `json:"repositories"` +} + +// CopilotMetrics represents Copilot usage metrics for a given day. +type CopilotMetrics struct { + Date string `json:"date"` + TotalActiveUsers *int `json:"total_active_users,omitempty"` + TotalEngagedUsers *int `json:"total_engaged_users,omitempty"` + CopilotIDECodeCompletions *CopilotIDECodeCompletions `json:"copilot_ide_code_completions,omitempty"` + CopilotIDEChat *CopilotIDEChat `json:"copilot_ide_chat,omitempty"` + CopilotDotcomChat *CopilotDotcomChat `json:"copilot_dotcom_chat,omitempty"` + CopilotDotcomPullRequests *CopilotDotcomPullRequests `json:"copilot_dotcom_pull_requests,omitempty"` } func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { @@ -117,7 +203,12 @@ func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { cp.PlanType = seatDetail.PlanType switch v := seatDetail.Assignee.(type) { - case map[string]interface{}: + case nil: + // Assignee can be null according to GitHub API specification. + // See: https://docs.github.com/en/rest/copilot/copilot-user-management?apiVersion=2022-11-28#list-all-copilot-seat-assignments-for-an-organization + // Note: Copilot API is in public preview and subject to change. + cp.Assignee = nil + case map[string]any: jsonData, err := json.Marshal(seatDetail.Assignee) if err != nil { return err @@ -221,7 +312,7 @@ func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts // // To paginate through all seats, populate 'Page' with the number of the last page. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-enterprise +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/copilot/billing/seats func (s *CopilotService) ListCopilotEnterpriseSeats(ctx context.Context, enterprise string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) { @@ -379,13 +470,13 @@ func (s *CopilotService) GetSeatDetails(ctx context.Context, org, user string) ( return seatDetails, resp, nil } -// GetOrganizationUsage gets daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE across an organization. +// GetEnterpriseMetrics gets Copilot usage metrics for an enterprise. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-organization-members +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise // -//meta:operation GET /orgs/{org}/copilot/usage -func (s *CopilotService) GetOrganizationUsage(ctx context.Context, org string, opts *CopilotUsageSummaryListOptions) ([]*CopilotUsageSummary, *Response, error) { - u := fmt.Sprintf("orgs/%v/copilot/usage", org) +//meta:operation GET /enterprises/{enterprise}/copilot/metrics +func (s *CopilotService) GetEnterpriseMetrics(ctx context.Context, enterprise string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { + u := fmt.Sprintf("enterprises/%v/copilot/metrics", enterprise) u, err := addOptions(u, opts) if err != nil { return nil, nil, err @@ -396,22 +487,22 @@ func (s *CopilotService) GetOrganizationUsage(ctx context.Context, org string, o return nil, nil, err } - var usage []*CopilotUsageSummary - resp, err := s.client.Do(ctx, req, &usage) + var metrics []*CopilotMetrics + resp, err := s.client.Do(ctx, req, &metrics) if err != nil { return nil, resp, err } - return usage, resp, nil + return metrics, resp, nil } -// GetEnterpriseUsage gets daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE across an enterprise. +// GetEnterpriseTeamMetrics gets Copilot usage metrics for an enterprise team. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-enterprise-members +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise-team // -//meta:operation GET /enterprises/{enterprise}/copilot/usage -func (s *CopilotService) GetEnterpriseUsage(ctx context.Context, enterprise string, opts *CopilotUsageSummaryListOptions) ([]*CopilotUsageSummary, *Response, error) { - u := fmt.Sprintf("enterprises/%v/copilot/usage", enterprise) +//meta:operation GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics +func (s *CopilotService) GetEnterpriseTeamMetrics(ctx context.Context, enterprise, team string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { + u := fmt.Sprintf("enterprises/%v/team/%v/copilot/metrics", enterprise, team) u, err := addOptions(u, opts) if err != nil { return nil, nil, err @@ -422,22 +513,22 @@ func (s *CopilotService) GetEnterpriseUsage(ctx context.Context, enterprise stri return nil, nil, err } - var usage []*CopilotUsageSummary - resp, err := s.client.Do(ctx, req, &usage) + var metrics []*CopilotMetrics + resp, err := s.client.Do(ctx, req, &metrics) if err != nil { return nil, resp, err } - return usage, resp, nil + return metrics, resp, nil } -// GetEnterpriseTeamUsage gets daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE for a team in the enterprise. +// GetOrganizationMetrics gets Copilot usage metrics for an organization. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-an-enterprise-team +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-organization // -//meta:operation GET /enterprises/{enterprise}/team/{team_slug}/copilot/usage -func (s *CopilotService) GetEnterpriseTeamUsage(ctx context.Context, enterprise, team string, opts *CopilotUsageSummaryListOptions) ([]*CopilotUsageSummary, *Response, error) { - u := fmt.Sprintf("enterprises/%v/team/%v/copilot/usage", enterprise, team) +//meta:operation GET /orgs/{org}/copilot/metrics +func (s *CopilotService) GetOrganizationMetrics(ctx context.Context, org string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/metrics", org) u, err := addOptions(u, opts) if err != nil { return nil, nil, err @@ -448,22 +539,22 @@ func (s *CopilotService) GetEnterpriseTeamUsage(ctx context.Context, enterprise, return nil, nil, err } - var usage []*CopilotUsageSummary - resp, err := s.client.Do(ctx, req, &usage) + var metrics []*CopilotMetrics + resp, err := s.client.Do(ctx, req, &metrics) if err != nil { return nil, resp, err } - return usage, resp, nil + return metrics, resp, nil } -// GetOrganizationTeamUsage gets daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE for a team in the organization. +// GetOrganizationTeamMetrics gets Copilot usage metrics for an organization team. // -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-a-team +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-a-team // -//meta:operation GET /orgs/{org}/team/{team_slug}/copilot/usage -func (s *CopilotService) GetOrganizationTeamUsage(ctx context.Context, org, team string, opts *CopilotUsageSummaryListOptions) ([]*CopilotUsageSummary, *Response, error) { - u := fmt.Sprintf("orgs/%v/team/%v/copilot/usage", org, team) +//meta:operation GET /orgs/{org}/team/{team_slug}/copilot/metrics +func (s *CopilotService) GetOrganizationTeamMetrics(ctx context.Context, org, team string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { + u := fmt.Sprintf("orgs/%v/team/%v/copilot/metrics", org, team) u, err := addOptions(u, opts) if err != nil { return nil, nil, err @@ -474,11 +565,11 @@ func (s *CopilotService) GetOrganizationTeamUsage(ctx context.Context, org, team return nil, nil, err } - var usage []*CopilotUsageSummary - resp, err := s.client.Do(ctx, req, &usage) + var metrics []*CopilotMetrics + resp, err := s.client.Do(ctx, req, &metrics) if err != nil { return nil, resp, err } - return usage, resp, nil + return metrics, resp, nil } diff --git a/vendor/github.com/google/go-github/v66/github/dependabot.go b/vendor/github.com/google/go-github/v74/github/dependabot.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/dependabot.go rename to vendor/github.com/google/go-github/v74/github/dependabot.go diff --git a/vendor/github.com/google/go-github/v66/github/dependabot_alerts.go b/vendor/github.com/google/go-github/v74/github/dependabot_alerts.go similarity index 94% rename from vendor/github.com/google/go-github/v66/github/dependabot_alerts.go rename to vendor/github.com/google/go-github/v74/github/dependabot_alerts.go index c274f07bec..67e624c9e8 100644 --- a/vendor/github.com/google/go-github/v66/github/dependabot_alerts.go +++ b/vendor/github.com/google/go-github/v74/github/dependabot_alerts.go @@ -29,6 +29,15 @@ type AdvisoryCWEs struct { Name *string `json:"name,omitempty"` } +// AdvisoryEPSS represents the advisory pertaining to the Exploit Prediction Scoring System. +// +// For more information, see: +// https://github.blog/changelog/2024-10-10-epss-scores-in-the-github-advisory-database/ +type AdvisoryEPSS struct { + Percentage float64 `json:"percentage"` + Percentile float64 `json:"percentile"` +} + // DependabotSecurityAdvisory represents the GitHub Security Advisory. type DependabotSecurityAdvisory struct { GHSAID *string `json:"ghsa_id,omitempty"` @@ -39,6 +48,7 @@ type DependabotSecurityAdvisory struct { Severity *string `json:"severity,omitempty"` CVSS *AdvisoryCVSS `json:"cvss,omitempty"` CWEs []*AdvisoryCWEs `json:"cwes,omitempty"` + EPSS *AdvisoryEPSS `json:"epss,omitempty"` Identifiers []*AdvisoryIdentifier `json:"identifiers,omitempty"` References []*AdvisoryReference `json:"references,omitempty"` PublishedAt *Timestamp `json:"published_at,omitempty"` diff --git a/vendor/github.com/google/go-github/v66/github/dependabot_secrets.go b/vendor/github.com/google/go-github/v74/github/dependabot_secrets.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/dependabot_secrets.go rename to vendor/github.com/google/go-github/v74/github/dependabot_secrets.go diff --git a/vendor/github.com/google/go-github/v74/github/dependency_graph.go b/vendor/github.com/google/go-github/v74/github/dependency_graph.go new file mode 100644 index 0000000000..0218c79054 --- /dev/null +++ b/vendor/github.com/google/go-github/v74/github/dependency_graph.go @@ -0,0 +1,125 @@ +// Copyright 2023 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +type DependencyGraphService service + +// SBOM represents a software bill of materials, which describes the +// packages/libraries that a repository depends on. +type SBOM struct { + SBOM *SBOMInfo `json:"sbom,omitempty"` +} + +// CreationInfo represents when the SBOM was created and who created it. +type CreationInfo struct { + Created *Timestamp `json:"created,omitempty"` + Creators []string `json:"creators,omitempty"` +} + +// RepoDependencies represents the dependencies of a repo. +type RepoDependencies struct { + SPDXID *string `json:"SPDXID,omitempty"` + // Package name + Name *string `json:"name,omitempty"` + VersionInfo *string `json:"versionInfo,omitempty"` + DownloadLocation *string `json:"downloadLocation,omitempty"` + FilesAnalyzed *bool `json:"filesAnalyzed,omitempty"` + LicenseConcluded *string `json:"licenseConcluded,omitempty"` + LicenseDeclared *string `json:"licenseDeclared,omitempty"` + ExternalRefs []*PackageExternalRef `json:"externalRefs,omitempty"` +} + +// PackageExternalRef allows an Package to reference an external sources of additional information, +// like asset identifiers, or downloadable content that are relevant to the package, +// Example for identifiers (e.g., PURL/SWID/CPE) for a package in the SBOM. +// https://spdx.github.io/spdx-spec/v2.3/package-information/#721-external-reference-field +type PackageExternalRef struct { + // ReferenceCategory specifies the external reference categories such + // SECURITY", "PACKAGE-MANAGER", "PERSISTENT-ID", or "OTHER" + // Example: "PACKAGE-MANAGER" + ReferenceCategory string `json:"referenceCategory"` + + // ReferenceType specifies the type of external reference. + // For PACKAGE-MANAGER, it could be "purl"; other types include "cpe22Type", "swid", etc. + ReferenceType string `json:"referenceType"` + + // ReferenceLocator is the actual unique identifier or URI for the external reference. + // Example: "pkg:golang/github.com/spf13/cobra@1.8.1" + ReferenceLocator string `json:"referenceLocator"` +} + +// SBOMRelationship provides information about the relationship between two SPDX elements. +// Element could be packages or files in the SBOM. +// For example, to represent a relationship between two different Files, between a Package and a File, +// between two Packages, or between one SPDXDocument and another SPDXDocument. +// https://spdx.github.io/spdx-spec/v2.3/relationships-between-SPDX-elements/ +type SBOMRelationship struct { + // SPDXElementID is the identifier of the SPDX element that has a relationship. + // Example: "SPDXRef-github-interlynk-io-sbomqs-main-f43c98" + SPDXElementID string `json:"spdxElementId"` + + // RelatedSPDXElement is the identifier of the related SPDX element. + // Example: "SPDXRef-golang-github.comspf13-cobra-1.8.1-75c946" + RelatedSPDXElement string `json:"relatedSpdxElement"` + + // RelationshipType describes the type of relationship between the two elements. + // Such as "DEPENDS_ON", "DESCRIBES", "CONTAINS", etc., as defined by SPDX 2.3. + // Example: "DEPENDS_ON", "CONTAINS", "DESCRIBES", etc. + RelationshipType string `json:"relationshipType"` +} + +// SBOMInfo represents a software bill of materials (SBOM) using SPDX. +// SPDX is an open standard for SBOMs that +// identifies and catalogs components, licenses, copyrights, security +// references, and other metadata relating to software. +type SBOMInfo struct { + SPDXID *string `json:"SPDXID,omitempty"` + SPDXVersion *string `json:"spdxVersion,omitempty"` + CreationInfo *CreationInfo `json:"creationInfo,omitempty"` + + // Repo name + Name *string `json:"name,omitempty"` + DataLicense *string `json:"dataLicense,omitempty"` + DocumentDescribes []string `json:"documentDescribes,omitempty"` + DocumentNamespace *string `json:"documentNamespace,omitempty"` + + // List of packages dependencies + Packages []*RepoDependencies `json:"packages,omitempty"` + + // List of relationships between packages + Relationships []*SBOMRelationship `json:"relationships,omitempty"` +} + +func (s SBOM) String() string { + return Stringify(s) +} + +// GetSBOM fetches the software bill of materials for a repository. +// +// GitHub API docs: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/dependency-graph/sbom +func (s *DependencyGraphService) GetSBOM(ctx context.Context, owner, repo string) (*SBOM, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/dependency-graph/sbom", owner, repo) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var sbom *SBOM + resp, err := s.client.Do(ctx, req, &sbom) + if err != nil { + return nil, resp, err + } + + return sbom, resp, nil +} diff --git a/vendor/github.com/google/go-github/v66/github/dependency_graph_snapshots.go b/vendor/github.com/google/go-github/v74/github/dependency_graph_snapshots.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/dependency_graph_snapshots.go rename to vendor/github.com/google/go-github/v74/github/dependency_graph_snapshots.go diff --git a/vendor/github.com/google/go-github/v66/github/doc.go b/vendor/github.com/google/go-github/v74/github/doc.go similarity index 77% rename from vendor/github.com/google/go-github/v66/github/doc.go rename to vendor/github.com/google/go-github/v74/github/doc.go index 7196394fb9..fd83f899cf 100644 --- a/vendor/github.com/google/go-github/v66/github/doc.go +++ b/vendor/github.com/google/go-github/v74/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v66/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v74/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to @@ -31,27 +31,27 @@ The services of a client divide the API into logical chunks and correspond to the structure of the GitHub API documentation at https://docs.github.com/rest . -NOTE: Using the https://pkg.go.dev/context package, one can easily -pass cancelation signals and deadlines to various services of the client for -handling a request. In case there is no context available, then context.Background() +NOTE: Using the [context] package, one can easily +pass cancellation signals and deadlines to various services of the client for +handling a request. In case there is no context available, then [context.Background] can be used as a starting point. For more sample code snippets, head over to the https://github.com/google/go-github/tree/master/example directory. # Authentication -Use Client.WithAuthToken to configure your client to authenticate using an Oauth token +Use [Client.WithAuthToken] to configure your client to authenticate using an Oauth token (for example, a personal access token). This is what is needed for a majority of use cases aside from GitHub Apps. client := github.NewClient(nil).WithAuthToken("... your access token ...") -Note that when using an authenticated Client, all calls made by the client will +Note that when using an authenticated [Client], all calls made by the client will include the specified OAuth token. Therefore, authenticated clients should almost never be shared between different users. For API methods that require HTTP Basic Authentication, use the -BasicAuthTransport. +[BasicAuthTransport]. GitHub Apps authentication can be provided by the https://github.com/bradleyfalzon/ghinstallation package. @@ -100,15 +100,15 @@ limited to 60 requests per hour, while authenticated clients can make up to clients are limited to 10 requests per minute, while authenticated clients can make up to 30 requests per minute. To receive the higher rate limit when making calls that are not issued on behalf of a user, -use UnauthenticatedRateLimitedTransport. +use [UnauthenticatedRateLimitedTransport]. -The returned Response.Rate value contains the rate limit information +The returned [Response].[Rate] value contains the rate limit information from the most recent API call. If a recent enough response isn't available, you can use RateLimits to fetch the most up-to-date rate limit data for the client. -To detect an API rate limit error, you can check if its type is *github.RateLimitError. -For secondary rate limits, you can check if its type is *github.AbuseRateLimitError: +To detect an API rate limit error, you can check if its type is *[RateLimitError]. +For secondary rate limits, you can check if its type is *[AbuseRateLimitError]: repos, _, err := client.Repositories.List(ctx, "", nil) if _, ok := err.(*github.RateLimitError); ok { @@ -129,7 +129,7 @@ the GitHub side. Methods known to behave like this are documented specifying this behavior. To detect this condition of error, you can check if its type is -*github.AcceptedError: +*[AcceptedError]: stats, _, err := client.Repositories.ListContributorsStats(ctx, org, repo) if _, ok := err.(*github.AcceptedError); ok { @@ -138,11 +138,17 @@ To detect this condition of error, you can check if its type is # Conditional Requests -The GitHub API has good support for conditional requests which will help -prevent you from burning through your rate limit, as well as help speed up your -application. go-github does not handle conditional requests directly, but is -instead designed to work with a caching http.Transport. We recommend using -https://github.com/gregjones/httpcache for that. +The GitHub REST API has good support for conditional HTTP requests +via the ETag header which will help prevent you from burning through your +rate limit, as well as help speed up your application. go-github does not +handle conditional requests directly, but is instead designed to work with a +caching [http.Transport]. + +Typically, an RFC 9111 compliant HTTP cache such as https://github.com/bartventer/httpcache +is recommended. Alternatively, the https://github.com/bored-engineer/github-conditional-http-transport +package relies on (undocumented) GitHub specific cache logic and is +recommended when making requests using short-lived credentials such as a +GitHub App installation token. Learn more about GitHub conditional requests at https://docs.github.com/rest/overview/resources-in-the-rest-api#conditional-requests. @@ -151,13 +157,13 @@ https://docs.github.com/rest/overview/resources-in-the-rest-api#conditional-requ All structs for GitHub resources use pointer values for all non-repeated fields. This allows distinguishing between unset fields and those set to a zero-value. -Helper functions have been provided to easily create these pointers for string, +A helper function, [Ptr], has been provided to easily create these pointers for string, bool, and int values. For example: // create a new private repository named "foo" repo := &github.Repository{ - Name: github.String("foo"), - Private: github.Bool(true), + Name: github.Ptr("foo"), + Private: github.Ptr(true), } client.Repositories.Create(ctx, "", repo) @@ -167,10 +173,10 @@ Users who have worked with protocol buffers should find this pattern familiar. All requests for resource collections (repos, pull requests, issues, etc.) support pagination. Pagination options are described in the -github.ListOptions struct and passed to the list methods directly or as an +[ListOptions] struct and passed to the list methods directly or as an embedded type of a more specific list options struct (for example -github.PullRequestListOptions). Pages information is available via the -github.Response struct. +[PullRequestListOptions]). Pages information is available via the +[Response] struct. client := github.NewClient(nil) diff --git a/vendor/github.com/google/go-github/v66/github/emojis.go b/vendor/github.com/google/go-github/v74/github/emojis.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/emojis.go rename to vendor/github.com/google/go-github/v74/github/emojis.go diff --git a/vendor/github.com/google/go-github/v66/github/enterprise.go b/vendor/github.com/google/go-github/v74/github/enterprise.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/enterprise.go rename to vendor/github.com/google/go-github/v74/github/enterprise.go diff --git a/vendor/github.com/google/go-github/v74/github/enterprise_actions_hosted_runners.go b/vendor/github.com/google/go-github/v74/github/enterprise_actions_hosted_runners.go new file mode 100644 index 0000000000..e82ba9b806 --- /dev/null +++ b/vendor/github.com/google/go-github/v74/github/enterprise_actions_hosted_runners.go @@ -0,0 +1,234 @@ +// Copyright 2025 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// ListHostedRunners lists all the GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#list-github-hosted-runners-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners +func (s *EnterpriseService) ListHostedRunners(ctx context.Context, enterprise string, opts *ListOptions) (*HostedRunners, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners", enterprise) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + runners := &HostedRunners{} + resp, err := s.client.Do(ctx, req, &runners) + if err != nil { + return nil, resp, err + } + + return runners, resp, nil +} + +// CreateHostedRunner creates a GitHub-hosted runner for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#create-a-github-hosted-runner-for-an-enterprise +// +//meta:operation POST /enterprises/{enterprise}/actions/hosted-runners +func (s *EnterpriseService) CreateHostedRunner(ctx context.Context, enterprise string, request *HostedRunnerRequest) (*HostedRunner, *Response, error) { + if err := validateCreateHostedRunnerRequest(request); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners", enterprise) + req, err := s.client.NewRequest("POST", u, request) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// GetHostedRunnerGitHubOwnedImages gets the list of GitHub-owned images available for GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-github-owned-images-for-github-hosted-runners-in-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/github-owned +func (s *EnterpriseService) GetHostedRunnerGitHubOwnedImages(ctx context.Context, enterprise string) (*HostedRunnerImages, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/github-owned", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunnerImages := new(HostedRunnerImages) + resp, err := s.client.Do(ctx, req, hostedRunnerImages) + if err != nil { + return nil, resp, err + } + + return hostedRunnerImages, resp, nil +} + +// GetHostedRunnerPartnerImages gets the list of partner images available for GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-partner-images-for-github-hosted-runners-in-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/partner +func (s *EnterpriseService) GetHostedRunnerPartnerImages(ctx context.Context, enterprise string) (*HostedRunnerImages, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/partner", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunnerImages := new(HostedRunnerImages) + resp, err := s.client.Do(ctx, req, hostedRunnerImages) + if err != nil { + return nil, resp, err + } + + return hostedRunnerImages, resp, nil +} + +// GetHostedRunnerLimits gets the GitHub-hosted runners Static public IP Limits for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-limits-on-github-hosted-runners-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/limits +func (s *EnterpriseService) GetHostedRunnerLimits(ctx context.Context, enterprise string) (*HostedRunnerPublicIPLimits, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/limits", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + publicIPLimits := new(HostedRunnerPublicIPLimits) + resp, err := s.client.Do(ctx, req, publicIPLimits) + if err != nil { + return nil, resp, err + } + + return publicIPLimits, resp, nil +} + +// GetHostedRunnerMachineSpecs gets the list of machine specs available for GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-github-hosted-runners-machine-specs-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/machine-sizes +func (s *EnterpriseService) GetHostedRunnerMachineSpecs(ctx context.Context, enterprise string) (*HostedRunnerMachineSpecs, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/machine-sizes", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + machineSpecs := new(HostedRunnerMachineSpecs) + resp, err := s.client.Do(ctx, req, machineSpecs) + if err != nil { + return nil, resp, err + } + + return machineSpecs, resp, nil +} + +// GetHostedRunnerPlatforms gets list of platforms available for GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-platforms-for-github-hosted-runners-in-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/platforms +func (s *EnterpriseService) GetHostedRunnerPlatforms(ctx context.Context, enterprise string) (*HostedRunnerPlatforms, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/platforms", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + platforms := new(HostedRunnerPlatforms) + resp, err := s.client.Do(ctx, req, platforms) + if err != nil { + return nil, resp, err + } + + return platforms, resp, nil +} + +// GetHostedRunner gets a GitHub-hosted runner in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-a-github-hosted-runner-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} +func (s *EnterpriseService) GetHostedRunner(ctx context.Context, enterprise string, runnerID int64) (*HostedRunner, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// UpdateHostedRunner updates a GitHub-hosted runner for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#update-a-github-hosted-runner-for-an-enterprise +// +//meta:operation PATCH /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} +func (s *EnterpriseService) UpdateHostedRunner(ctx context.Context, enterprise string, runnerID int64, updateReq HostedRunnerRequest) (*HostedRunner, *Response, error) { + if err := validateUpdateHostedRunnerRequest(&updateReq); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID) + req, err := s.client.NewRequest("PATCH", u, updateReq) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// DeleteHostedRunner deletes GitHub-hosted runner from an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#delete-a-github-hosted-runner-for-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} +func (s *EnterpriseService) DeleteHostedRunner(ctx context.Context, enterprise string, runnerID int64) (*HostedRunner, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} diff --git a/vendor/github.com/google/go-github/v66/github/enterprise_actions_runner_groups.go b/vendor/github.com/google/go-github/v74/github/enterprise_actions_runner_groups.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/enterprise_actions_runner_groups.go rename to vendor/github.com/google/go-github/v74/github/enterprise_actions_runner_groups.go diff --git a/vendor/github.com/google/go-github/v66/github/enterprise_actions_runners.go b/vendor/github.com/google/go-github/v74/github/enterprise_actions_runners.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/enterprise_actions_runners.go rename to vendor/github.com/google/go-github/v74/github/enterprise_actions_runners.go diff --git a/vendor/github.com/google/go-github/v66/github/enterprise_audit_log.go b/vendor/github.com/google/go-github/v74/github/enterprise_audit_log.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/enterprise_audit_log.go rename to vendor/github.com/google/go-github/v74/github/enterprise_audit_log.go diff --git a/vendor/github.com/google/go-github/v66/github/enterprise_code_security_and_analysis.go b/vendor/github.com/google/go-github/v74/github/enterprise_code_security_and_analysis.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/enterprise_code_security_and_analysis.go rename to vendor/github.com/google/go-github/v74/github/enterprise_code_security_and_analysis.go diff --git a/vendor/github.com/google/go-github/v74/github/enterprise_manage_ghes.go b/vendor/github.com/google/go-github/v74/github/enterprise_manage_ghes.go new file mode 100644 index 0000000000..c5e38386a1 --- /dev/null +++ b/vendor/github.com/google/go-github/v74/github/enterprise_manage_ghes.go @@ -0,0 +1,163 @@ +// Copyright 2025 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" +) + +// NodeQueryOptions specifies the optional parameters to the EnterpriseService +// Node management APIs. +type NodeQueryOptions struct { + // UUID filters issues based on the node UUID. + UUID *string `url:"uuid,omitempty"` + + // ClusterRoles filters the cluster roles from the cluster configuration file. + ClusterRoles *string `url:"cluster_roles,omitempty"` +} + +// ClusterStatus represents a response from the ClusterStatus and ReplicationStatus methods. +type ClusterStatus struct { + Status *string `json:"status,omitempty"` + Nodes []*ClusterStatusNode `json:"nodes"` +} + +// ClusterStatusNode represents the status of a cluster node. +type ClusterStatusNode struct { + Hostname *string `json:"hostname,omitempty"` + Status *string `json:"status,omitempty"` + Services []*ClusterStatusNodeServiceItem `json:"services"` +} + +// ClusterStatusNodeServiceItem represents the status of a service running on a cluster node. +type ClusterStatusNodeServiceItem struct { + Status *string `json:"status,omitempty"` + Name *string `json:"name,omitempty"` + Details *string `json:"details,omitempty"` +} + +// SystemRequirements represents a response from the CheckSystemRequirements method. +type SystemRequirements struct { + Status *string `json:"status,omitempty"` + Nodes []*SystemRequirementsNode `json:"nodes"` +} + +// SystemRequirementsNode represents the status of a system node. +type SystemRequirementsNode struct { + Hostname *string `json:"hostname,omitempty"` + Status *string `json:"status,omitempty"` + RolesStatus []*SystemRequirementsNodeRoleStatus `json:"roles_status"` +} + +// SystemRequirementsNodeRoleStatus represents the status of a role on a system node. +type SystemRequirementsNodeRoleStatus struct { + Status *string `json:"status,omitempty"` + Role *string `json:"role,omitempty"` +} + +// NodeReleaseVersion represents a response from the GetNodeReleaseVersions method. +type NodeReleaseVersion struct { + Hostname *string `json:"hostname,omitempty"` + Version *ReleaseVersion `json:"version"` +} + +// ReleaseVersion holds the release version information of the node. +type ReleaseVersion struct { + Version *string `json:"version,omitempty"` + Platform *string `json:"platform,omitempty"` + BuildID *string `json:"build_id,omitempty"` + BuildDate *string `json:"build_date,omitempty"` +} + +// CheckSystemRequirements checks if GHES system nodes meet the system requirements. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes +// +//meta:operation GET /manage/v1/checks/system-requirements +func (s *EnterpriseService) CheckSystemRequirements(ctx context.Context) (*SystemRequirements, *Response, error) { + u := "manage/v1/checks/system-requirements" + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + systemRequirements := new(SystemRequirements) + resp, err := s.client.Do(ctx, req, systemRequirements) + if err != nil { + return nil, resp, err + } + + return systemRequirements, resp, nil +} + +// ClusterStatus gets the status of all services running on each cluster node. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes +// +//meta:operation GET /manage/v1/cluster/status +func (s *EnterpriseService) ClusterStatus(ctx context.Context) (*ClusterStatus, *Response, error) { + u := "manage/v1/cluster/status" + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + clusterStatus := new(ClusterStatus) + resp, err := s.client.Do(ctx, req, clusterStatus) + if err != nil { + return nil, resp, err + } + + return clusterStatus, resp, nil +} + +// ReplicationStatus gets the status of all services running on each replica node. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes +// +//meta:operation GET /manage/v1/replication/status +func (s *EnterpriseService) ReplicationStatus(ctx context.Context, opts *NodeQueryOptions) (*ClusterStatus, *Response, error) { + u, err := addOptions("manage/v1/replication/status", opts) + if err != nil { + return nil, nil, err + } + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + status := new(ClusterStatus) + resp, err := s.client.Do(ctx, req, status) + if err != nil { + return nil, resp, err + } + + return status, resp, nil +} + +// GetNodeReleaseVersions gets the version information deployed to each node. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes +// +//meta:operation GET /manage/v1/version +func (s *EnterpriseService) GetNodeReleaseVersions(ctx context.Context, opts *NodeQueryOptions) ([]*NodeReleaseVersion, *Response, error) { + u, err := addOptions("manage/v1/version", opts) + if err != nil { + return nil, nil, err + } + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var releaseVersions []*NodeReleaseVersion + resp, err := s.client.Do(ctx, req, &releaseVersions) + if err != nil { + return nil, resp, err + } + + return releaseVersions, resp, nil +} diff --git a/vendor/github.com/google/go-github/v74/github/enterprise_manage_ghes_config.go b/vendor/github.com/google/go-github/v74/github/enterprise_manage_ghes_config.go new file mode 100644 index 0000000000..ded48ddc70 --- /dev/null +++ b/vendor/github.com/google/go-github/v74/github/enterprise_manage_ghes_config.go @@ -0,0 +1,516 @@ +// Copyright 2025 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "errors" +) + +// ConfigApplyOptions is a struct to hold the options for the ConfigApply API and the response. +type ConfigApplyOptions struct { + // RunID is the ID of the run to get the status of. If empty a random one will be generated. + RunID *string `json:"run_id,omitempty"` +} + +// ConfigApplyStatus is a struct to hold the response from the ConfigApply API. +type ConfigApplyStatus struct { + Running *bool `json:"running,omitempty"` + Successful *bool `json:"successful,omitempty"` + Nodes []*ConfigApplyStatusNode `json:"nodes"` +} + +// ConfigApplyStatusNode is a struct to hold the response from the ConfigApply API. +type ConfigApplyStatusNode struct { + Hostname *string `json:"hostname,omitempty"` + Running *bool `json:"running,omitempty"` + Successful *bool `json:"successful,omitempty"` + RunID *string `json:"run_id,omitempty"` +} + +// ConfigApplyEventsOptions is used to enable pagination. +type ConfigApplyEventsOptions struct { + LastRequestID *string `url:"last_request_id,omitempty"` +} + +// ConfigApplyEvents is a struct to hold the response from the ConfigApplyEvents API. +type ConfigApplyEvents struct { + Nodes []*ConfigApplyEventsNode `json:"nodes"` +} + +// ConfigApplyEventsNode is a struct to hold the response from the ConfigApplyEvents API. +type ConfigApplyEventsNode struct { + Node *string `json:"node,omitempty"` + LastRequestID *string `json:"last_request_id,omitempty"` + Events []*ConfigApplyEventsNodeEvent `json:"events"` +} + +// ConfigApplyEventsNodeEvent is a struct to hold the response from the ConfigApplyEvents API. +type ConfigApplyEventsNodeEvent struct { + Timestamp *Timestamp `json:"timestamp,omitempty"` + SeverityText *string `json:"severity_text,omitempty"` + Body *string `json:"body,omitempty"` + EventName *string `json:"event_name,omitempty"` + Topology *string `json:"topology,omitempty"` + Hostname *string `json:"hostname,omitempty"` + ConfigRunID *string `json:"config_run_id,omitempty"` + TraceID *string `json:"trace_id,omitempty"` + SpanID *string `json:"span_id,omitempty"` + SpanParentID *int64 `json:"span_parent_id,omitempty"` + SpanDepth *int `json:"span_depth,omitempty"` +} + +// InitialConfigOptions is a struct to hold the options for the InitialConfig API. +type InitialConfigOptions struct { + License string `url:"license"` + Password string `url:"password"` +} + +// LicenseStatus is a struct to hold the response from the License API. +type LicenseStatus struct { + AdvancedSecurityEnabled *bool `json:"advancedSecurityEnabled,omitempty"` + AdvancedSecuritySeats *int `json:"advancedSecuritySeats,omitempty"` + ClusterSupport *bool `json:"clusterSupport,omitempty"` + Company *string `json:"company,omitempty"` + CroquetSupport *bool `json:"croquetSupport,omitempty"` + CustomTerms *bool `json:"customTerms,omitempty"` + Evaluation *bool `json:"evaluation,omitempty"` + ExpireAt *Timestamp `json:"expireAt,omitempty"` + InsightsEnabled *bool `json:"insightsEnabled,omitempty"` + InsightsExpireAt *Timestamp `json:"insightsExpireAt,omitempty"` + LearningLabEvaluationExpires *Timestamp `json:"learningLabEvaluationExpires,omitempty"` + LearningLabSeats *int `json:"learningLabSeats,omitempty"` + Perpetual *bool `json:"perpetual,omitempty"` + ReferenceNumber *string `json:"referenceNumber,omitempty"` + Seats *int `json:"seats,omitempty"` + SSHAllowed *bool `json:"sshAllowed,omitempty"` + SupportKey *string `json:"supportKey,omitempty"` + UnlimitedSeating *bool `json:"unlimitedSeating,omitempty"` +} + +// UploadLicenseOptions is a struct to hold the options for the UploadLicense API. +type UploadLicenseOptions struct { + License string `url:"license"` +} + +// LicenseCheck is a struct to hold the response from the LicenseStatus API. +type LicenseCheck struct { + Status *string `json:"status,omitempty"` +} + +// ConfigSettings is a struct to hold the response from the Settings API. +// There are many fields that link to other structs. +type ConfigSettings struct { + PrivateMode *bool `json:"private_mode,omitempty"` + PublicPages *bool `json:"public_pages,omitempty"` + SubdomainIsolation *bool `json:"subdomain_isolation,omitempty"` + SignupEnabled *bool `json:"signup_enabled,omitempty"` + GithubHostname *string `json:"github_hostname,omitempty"` + IdenticonsHost *string `json:"identicons_host,omitempty"` + HTTPProxy *string `json:"http_proxy,omitempty"` + AuthMode *string `json:"auth_mode,omitempty"` + ExpireSessions *bool `json:"expire_sessions,omitempty"` + AdminPassword *string `json:"admin_password,omitempty"` + ConfigurationID *int64 `json:"configuration_id,omitempty"` + ConfigurationRunCount *int `json:"configuration_run_count,omitempty"` + Avatar *ConfigSettingsAvatar `json:"avatar,omitempty"` + Customer *ConfigSettingsCustomer `json:"customer,omitempty"` + License *ConfigSettingsLicenseSettings `json:"license,omitempty"` + GithubSSL *ConfigSettingsGithubSSL `json:"github_ssl,omitempty"` + LDAP *ConfigSettingsLDAP `json:"ldap,omitempty"` + CAS *ConfigSettingsCAS `json:"cas,omitempty"` + SAML *ConfigSettingsSAML `json:"saml,omitempty"` + GithubOAuth *ConfigSettingsGithubOAuth `json:"github_oauth,omitempty"` + SMTP *ConfigSettingsSMTP `json:"smtp,omitempty"` + NTP *ConfigSettingsNTP `json:"ntp,omitempty"` + Timezone *string `json:"timezone,omitempty"` + SNMP *ConfigSettingsSNMP `json:"snmp,omitempty"` + Syslog *ConfigSettingsSyslog `json:"syslog,omitempty"` + Assets *string `json:"assets,omitempty"` + Pages *ConfigSettingsPagesSettings `json:"pages,omitempty"` + Collectd *ConfigSettingsCollectd `json:"collectd,omitempty"` + Mapping *ConfigSettingsMapping `json:"mapping,omitempty"` + LoadBalancer *string `json:"load_balancer,omitempty"` +} + +// ConfigSettingsAvatar is a struct to hold the response from the Settings API. +type ConfigSettingsAvatar struct { + Enabled *bool `json:"enabled,omitempty"` + URI *string `json:"uri,omitempty"` +} + +// ConfigSettingsCustomer is a struct to hold the response from the Settings API. +type ConfigSettingsCustomer struct { + Name *string `json:"name,omitempty"` + Email *string `json:"email,omitempty"` + UUID *string `json:"uuid,omitempty"` + Secret *string `json:"secret,omitempty"` + PublicKeyData *string `json:"public_key_data,omitempty"` +} + +// ConfigSettingsLicenseSettings is a struct to hold the response from the Settings API. +type ConfigSettingsLicenseSettings struct { + Seats *int `json:"seats,omitempty"` + Evaluation *bool `json:"evaluation,omitempty"` + Perpetual *bool `json:"perpetual,omitempty"` + UnlimitedSeating *bool `json:"unlimited_seating,omitempty"` + SupportKey *string `json:"support_key,omitempty"` + SSHAllowed *bool `json:"ssh_allowed,omitempty"` + ClusterSupport *bool `json:"cluster_support,omitempty"` + ExpireAt *Timestamp `json:"expire_at,omitempty"` +} + +// ConfigSettingsGithubSSL is a struct to hold the response from the Settings API. +type ConfigSettingsGithubSSL struct { + Enabled *bool `json:"enabled,omitempty"` + Cert *string `json:"cert,omitempty"` + Key *string `json:"key,omitempty"` +} + +// ConfigSettingsLDAP is a struct to hold the response from the Settings API. +type ConfigSettingsLDAP struct { + Host *string `json:"host,omitempty"` + Port *int `json:"port,omitempty"` + Base []string `json:"base,omitempty"` + UID *string `json:"uid,omitempty"` + BindDN *string `json:"bind_dn,omitempty"` + Password *string `json:"password,omitempty"` + Method *string `json:"method,omitempty"` + SearchStrategy *string `json:"search_strategy,omitempty"` + UserGroups []string `json:"user_groups,omitempty"` + AdminGroup *string `json:"admin_group,omitempty"` + VirtualAttributeEnabled *bool `json:"virtual_attribute_enabled,omitempty"` + RecursiveGroupSearch *bool `json:"recursive_group_search,omitempty"` + PosixSupport *bool `json:"posix_support,omitempty"` + UserSyncEmails *bool `json:"user_sync_emails,omitempty"` + UserSyncKeys *bool `json:"user_sync_keys,omitempty"` + UserSyncInterval *int `json:"user_sync_interval,omitempty"` + TeamSyncInterval *int `json:"team_sync_interval,omitempty"` + SyncEnabled *bool `json:"sync_enabled,omitempty"` + Reconciliation *ConfigSettingsLDAPReconciliation `json:"reconciliation,omitempty"` + Profile *ConfigSettingsLDAPProfile `json:"profile,omitempty"` +} + +// ConfigSettingsLDAPReconciliation is part of the ConfigSettingsLDAP struct. +type ConfigSettingsLDAPReconciliation struct { + User *string `json:"user,omitempty"` + Org *string `json:"org,omitempty"` +} + +// ConfigSettingsLDAPProfile is part of the ConfigSettingsLDAP struct. +type ConfigSettingsLDAPProfile struct { + UID *string `json:"uid,omitempty"` + Name *string `json:"name,omitempty"` + Mail *string `json:"mail,omitempty"` + Key *string `json:"key,omitempty"` +} + +// ConfigSettingsCAS is a struct to hold the response from the Settings API. +type ConfigSettingsCAS struct { + URL *string `json:"url,omitempty"` +} + +// ConfigSettingsSAML is a struct to hold the response from the Settings API. +type ConfigSettingsSAML struct { + SSOURL *string `json:"sso_url,omitempty"` + Certificate *string `json:"certificate,omitempty"` + CertificatePath *string `json:"certificate_path,omitempty"` + Issuer *string `json:"issuer,omitempty"` + IDPInitiatedSSO *bool `json:"idp_initiated_sso,omitempty"` + DisableAdminDemote *bool `json:"disable_admin_demote,omitempty"` +} + +// ConfigSettingsGithubOAuth is a struct to hold the response from the Settings API. +type ConfigSettingsGithubOAuth struct { + ClientID *string `json:"client_id,omitempty"` + ClientSecret *string `json:"client_secret,omitempty"` + OrganizationName *string `json:"organization_name,omitempty"` + OrganizationTeam *string `json:"organization_team,omitempty"` +} + +// ConfigSettingsSMTP is a struct to hold the response from the Settings API. +type ConfigSettingsSMTP struct { + Enabled *bool `json:"enabled,omitempty"` + Address *string `json:"address,omitempty"` + Authentication *string `json:"authentication,omitempty"` + Port *string `json:"port,omitempty"` + Domain *string `json:"domain,omitempty"` + Username *string `json:"username,omitempty"` + UserName *string `json:"user_name,omitempty"` + EnableStarttlsAuto *bool `json:"enable_starttls_auto,omitempty"` + Password *string `json:"password,omitempty"` + DiscardToNoreplyAddress *bool `json:"discard-to-noreply-address,omitempty"` + SupportAddress *string `json:"support_address,omitempty"` + SupportAddressType *string `json:"support_address_type,omitempty"` + NoreplyAddress *string `json:"noreply_address,omitempty"` +} + +// ConfigSettingsNTP is a struct to hold the response from the Settings API. +type ConfigSettingsNTP struct { + PrimaryServer *string `json:"primary_server,omitempty"` + SecondaryServer *string `json:"secondary_server,omitempty"` +} + +// ConfigSettingsSNMP is a struct to hold the response from the Settings API. +type ConfigSettingsSNMP struct { + Enabled *bool `json:"enabled,omitempty"` + Community *string `json:"community,omitempty"` +} + +// ConfigSettingsSyslog is a struct to hold the response from the Settings API. +type ConfigSettingsSyslog struct { + Enabled *bool `json:"enabled,omitempty"` + Server *string `json:"server,omitempty"` + ProtocolName *string `json:"protocol_name,omitempty"` +} + +// ConfigSettingsPagesSettings is a struct to hold the response from the Settings API. +type ConfigSettingsPagesSettings struct { + Enabled *bool `json:"enabled,omitempty"` +} + +// ConfigSettingsCollectd is a struct to hold the response from the Settings API. +type ConfigSettingsCollectd struct { + Enabled *bool `json:"enabled,omitempty"` + Server *string `json:"server,omitempty"` + Port *int `json:"port,omitempty"` + Encryption *string `json:"encryption,omitempty"` + Username *string `json:"username,omitempty"` + Password *string `json:"password,omitempty"` +} + +// ConfigSettingsMapping is a struct to hold the response from the Settings API. +type ConfigSettingsMapping struct { + Enabled *bool `json:"enabled,omitempty"` + Tileserver *string `json:"tileserver,omitempty"` + Basemap *string `json:"basemap,omitempty"` + Token *string `json:"token,omitempty"` +} + +// NodeMetadataStatus is a struct to hold the response from the NodeMetadata API. +type NodeMetadataStatus struct { + Topology *string `json:"topology,omitempty"` + Nodes []*NodeDetails `json:"nodes"` +} + +// NodeDetails is a struct to hold the response from the NodeMetadata API. +type NodeDetails struct { + Hostname *string `json:"hostname,omitempty"` + UUID *string `json:"uuid,omitempty"` + ClusterRoles []string `json:"cluster_roles,omitempty"` +} + +// ConfigApplyEvents gets events from the command ghe-config-apply. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply +// +//meta:operation GET /manage/v1/config/apply/events +func (s *EnterpriseService) ConfigApplyEvents(ctx context.Context, opts *ConfigApplyEventsOptions) (*ConfigApplyEvents, *Response, error) { + u, err := addOptions("manage/v1/config/apply/events", opts) + if err != nil { + return nil, nil, err + } + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + configApplyEvents := new(ConfigApplyEvents) + resp, err := s.client.Do(ctx, req, configApplyEvents) + if err != nil { + return nil, resp, err + } + + return configApplyEvents, resp, nil +} + +// InitialConfig initializes the GitHub Enterprise instance with a license and password. +// After initializing the instance, you need to run an apply to apply the configuration. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-and-password +// +//meta:operation POST /manage/v1/config/init +func (s *EnterpriseService) InitialConfig(ctx context.Context, license, password string) (*Response, error) { + u := "manage/v1/config/init" + + opts := &InitialConfigOptions{ + License: license, + Password: password, + } + + req, err := s.client.NewRequest("POST", u, opts) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// License gets the current license information for the GitHub Enterprise instance. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information +// +//meta:operation GET /manage/v1/config/license +func (s *EnterpriseService) License(ctx context.Context) ([]*LicenseStatus, *Response, error) { + u := "manage/v1/config/license" + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var licenseStatus []*LicenseStatus + resp, err := s.client.Do(ctx, req, &licenseStatus) + if err != nil { + return nil, resp, err + } + + return licenseStatus, resp, nil +} + +// UploadLicense uploads a new license to the GitHub Enterprise instance. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license +// +//meta:operation PUT /manage/v1/config/license +func (s *EnterpriseService) UploadLicense(ctx context.Context, license string) (*Response, error) { + u := "manage/v1/config/license" + opts := &UploadLicenseOptions{ + License: license, + } + req, err := s.client.NewRequest("PUT", u, opts) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// LicenseStatus gets the current license status for the GitHub Enterprise instance. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#check-a-license +// +//meta:operation GET /manage/v1/config/license/check +func (s *EnterpriseService) LicenseStatus(ctx context.Context) ([]*LicenseCheck, *Response, error) { + u := "manage/v1/config/license/check" + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var checks []*LicenseCheck + resp, err := s.client.Do(ctx, req, &checks) + if err != nil { + return nil, resp, err + } + + return checks, resp, nil +} + +// NodeMetadata gets the metadata for all nodes in the GitHub Enterprise instance. +// This is required for clustered setups. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes +// +//meta:operation GET /manage/v1/config/nodes +func (s *EnterpriseService) NodeMetadata(ctx context.Context, opts *NodeQueryOptions) (*NodeMetadataStatus, *Response, error) { + u, err := addOptions("manage/v1/config/nodes", opts) + if err != nil { + return nil, nil, err + } + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + status := new(NodeMetadataStatus) + resp, err := s.client.Do(ctx, req, status) + if err != nil { + return nil, resp, err + } + + return status, resp, nil +} + +// Settings gets the current configuration settings for the GitHub Enterprise instance. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-ghes-settings +// +//meta:operation GET /manage/v1/config/settings +func (s *EnterpriseService) Settings(ctx context.Context) (*ConfigSettings, *Response, error) { + u := "manage/v1/config/settings" + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + configSettings := new(ConfigSettings) + resp, err := s.client.Do(ctx, req, configSettings) + if err != nil { + return nil, resp, err + } + + return configSettings, resp, nil +} + +// UpdateSettings updates the configuration settings for the GitHub Enterprise instance. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#set-settings +// +//meta:operation PUT /manage/v1/config/settings +func (s *EnterpriseService) UpdateSettings(ctx context.Context, opts *ConfigSettings) (*Response, error) { + u := "manage/v1/config/settings" + + if opts == nil { + return nil, errors.New("opts should not be nil") + } + req, err := s.client.NewRequest("PUT", u, opts) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// ConfigApply triggers a configuration apply run on the GitHub Enterprise instance. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run +// +//meta:operation POST /manage/v1/config/apply +func (s *EnterpriseService) ConfigApply(ctx context.Context, opts *ConfigApplyOptions) (*ConfigApplyOptions, *Response, error) { + u := "manage/v1/config/apply" + req, err := s.client.NewRequest("POST", u, opts) + if err != nil { + return nil, nil, err + } + + configApplyOptions := new(ConfigApplyOptions) + resp, err := s.client.Do(ctx, req, configApplyOptions) + if err != nil { + return nil, resp, err + } + return configApplyOptions, resp, nil +} + +// ConfigApplyStatus gets the status of a ghe-config-apply run on the GitHub Enterprise instance. +// You can request lat one or specific id one. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run +// +//meta:operation GET /manage/v1/config/apply +func (s *EnterpriseService) ConfigApplyStatus(ctx context.Context, opts *ConfigApplyOptions) (*ConfigApplyStatus, *Response, error) { + u := "manage/v1/config/apply" + req, err := s.client.NewRequest("GET", u, opts) + if err != nil { + return nil, nil, err + } + + status := new(ConfigApplyStatus) + resp, err := s.client.Do(ctx, req, status) + if err != nil { + return nil, resp, err + } + return status, resp, nil +} diff --git a/vendor/github.com/google/go-github/v74/github/enterprise_manage_ghes_maintenance.go b/vendor/github.com/google/go-github/v74/github/enterprise_manage_ghes_maintenance.go new file mode 100644 index 0000000000..8b27b32a4a --- /dev/null +++ b/vendor/github.com/google/go-github/v74/github/enterprise_manage_ghes_maintenance.go @@ -0,0 +1,94 @@ +// Copyright 2025 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" +) + +// MaintenanceOperationStatus represents the message to be displayed when the instance gets a maintenance operation request. +type MaintenanceOperationStatus struct { + Hostname *string `json:"hostname,omitempty"` + UUID *string `json:"uuid,omitempty"` + Message *string `json:"message,omitempty"` +} + +// MaintenanceStatus represents the status of maintenance mode for all nodes. +type MaintenanceStatus struct { + Hostname *string `json:"hostname,omitempty"` + UUID *string `json:"uuid,omitempty"` + Status *string `json:"status,omitempty"` + ScheduledTime *Timestamp `json:"scheduled_time,omitempty"` + ConnectionServices []*ConnectionServiceItem `json:"connection_services,omitempty"` + CanUnsetMaintenance *bool `json:"can_unset_maintenance,omitempty"` + IPExceptionList []string `json:"ip_exception_list,omitempty"` + MaintenanceModeMessage *string `json:"maintenance_mode_message,omitempty"` +} + +// ConnectionServiceItem represents the connection services for the maintenance status. +type ConnectionServiceItem struct { + Name *string `json:"name,omitempty"` + Number *int `json:"number,omitempty"` +} + +// MaintenanceOptions represents the options for setting the maintenance mode for the instance. +// When can be a string, so we can't use a Timestamp type. +type MaintenanceOptions struct { + Enabled bool `json:"enabled"` + UUID *string `json:"uuid,omitempty"` + When *string `json:"when,omitempty"` + IPExceptionList []string `json:"ip_exception_list,omitempty"` + MaintenanceModeMessage *string `json:"maintenance_mode_message,omitempty"` +} + +// GetMaintenanceStatus gets the status of maintenance mode for all nodes. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode +// +//meta:operation GET /manage/v1/maintenance +func (s *EnterpriseService) GetMaintenanceStatus(ctx context.Context, opts *NodeQueryOptions) ([]*MaintenanceStatus, *Response, error) { + u, err := addOptions("manage/v1/maintenance", opts) + if err != nil { + return nil, nil, err + } + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var status []*MaintenanceStatus + resp, err := s.client.Do(ctx, req, &status) + if err != nil { + return nil, resp, err + } + + return status, resp, nil +} + +// CreateMaintenance sets the maintenance mode for the instance. +// With the enable parameter we can control to put instance into maintenance mode or not. With false we can disable the maintenance mode. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode +// +//meta:operation POST /manage/v1/maintenance +func (s *EnterpriseService) CreateMaintenance(ctx context.Context, enable bool, opts *MaintenanceOptions) ([]*MaintenanceOperationStatus, *Response, error) { + u := "manage/v1/maintenance" + + opts.Enabled = enable + + req, err := s.client.NewRequest("POST", u, opts) + if err != nil { + return nil, nil, err + } + + var i []*MaintenanceOperationStatus + resp, err := s.client.Do(ctx, req, &i) + if err != nil { + return nil, resp, err + } + + return i, resp, nil +} diff --git a/vendor/github.com/google/go-github/v74/github/enterprise_manage_ghes_ssh.go b/vendor/github.com/google/go-github/v74/github/enterprise_manage_ghes_ssh.go new file mode 100644 index 0000000000..d60f897793 --- /dev/null +++ b/vendor/github.com/google/go-github/v74/github/enterprise_manage_ghes_ssh.go @@ -0,0 +1,99 @@ +// Copyright 2025 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" +) + +// SSHKeyStatus represents the status of a SSH key operation. +type SSHKeyStatus struct { + Hostname *string `json:"hostname,omitempty"` + UUID *string `json:"uuid,omitempty"` + Message *string `json:"message,omitempty"` + Modified *bool `json:"modified,omitempty"` +} + +// SSHKeyOptions specifies the parameters to the SSH create and delete functions. +type SSHKeyOptions struct { + // Key is the SSH key to add to the instance. + Key string `json:"key"` +} + +// ClusterSSHKey represents the SSH keys configured for the instance. +type ClusterSSHKey struct { + Key *string `json:"key,omitempty"` + Fingerprint *string `json:"fingerprint,omitempty"` +} + +// DeleteSSHKey deletes the SSH key from the instance. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#delete-a-ssh-key +// +//meta:operation DELETE /manage/v1/access/ssh +func (s *EnterpriseService) DeleteSSHKey(ctx context.Context, key string) ([]*SSHKeyStatus, *Response, error) { + u := "manage/v1/access/ssh" + opts := &SSHKeyOptions{ + Key: key, + } + req, err := s.client.NewRequest("DELETE", u, opts) + if err != nil { + return nil, nil, err + } + + var sshStatus []*SSHKeyStatus + resp, err := s.client.Do(ctx, req, &sshStatus) + if err != nil { + return nil, resp, err + } + + return sshStatus, resp, nil +} + +// GetSSHKey gets the SSH keys configured for the instance. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys +// +//meta:operation GET /manage/v1/access/ssh +func (s *EnterpriseService) GetSSHKey(ctx context.Context) ([]*ClusterSSHKey, *Response, error) { + u := "manage/v1/access/ssh" + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var sshKeys []*ClusterSSHKey + resp, err := s.client.Do(ctx, req, &sshKeys) + if err != nil { + return nil, resp, err + } + + return sshKeys, resp, nil +} + +// CreateSSHKey adds a new SSH key to the instance. +// +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key +// +//meta:operation POST /manage/v1/access/ssh +func (s *EnterpriseService) CreateSSHKey(ctx context.Context, key string) ([]*SSHKeyStatus, *Response, error) { + u := "manage/v1/access/ssh" + opts := &SSHKeyOptions{ + Key: key, + } + req, err := s.client.NewRequest("POST", u, opts) + if err != nil { + return nil, nil, err + } + + var sshKeyResponse []*SSHKeyStatus + resp, err := s.client.Do(ctx, req, &sshKeyResponse) + if err != nil { + return nil, resp, err + } + + return sshKeyResponse, resp, nil +} diff --git a/vendor/github.com/google/go-github/v74/github/enterprise_network_configurations.go b/vendor/github.com/google/go-github/v74/github/enterprise_network_configurations.go new file mode 100644 index 0000000000..a6a690d786 --- /dev/null +++ b/vendor/github.com/google/go-github/v74/github/enterprise_network_configurations.go @@ -0,0 +1,139 @@ +// Copyright 2025 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// ListEnterpriseNetworkConfigurations lists all hosted compute network configurations configured in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#list-hosted-compute-network-configurations-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/network-configurations +func (s *EnterpriseService) ListEnterpriseNetworkConfigurations(ctx context.Context, enterprise string, opts *ListOptions) (*NetworkConfigurations, *Response, error) { + u := fmt.Sprintf("enterprises/%v/network-configurations", enterprise) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + networks := &NetworkConfigurations{} + resp, err := s.client.Do(ctx, req, networks) + if err != nil { + return nil, resp, err + } + return networks, resp, nil +} + +// CreateEnterpriseNetworkConfiguration creates a hosted compute network configuration for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#create-a-hosted-compute-network-configuration-for-an-enterprise +// +//meta:operation POST /enterprises/{enterprise}/network-configurations +func (s *EnterpriseService) CreateEnterpriseNetworkConfiguration(ctx context.Context, enterprise string, createReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) { + if err := validateNetworkConfigurationRequest(createReq); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("enterprises/%v/network-configurations", enterprise) + req, err := s.client.NewRequest("POST", u, createReq) + if err != nil { + return nil, nil, err + } + + network := &NetworkConfiguration{} + resp, err := s.client.Do(ctx, req, network) + if err != nil { + return nil, resp, err + } + + return network, resp, nil +} + +// GetEnterpriseNetworkConfiguration gets a hosted compute network configuration configured in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#get-a-hosted-compute-network-configuration-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/network-configurations/{network_configuration_id} +func (s *EnterpriseService) GetEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string) (*NetworkConfiguration, *Response, error) { + u := fmt.Sprintf("enterprises/%v/network-configurations/%v", enterprise, networkID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + network := &NetworkConfiguration{} + resp, err := s.client.Do(ctx, req, network) + if err != nil { + return nil, resp, err + } + return network, resp, nil +} + +// UpdateEnterpriseNetworkConfiguration updates a hosted compute network configuration for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#update-a-hosted-compute-network-configuration-for-an-enterprise +// +//meta:operation PATCH /enterprises/{enterprise}/network-configurations/{network_configuration_id} +func (s *EnterpriseService) UpdateEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string, updateReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) { + if err := validateNetworkConfigurationRequest(updateReq); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("enterprises/%v/network-configurations/%v", enterprise, networkID) + req, err := s.client.NewRequest("PATCH", u, updateReq) + if err != nil { + return nil, nil, err + } + + network := &NetworkConfiguration{} + resp, err := s.client.Do(ctx, req, network) + if err != nil { + return nil, resp, err + } + return network, resp, nil +} + +// DeleteEnterpriseNetworkConfiguration deletes a hosted compute network configuration from an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#delete-a-hosted-compute-network-configuration-from-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/network-configurations/{network_configuration_id} +func (s *EnterpriseService) DeleteEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/network-configurations/%v", enterprise, networkID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + return s.client.Do(ctx, req, nil) +} + +// GetEnterpriseNetworkSettingsResource gets a hosted compute network settings resource configured for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#get-a-hosted-compute-network-settings-resource-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/network-settings/{network_settings_id} +func (s *EnterpriseService) GetEnterpriseNetworkSettingsResource(ctx context.Context, enterprise, networkID string) (*NetworkSettingsResource, *Response, error) { + u := fmt.Sprintf("enterprises/%v/network-settings/%v", enterprise, networkID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + resource := &NetworkSettingsResource{} + resp, err := s.client.Do(ctx, req, resource) + if err != nil { + return nil, resp, err + } + return resource, resp, err +} diff --git a/vendor/github.com/google/go-github/v74/github/enterprise_properties.go b/vendor/github.com/google/go-github/v74/github/enterprise_properties.go new file mode 100644 index 0000000000..bc5ab55a3a --- /dev/null +++ b/vendor/github.com/google/go-github/v74/github/enterprise_properties.go @@ -0,0 +1,121 @@ +// Copyright 2024 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// GetAllCustomProperties gets all custom properties that are defined for the specified enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#get-custom-properties-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/properties/schema +func (s *EnterpriseService) GetAllCustomProperties(ctx context.Context, enterprise string) ([]*CustomProperty, *Response, error) { + u := fmt.Sprintf("enterprises/%v/properties/schema", enterprise) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var customProperties []*CustomProperty + resp, err := s.client.Do(ctx, req, &customProperties) + if err != nil { + return nil, resp, err + } + + return customProperties, resp, nil +} + +// CreateOrUpdateCustomProperties creates new or updates existing custom properties that are defined for the specified enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#create-or-update-custom-properties-for-an-enterprise +// +//meta:operation PATCH /enterprises/{enterprise}/properties/schema +func (s *EnterpriseService) CreateOrUpdateCustomProperties(ctx context.Context, enterprise string, properties []*CustomProperty) ([]*CustomProperty, *Response, error) { + u := fmt.Sprintf("enterprises/%v/properties/schema", enterprise) + + params := struct { + Properties []*CustomProperty `json:"properties"` + }{ + Properties: properties, + } + + req, err := s.client.NewRequest("PATCH", u, params) + if err != nil { + return nil, nil, err + } + + var customProperties []*CustomProperty + resp, err := s.client.Do(ctx, req, &customProperties) + if err != nil { + return nil, resp, err + } + + return customProperties, resp, nil +} + +// GetCustomProperty gets a custom property that is defined for the specified enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#get-a-custom-property-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/properties/schema/{custom_property_name} +func (s *EnterpriseService) GetCustomProperty(ctx context.Context, enterprise, customPropertyName string) (*CustomProperty, *Response, error) { + u := fmt.Sprintf("enterprises/%v/properties/schema/%v", enterprise, customPropertyName) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var customProperty *CustomProperty + resp, err := s.client.Do(ctx, req, &customProperty) + if err != nil { + return nil, resp, err + } + + return customProperty, resp, nil +} + +// CreateOrUpdateCustomProperty creates a new or updates an existing custom property that is defined for the specified enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#create-or-update-a-custom-property-for-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/properties/schema/{custom_property_name} +func (s *EnterpriseService) CreateOrUpdateCustomProperty(ctx context.Context, enterprise, customPropertyName string, property *CustomProperty) (*CustomProperty, *Response, error) { + u := fmt.Sprintf("enterprises/%v/properties/schema/%v", enterprise, customPropertyName) + + req, err := s.client.NewRequest("PUT", u, property) + if err != nil { + return nil, nil, err + } + + var customProperty *CustomProperty + resp, err := s.client.Do(ctx, req, &customProperty) + if err != nil { + return nil, resp, err + } + + return customProperty, resp, nil +} + +// RemoveCustomProperty removes a custom property that is defined for the specified enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#remove-a-custom-property-for-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/properties/schema/{custom_property_name} +func (s *EnterpriseService) RemoveCustomProperty(ctx context.Context, enterprise, customPropertyName string) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/properties/schema/%v", enterprise, customPropertyName) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v74/github/enterprise_rules.go b/vendor/github.com/google/go-github/v74/github/enterprise_rules.go new file mode 100644 index 0000000000..f438223370 --- /dev/null +++ b/vendor/github.com/google/go-github/v74/github/enterprise_rules.go @@ -0,0 +1,118 @@ +// Copyright 2025 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// CreateRepositoryRuleset creates a repository ruleset for the specified enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#create-an-enterprise-repository-ruleset +// +//meta:operation POST /enterprises/{enterprise}/rulesets +func (s *EnterpriseService) CreateRepositoryRuleset(ctx context.Context, enterprise string, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { + u := fmt.Sprintf("enterprises/%v/rulesets", enterprise) + + req, err := s.client.NewRequest("POST", u, ruleset) + if err != nil { + return nil, nil, err + } + + var rs *RepositoryRuleset + resp, err := s.client.Do(ctx, req, &rs) + if err != nil { + return nil, resp, err + } + + return rs, resp, nil +} + +// GetRepositoryRuleset gets a repository ruleset for the specified enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#get-an-enterprise-repository-ruleset +// +//meta:operation GET /enterprises/{enterprise}/rulesets/{ruleset_id} +func (s *EnterpriseService) GetRepositoryRuleset(ctx context.Context, enterprise string, rulesetID int64) (*RepositoryRuleset, *Response, error) { + u := fmt.Sprintf("enterprises/%v/rulesets/%v", enterprise, rulesetID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var ruleset *RepositoryRuleset + resp, err := s.client.Do(ctx, req, &ruleset) + if err != nil { + return nil, resp, err + } + + return ruleset, resp, nil +} + +// UpdateRepositoryRuleset updates a repository ruleset for the specified enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#update-an-enterprise-repository-ruleset +// +//meta:operation PUT /enterprises/{enterprise}/rulesets/{ruleset_id} +func (s *EnterpriseService) UpdateRepositoryRuleset(ctx context.Context, enterprise string, rulesetID int64, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { + u := fmt.Sprintf("enterprises/%v/rulesets/%v", enterprise, rulesetID) + + req, err := s.client.NewRequest("PUT", u, ruleset) + if err != nil { + return nil, nil, err + } + + var rs *RepositoryRuleset + resp, err := s.client.Do(ctx, req, &rs) + if err != nil { + return nil, resp, err + } + + return rs, resp, nil +} + +// UpdateRepositoryRulesetClearBypassActor clears the bypass actors for a repository ruleset for the specified enterprise. +// +// This function is necessary as the UpdateRepositoryRuleset function does not marshal ByPassActor if passed as an empty array. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#update-an-enterprise-repository-ruleset +// +//meta:operation PUT /enterprises/{enterprise}/rulesets/{ruleset_id} +func (s *EnterpriseService) UpdateRepositoryRulesetClearBypassActor(ctx context.Context, enterprise string, rulesetID int64) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/rulesets/%v", enterprise, rulesetID) + + rsClearBypassActor := rulesetClearBypassActors{} + + req, err := s.client.NewRequest("PUT", u, rsClearBypassActor) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// DeleteRepositoryRuleset deletes a repository ruleset from the specified enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#delete-an-enterprise-repository-ruleset +// +//meta:operation DELETE /enterprises/{enterprise}/rulesets/{ruleset_id} +func (s *EnterpriseService) DeleteRepositoryRuleset(ctx context.Context, enterprise string, rulesetID int64) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/rulesets/%v", enterprise, rulesetID) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v66/github/event.go b/vendor/github.com/google/go-github/v74/github/event.go similarity index 93% rename from vendor/github.com/google/go-github/v66/github/event.go rename to vendor/github.com/google/go-github/v74/github/event.go index e98606bce5..446db7fa01 100644 --- a/vendor/github.com/google/go-github/v66/github/event.go +++ b/vendor/github.com/google/go-github/v74/github/event.go @@ -27,7 +27,7 @@ func (e Event) String() string { // ParsePayload parses the event payload. For recognized event types, // a value of the corresponding struct type will be returned. -func (e *Event) ParsePayload() (interface{}, error) { +func (e *Event) ParsePayload() (any, error) { // It would be nice if e.Type were the snake_case name of the event, // but the existing interface uses the struct name instead. payload := EventForType(typeToMessageMapping[e.GetType()]) @@ -44,7 +44,7 @@ func (e *Event) ParsePayload() (interface{}, error) { // // Deprecated: Use ParsePayload instead, which returns an error // rather than panics if JSON unmarshaling raw payload fails. -func (e *Event) Payload() (payload interface{}) { +func (e *Event) Payload() (payload any) { var err error payload, err = e.ParsePayload() if err != nil { diff --git a/vendor/github.com/google/go-github/v66/github/event_types.go b/vendor/github.com/google/go-github/v74/github/event_types.go similarity index 90% rename from vendor/github.com/google/go-github/v66/github/event_types.go rename to vendor/github.com/google/go-github/v74/github/event_types.go index 40ad919be5..3aa151e5ca 100644 --- a/vendor/github.com/google/go-github/v66/github/event_types.go +++ b/vendor/github.com/google/go-github/v74/github/event_types.go @@ -132,6 +132,43 @@ type CreateEvent struct { Installation *Installation `json:"installation,omitempty"` } +// CustomPropertyEvent represents a created, deleted or updated custom property. +// The Webhook event name is "custom_property". +// +// Note: this is related to custom property configuration at the enterprise or organization level. +// See CustomPropertyValuesEvent for activity related to custom property values for a repository. +// +// GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#custom_property +type CustomPropertyEvent struct { + // Action possible values are: "created", "deleted", "updated". + Action *string `json:"action,omitempty"` + Definition *CustomProperty `json:"definition,omitempty"` + + // The following fields are only populated by Webhook events. + Enterprise *Enterprise `json:"enterprise,omitempty"` + Installation *Installation `json:"installation,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` +} + +// CustomPropertyValuesEvent represents an update to a custom property. +// The Webhook event name is "custom_property_values". +// +// GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#custom_property_values +type CustomPropertyValuesEvent struct { + // Action possible values are: "updated". + Action *string `json:"action,omitempty"` + NewPropertyValues []*CustomPropertyValue `json:"new_property_values,omitempty"` + OldPropertyValues []*CustomPropertyValue `json:"old_property_values,omitempty"` + + // The following fields are only populated by Webhook events. + Enterprise *Enterprise `json:"enterprise,omitempty"` + Installation *Installation `json:"installation,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` +} + // DeleteEvent represents a deleted branch or tag. // The Webhook event name is "delete". // @@ -821,8 +858,10 @@ type MergeGroup struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#merge_group type MergeGroupEvent struct { - // The action that was performed. Currently, can only be checks_requested. + // The action that was performed. Possible values are: "checks_requested", "destroyed". Action *string `json:"action,omitempty"` + // Reason is populated when the action is "destroyed". Possible values: "merged", "invalidated", "dequeued". + Reason *string `json:"reason,omitempty"` // The merge group. MergeGroup *MergeGroup `json:"merge_group,omitempty"` @@ -1046,63 +1085,13 @@ type PingEvent struct { Installation *Installation `json:"installation,omitempty"` } -// ProjectEvent is triggered when project is created, modified or deleted. -// The webhook event name is "project". -// -// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#project -type ProjectEvent struct { - Action *string `json:"action,omitempty"` - Changes *ProjectChange `json:"changes,omitempty"` - Project *Project `json:"project,omitempty"` - - // The following fields are only populated by Webhook events. - Repo *Repository `json:"repository,omitempty"` - Org *Organization `json:"organization,omitempty"` - Sender *User `json:"sender,omitempty"` - Installation *Installation `json:"installation,omitempty"` -} - -// ProjectCardEvent is triggered when a project card is created, updated, moved, converted to an issue, or deleted. -// The webhook event name is "project_card". -// -// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#project_card -type ProjectCardEvent struct { - Action *string `json:"action,omitempty"` - Changes *ProjectCardChange `json:"changes,omitempty"` - AfterID *int64 `json:"after_id,omitempty"` - ProjectCard *ProjectCard `json:"project_card,omitempty"` - - // The following fields are only populated by Webhook events. - Repo *Repository `json:"repository,omitempty"` - Org *Organization `json:"organization,omitempty"` - Sender *User `json:"sender,omitempty"` - Installation *Installation `json:"installation,omitempty"` -} - -// ProjectColumnEvent is triggered when a project column is created, updated, moved, or deleted. -// The webhook event name is "project_column". -// -// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#project_column -type ProjectColumnEvent struct { - Action *string `json:"action,omitempty"` - Changes *ProjectColumnChange `json:"changes,omitempty"` - AfterID *int64 `json:"after_id,omitempty"` - ProjectColumn *ProjectColumn `json:"project_column,omitempty"` - - // The following fields are only populated by Webhook events. - Repo *Repository `json:"repository,omitempty"` - Org *Organization `json:"organization,omitempty"` - Sender *User `json:"sender,omitempty"` - Installation *Installation `json:"installation,omitempty"` -} - // ProjectV2Event is triggered when there is activity relating to an organization-level project. // The Webhook event name is "projects_v2". // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2 type ProjectV2Event struct { - Action *string `json:"action,omitempty"` - ProjectsV2 *ProjectsV2 `json:"projects_v2,omitempty"` + Action *string `json:"action,omitempty"` + ProjectsV2 *ProjectV2 `json:"projects_v2,omitempty"` // The following fields are only populated by Webhook events. Installation *Installation `json:"installation,omitempty"` @@ -1110,8 +1099,8 @@ type ProjectV2Event struct { Sender *User `json:"sender,omitempty"` } -// ProjectsV2 represents a projects v2 project. -type ProjectsV2 struct { +// ProjectV2 represents a v2 project. +type ProjectV2 struct { ID *int64 `json:"id,omitempty"` NodeID *string `json:"node_id,omitempty"` Owner *User `json:"owner,omitempty"` @@ -1126,6 +1115,17 @@ type ProjectsV2 struct { Number *int `json:"number,omitempty"` ShortDescription *string `json:"short_description,omitempty"` DeletedBy *User `json:"deleted_by,omitempty"` + + // Fields migrated from the Project (classic) struct: + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + ColumnsURL *string `json:"columns_url,omitempty"` + OwnerURL *string `json:"owner_url,omitempty"` + Name *string `json:"name,omitempty"` + Body *string `json:"body,omitempty"` + State *string `json:"state,omitempty"` + OrganizationPermission *string `json:"organization_permission,omitempty"` + Private *bool `json:"private,omitempty"` } // ProjectV2ItemEvent is triggered when there is activity relating to an item on an organization-level project. @@ -1400,44 +1400,44 @@ func (h HeadCommit) String() string { // PushEventRepository represents the repo object in a PushEvent payload. type PushEventRepository struct { - ID *int64 `json:"id,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Name *string `json:"name,omitempty"` - FullName *string `json:"full_name,omitempty"` - Owner *User `json:"owner,omitempty"` - Private *bool `json:"private,omitempty"` - Description *string `json:"description,omitempty"` - Fork *bool `json:"fork,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - PushedAt *Timestamp `json:"pushed_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - Homepage *string `json:"homepage,omitempty"` - PullsURL *string `json:"pulls_url,omitempty"` - Size *int `json:"size,omitempty"` - StargazersCount *int `json:"stargazers_count,omitempty"` - WatchersCount *int `json:"watchers_count,omitempty"` - Language *string `json:"language,omitempty"` - HasIssues *bool `json:"has_issues,omitempty"` - HasDownloads *bool `json:"has_downloads,omitempty"` - HasWiki *bool `json:"has_wiki,omitempty"` - HasPages *bool `json:"has_pages,omitempty"` - ForksCount *int `json:"forks_count,omitempty"` - Archived *bool `json:"archived,omitempty"` - Disabled *bool `json:"disabled,omitempty"` - OpenIssuesCount *int `json:"open_issues_count,omitempty"` - DefaultBranch *string `json:"default_branch,omitempty"` - MasterBranch *string `json:"master_branch,omitempty"` - Organization *string `json:"organization,omitempty"` - URL *string `json:"url,omitempty"` - ArchiveURL *string `json:"archive_url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - StatusesURL *string `json:"statuses_url,omitempty"` - GitURL *string `json:"git_url,omitempty"` - SSHURL *string `json:"ssh_url,omitempty"` - CloneURL *string `json:"clone_url,omitempty"` - SVNURL *string `json:"svn_url,omitempty"` - Topics []string `json:"topics,omitempty"` - CustomProperties map[string]interface{} `json:"custom_properties,omitempty"` + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Name *string `json:"name,omitempty"` + FullName *string `json:"full_name,omitempty"` + Owner *User `json:"owner,omitempty"` + Private *bool `json:"private,omitempty"` + Description *string `json:"description,omitempty"` + Fork *bool `json:"fork,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + PushedAt *Timestamp `json:"pushed_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + Homepage *string `json:"homepage,omitempty"` + PullsURL *string `json:"pulls_url,omitempty"` + Size *int `json:"size,omitempty"` + StargazersCount *int `json:"stargazers_count,omitempty"` + WatchersCount *int `json:"watchers_count,omitempty"` + Language *string `json:"language,omitempty"` + HasIssues *bool `json:"has_issues,omitempty"` + HasDownloads *bool `json:"has_downloads,omitempty"` + HasWiki *bool `json:"has_wiki,omitempty"` + HasPages *bool `json:"has_pages,omitempty"` + ForksCount *int `json:"forks_count,omitempty"` + Archived *bool `json:"archived,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + OpenIssuesCount *int `json:"open_issues_count,omitempty"` + DefaultBranch *string `json:"default_branch,omitempty"` + MasterBranch *string `json:"master_branch,omitempty"` + Organization *string `json:"organization,omitempty"` + URL *string `json:"url,omitempty"` + ArchiveURL *string `json:"archive_url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + StatusesURL *string `json:"statuses_url,omitempty"` + GitURL *string `json:"git_url,omitempty"` + SSHURL *string `json:"ssh_url,omitempty"` + CloneURL *string `json:"clone_url,omitempty"` + SVNURL *string `json:"svn_url,omitempty"` + Topics []string `json:"topics,omitempty"` + CustomProperties map[string]any `json:"custom_properties,omitempty"` } // PushEventRepoOwner is a basic representation of user/org in a PushEvent payload. @@ -1446,6 +1446,26 @@ type PushEventRepoOwner struct { Email *string `json:"email,omitempty"` } +// RegistryPackageEvent represents activity related to GitHub Packages. +// The Webhook event name is "registry_package". +// +// This event is triggered when a GitHub Package is published or updated. +// +// GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#registry_package +type RegistryPackageEvent struct { + // Action is the action that was performed. + // Can be "published" or "updated". + Action *string `json:"action,omitempty"` + RegistryPackage *Package `json:"registry_package,omitempty"` + Repository *Repository `json:"repository,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Enterprise *Enterprise `json:"enterprise,omitempty"` + Sender *User `json:"sender,omitempty"` + + // The following fields are only populated by Webhook events. + Installation *Installation `json:"installation,omitempty"` +} + // ReleaseEvent is triggered when a release is published, unpublished, created, // edited, deleted, or prereleased. // The Webhook event name is "release". @@ -1523,14 +1543,73 @@ type RepositoryImportEvent struct { // // GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#repository_ruleset type RepositoryRulesetEvent struct { - Action *string `json:"action,omitempty"` - Enterprise *Enterprise `json:"enterprise,omitempty"` - Installation *Installation `json:"installation,omitempty"` - Organization *Organization `json:"organization,omitempty"` - Repository *Repository `json:"repository,omitempty"` - RepositoryRuleset *RepositoryRuleset `json:"repository_ruleset"` - Changes *RepositoryRulesetEditedChanges `json:"changes,omitempty"` - Sender *User `json:"sender"` + Action *string `json:"action,omitempty"` + Enterprise *Enterprise `json:"enterprise,omitempty"` + Installation *Installation `json:"installation,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Repository *Repository `json:"repository,omitempty"` + RepositoryRuleset *RepositoryRuleset `json:"repository_ruleset"` + Changes *RepositoryRulesetChanges `json:"changes,omitempty"` + Sender *User `json:"sender"` +} + +// RepositoryRulesetChanges represents the changes made to a repository ruleset. +type RepositoryRulesetChanges struct { + Name *RepositoryRulesetChangeSource `json:"name,omitempty"` + Enforcement *RepositoryRulesetChangeSource `json:"enforcement,omitempty"` + Conditions *RepositoryRulesetChangedConditions `json:"conditions,omitempty"` + Rules *RepositoryRulesetChangedRules `json:"rules,omitempty"` +} + +// RepositoryRulesetChangeSource represents a source change for the ruleset. +type RepositoryRulesetChangeSource struct { + From *string `json:"from,omitempty"` +} + +// RepositoryRulesetChangeSources represents multiple source changes for the ruleset. +type RepositoryRulesetChangeSources struct { + From []string `json:"from,omitempty"` +} + +// RepositoryRulesetChangedConditions holds changes to conditions in a ruleset. +type RepositoryRulesetChangedConditions struct { + Added []*RepositoryRulesetConditions `json:"added,omitempty"` + Deleted []*RepositoryRulesetConditions `json:"deleted,omitempty"` + Updated []*RepositoryRulesetUpdatedConditions `json:"updated,omitempty"` +} + +// RepositoryRulesetUpdatedConditions represents the edited updates to conditions in a ruleset. +type RepositoryRulesetUpdatedConditions struct { + Condition *RepositoryRulesetConditions `json:"condition,omitempty"` + Changes *RepositoryRulesetUpdatedCondition `json:"changes,omitempty"` +} + +// RepositoryRulesetUpdatedCondition represents the changes to a condition in a ruleset. +type RepositoryRulesetUpdatedCondition struct { + ConditionType *RepositoryRulesetChangeSource `json:"condition_type,omitempty"` + Target *RepositoryRulesetChangeSource `json:"target,omitempty"` + Include *RepositoryRulesetChangeSources `json:"include,omitempty"` + Exclude *RepositoryRulesetChangeSources `json:"exclude,omitempty"` +} + +// RepositoryRulesetChangedRules holds changes to rules in a ruleset. +type RepositoryRulesetChangedRules struct { + Added []*RepositoryRule `json:"added,omitempty"` + Deleted []*RepositoryRule `json:"deleted,omitempty"` + Updated []*RepositoryRulesetUpdatedRules `json:"updated,omitempty"` +} + +// RepositoryRulesetUpdatedRules holds updates to rules in a ruleset. +type RepositoryRulesetUpdatedRules struct { + Rule *RepositoryRule `json:"rule,omitempty"` + Changes *RepositoryRulesetChangedRule `json:"changes,omitempty"` +} + +// RepositoryRulesetChangedRule holds changes made to a rule in a ruleset. +type RepositoryRulesetChangedRule struct { + Configuration *RepositoryRulesetChangeSource `json:"configuration,omitempty"` + RuleType *RepositoryRulesetChangeSource `json:"rule_type,omitempty"` + Pattern *RepositoryRulesetChangeSource `json:"pattern,omitempty"` } // RepositoryVulnerabilityAlertEvent is triggered when a security alert is created, dismissed, or resolved. @@ -1787,6 +1866,7 @@ type WorkflowJobEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + Deployment *Deployment `json:"deployment,omitempty"` } // WorkflowRunEvent is triggered when a GitHub Actions workflow run is requested or completed. diff --git a/vendor/github.com/google/go-github/v66/github/gists.go b/vendor/github.com/google/go-github/v74/github/gists.go similarity index 99% rename from vendor/github.com/google/go-github/v66/github/gists.go rename to vendor/github.com/google/go-github/v74/github/gists.go index 08180c6d30..ee4314b986 100644 --- a/vendor/github.com/google/go-github/v66/github/gists.go +++ b/vendor/github.com/google/go-github/v74/github/gists.go @@ -1,6 +1,6 @@ // Copyright 2013 The go-github AUTHORS. All rights reserved. // -// Use of this source code is governed by BSD-style +// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package github diff --git a/vendor/github.com/google/go-github/v66/github/gists_comments.go b/vendor/github.com/google/go-github/v74/github/gists_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/gists_comments.go rename to vendor/github.com/google/go-github/v74/github/gists_comments.go diff --git a/vendor/github.com/google/go-github/v66/github/git.go b/vendor/github.com/google/go-github/v74/github/git.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/git.go rename to vendor/github.com/google/go-github/v74/github/git.go diff --git a/vendor/github.com/google/go-github/v66/github/git_blobs.go b/vendor/github.com/google/go-github/v74/github/git_blobs.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/git_blobs.go rename to vendor/github.com/google/go-github/v74/github/git_blobs.go diff --git a/vendor/github.com/google/go-github/v66/github/git_commits.go b/vendor/github.com/google/go-github/v74/github/git_commits.go similarity index 99% rename from vendor/github.com/google/go-github/v66/github/git_commits.go rename to vendor/github.com/google/go-github/v74/github/git_commits.go index fdb3d26cea..d7ed3ecbec 100644 --- a/vendor/github.com/google/go-github/v66/github/git_commits.go +++ b/vendor/github.com/google/go-github/v74/github/git_commits.go @@ -49,7 +49,6 @@ type Commit struct { Message *string `json:"message,omitempty"` Tree *Tree `json:"tree,omitempty"` Parents []*Commit `json:"parents,omitempty"` - Stats *CommitStats `json:"stats,omitempty"` HTMLURL *string `json:"html_url,omitempty"` URL *string `json:"url,omitempty"` Verification *SignatureVerification `json:"verification,omitempty"` diff --git a/vendor/github.com/google/go-github/v66/github/git_refs.go b/vendor/github.com/google/go-github/v74/github/git_refs.go similarity index 98% rename from vendor/github.com/google/go-github/v66/github/git_refs.go rename to vendor/github.com/google/go-github/v74/github/git_refs.go index ad7b10d7d3..91eb6dd43f 100644 --- a/vendor/github.com/google/go-github/v66/github/git_refs.go +++ b/vendor/github.com/google/go-github/v74/github/git_refs.go @@ -127,7 +127,7 @@ func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, r u := fmt.Sprintf("repos/%v/%v/git/refs", owner, repo) req, err := s.client.NewRequest("POST", u, &createRefRequest{ // back-compat with previous behavior that didn't require 'refs/' prefix - Ref: String("refs/" + strings.TrimPrefix(*ref.Ref, "refs/")), + Ref: Ptr("refs/" + strings.TrimPrefix(*ref.Ref, "refs/")), SHA: ref.Object.SHA, }) if err != nil { diff --git a/vendor/github.com/google/go-github/v66/github/git_tags.go b/vendor/github.com/google/go-github/v74/github/git_tags.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/git_tags.go rename to vendor/github.com/google/go-github/v74/github/git_tags.go diff --git a/vendor/github.com/google/go-github/v66/github/git_trees.go b/vendor/github.com/google/go-github/v74/github/git_trees.go similarity index 96% rename from vendor/github.com/google/go-github/v66/github/git_trees.go rename to vendor/github.com/google/go-github/v74/github/git_trees.go index b8eed58e13..4396dd0160 100644 --- a/vendor/github.com/google/go-github/v66/github/git_trees.go +++ b/vendor/github.com/google/go-github/v74/github/git_trees.go @@ -118,8 +118,8 @@ func (s *GitService) GetTree(ctx context.Context, owner string, repo string, sha // createTree represents the body of a CreateTree request. type createTree struct { - BaseTree string `json:"base_tree,omitempty"` - Entries []interface{} `json:"tree"` + BaseTree string `json:"base_tree,omitempty"` + Entries []any `json:"tree"` } // CreateTree creates a new tree in a repository. If both a tree and a nested @@ -132,7 +132,7 @@ type createTree struct { func (s *GitService) CreateTree(ctx context.Context, owner string, repo string, baseTree string, entries []*TreeEntry) (*Tree, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/trees", owner, repo) - newEntries := make([]interface{}, 0, len(entries)) + newEntries := make([]any, 0, len(entries)) for _, entry := range entries { if entry.Content == nil && entry.SHA == nil { newEntries = append(newEntries, treeEntryWithFileDelete{ diff --git a/vendor/github.com/google/go-github/v66/github/github-accessors.go b/vendor/github.com/google/go-github/v74/github/github-accessors.go similarity index 87% rename from vendor/github.com/google/go-github/v66/github/github-accessors.go rename to vendor/github.com/google/go-github/v74/github/github-accessors.go index acc54e7d96..6526a7c667 100644 --- a/vendor/github.com/google/go-github/v66/github/github-accessors.go +++ b/vendor/github.com/google/go-github/v74/github/github-accessors.go @@ -934,6 +934,14 @@ func (a *Artifact) GetCreatedAt() Timestamp { return *a.CreatedAt } +// GetDigest returns the Digest field if it's non-nil, zero value otherwise. +func (a *Artifact) GetDigest() string { + if a == nil || a.Digest == nil { + return "" + } + return *a.Digest +} + // GetExpired returns the Expired field if it's non-nil, zero value otherwise. func (a *Artifact) GetExpired() bool { if a == nil || a.Expired == nil { @@ -1110,6 +1118,14 @@ func (a *AuditEntry) GetActorLocation() *ActorLocation { return a.ActorLocation } +// GetAdditionalFields returns the AdditionalFields map if it's non-nil, an empty map otherwise. +func (a *AuditEntry) GetAdditionalFields() map[string]any { + if a == nil || a.AdditionalFields == nil { + return map[string]any{} + } + return a.AdditionalFields +} + // GetBusiness returns the Business field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetBusiness() string { if a == nil || a.Business == nil { @@ -1134,6 +1150,14 @@ func (a *AuditEntry) GetCreatedAt() Timestamp { return *a.CreatedAt } +// GetData returns the Data map if it's non-nil, an empty map otherwise. +func (a *AuditEntry) GetData() map[string]any { + if a == nil || a.Data == nil { + return map[string]any{} + } + return a.Data +} + // GetDocumentID returns the DocumentID field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetDocumentID() string { if a == nil || a.DocumentID == nil { @@ -1598,6 +1622,14 @@ func (b *Branch) GetProtection() *Protection { return b.Protection } +// GetProtectionURL returns the ProtectionURL field if it's non-nil, zero value otherwise. +func (b *Branch) GetProtectionURL() string { + if b == nil || b.ProtectionURL == nil { + return "" + } + return *b.ProtectionURL +} + // GetCommit returns the Commit field. func (b *BranchCommit) GetCommit() *Commit { if b == nil { @@ -1846,6 +1878,14 @@ func (b *BranchProtectionRule) GetRequiredStatusChecksEnforcementLevel() string return *b.RequiredStatusChecksEnforcementLevel } +// GetRequireLastPushApproval returns the RequireLastPushApproval field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetRequireLastPushApproval() bool { + if b == nil || b.RequireLastPushApproval == nil { + return false + } + return *b.RequireLastPushApproval +} + // GetSignatureRequirementEnforcementLevel returns the SignatureRequirementEnforcementLevel field if it's non-nil, zero value otherwise. func (b *BranchProtectionRule) GetSignatureRequirementEnforcementLevel() string { if b == nil || b.SignatureRequirementEnforcementLevel == nil { @@ -1934,20 +1974,20 @@ func (b *BypassActor) GetActorID() int64 { return *b.ActorID } -// GetActorType returns the ActorType field if it's non-nil, zero value otherwise. -func (b *BypassActor) GetActorType() string { - if b == nil || b.ActorType == nil { - return "" +// GetActorType returns the ActorType field. +func (b *BypassActor) GetActorType() *BypassActorType { + if b == nil { + return nil } - return *b.ActorType + return b.ActorType } -// GetBypassMode returns the BypassMode field if it's non-nil, zero value otherwise. -func (b *BypassActor) GetBypassMode() string { - if b == nil || b.BypassMode == nil { - return "" +// GetBypassMode returns the BypassMode field. +func (b *BypassActor) GetBypassMode() *BypassMode { + if b == nil { + return nil } - return *b.BypassMode + return b.BypassMode } // GetApp returns the App field. @@ -2358,20 +2398,20 @@ func (c *CheckSuite) GetRepository() *Repository { return c.Repository } -// GetRerequstable returns the Rerequstable field if it's non-nil, zero value otherwise. -func (c *CheckSuite) GetRerequstable() bool { - if c == nil || c.Rerequstable == nil { +// GetRerequestable returns the Rerequestable field if it's non-nil, zero value otherwise. +func (c *CheckSuite) GetRerequestable() bool { + if c == nil || c.Rerequestable == nil { return false } - return *c.Rerequstable + return *c.Rerequestable } -// GetRunsRerequstable returns the RunsRerequstable field if it's non-nil, zero value otherwise. -func (c *CheckSuite) GetRunsRerequstable() bool { - if c == nil || c.RunsRerequstable == nil { +// GetRunsRerequestable returns the RunsRerequestable field if it's non-nil, zero value otherwise. +func (c *CheckSuite) GetRunsRerequestable() bool { + if c == nil || c.RunsRerequestable == nil { return false } - return *c.RunsRerequstable + return *c.RunsRerequestable } // GetStatus returns the Status field if it's non-nil, zero value otherwise. @@ -2462,6 +2502,70 @@ func (c *CheckSuitePreferenceResults) GetRepository() *Repository { return c.Repository } +// GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise. +func (c *ClusterSSHKey) GetFingerprint() string { + if c == nil || c.Fingerprint == nil { + return "" + } + return *c.Fingerprint +} + +// GetKey returns the Key field if it's non-nil, zero value otherwise. +func (c *ClusterSSHKey) GetKey() string { + if c == nil || c.Key == nil { + return "" + } + return *c.Key +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (c *ClusterStatus) GetStatus() string { + if c == nil || c.Status == nil { + return "" + } + return *c.Status +} + +// GetHostname returns the Hostname field if it's non-nil, zero value otherwise. +func (c *ClusterStatusNode) GetHostname() string { + if c == nil || c.Hostname == nil { + return "" + } + return *c.Hostname +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (c *ClusterStatusNode) GetStatus() string { + if c == nil || c.Status == nil { + return "" + } + return *c.Status +} + +// GetDetails returns the Details field if it's non-nil, zero value otherwise. +func (c *ClusterStatusNodeServiceItem) GetDetails() string { + if c == nil || c.Details == nil { + return "" + } + return *c.Details +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *ClusterStatusNodeServiceItem) GetName() string { + if c == nil || c.Name == nil { + return "" + } + return *c.Name +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (c *ClusterStatusNodeServiceItem) GetStatus() string { + if c == nil || c.Status == nil { + return "" + } + return *c.Status +} + // GetBody returns the Body field if it's non-nil, zero value otherwise. func (c *CodeOfConduct) GetBody() string { if c == nil || c.Body == nil { @@ -3542,14 +3646,6 @@ func (c *Commit) GetSHA() string { return *c.SHA } -// GetStats returns the Stats field. -func (c *Commit) GetStats() *CommitStats { - if c == nil { - return nil - } - return c.Stats -} - // GetTree returns the Tree field. func (c *Commit) GetTree() *Tree { if c == nil { @@ -4046,1996 +4142,3276 @@ func (c *CommunityHealthMetrics) GetUpdatedAt() Timestamp { return *c.UpdatedAt } -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (c *ContentReference) GetID() int64 { - if c == nil || c.ID == nil { - return 0 +// GetLastRequestID returns the LastRequestID field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNode) GetLastRequestID() string { + if c == nil || c.LastRequestID == nil { + return "" } - return *c.ID + return *c.LastRequestID } -// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (c *ContentReference) GetNodeID() string { - if c == nil || c.NodeID == nil { +// GetNode returns the Node field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNode) GetNode() string { + if c == nil || c.Node == nil { return "" } - return *c.NodeID + return *c.Node } -// GetReference returns the Reference field if it's non-nil, zero value otherwise. -func (c *ContentReference) GetReference() string { - if c == nil || c.Reference == nil { +// GetBody returns the Body field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetBody() string { + if c == nil || c.Body == nil { return "" } - return *c.Reference + return *c.Body } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (c *ContentReferenceEvent) GetAction() string { - if c == nil || c.Action == nil { +// GetConfigRunID returns the ConfigRunID field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetConfigRunID() string { + if c == nil || c.ConfigRunID == nil { return "" } - return *c.Action + return *c.ConfigRunID } -// GetContentReference returns the ContentReference field. -func (c *ContentReferenceEvent) GetContentReference() *ContentReference { - if c == nil { - return nil +// GetEventName returns the EventName field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetEventName() string { + if c == nil || c.EventName == nil { + return "" } - return c.ContentReference + return *c.EventName } -// GetInstallation returns the Installation field. -func (c *ContentReferenceEvent) GetInstallation() *Installation { - if c == nil { - return nil +// GetHostname returns the Hostname field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetHostname() string { + if c == nil || c.Hostname == nil { + return "" } - return c.Installation + return *c.Hostname } -// GetRepo returns the Repo field. -func (c *ContentReferenceEvent) GetRepo() *Repository { - if c == nil { - return nil +// GetSeverityText returns the SeverityText field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetSeverityText() string { + if c == nil || c.SeverityText == nil { + return "" } - return c.Repo + return *c.SeverityText } -// GetSender returns the Sender field. -func (c *ContentReferenceEvent) GetSender() *User { - if c == nil { - return nil +// GetSpanDepth returns the SpanDepth field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetSpanDepth() int { + if c == nil || c.SpanDepth == nil { + return 0 } - return c.Sender + return *c.SpanDepth } -// GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise. -func (c *Contributor) GetAvatarURL() string { - if c == nil || c.AvatarURL == nil { +// GetSpanID returns the SpanID field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetSpanID() string { + if c == nil || c.SpanID == nil { return "" } - return *c.AvatarURL + return *c.SpanID } -// GetContributions returns the Contributions field if it's non-nil, zero value otherwise. -func (c *Contributor) GetContributions() int { - if c == nil || c.Contributions == nil { +// GetSpanParentID returns the SpanParentID field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetSpanParentID() int64 { + if c == nil || c.SpanParentID == nil { return 0 } - return *c.Contributions + return *c.SpanParentID } -// GetEmail returns the Email field if it's non-nil, zero value otherwise. -func (c *Contributor) GetEmail() string { - if c == nil || c.Email == nil { - return "" +// GetTimestamp returns the Timestamp field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetTimestamp() Timestamp { + if c == nil || c.Timestamp == nil { + return Timestamp{} } - return *c.Email + return *c.Timestamp } -// GetEventsURL returns the EventsURL field if it's non-nil, zero value otherwise. -func (c *Contributor) GetEventsURL() string { - if c == nil || c.EventsURL == nil { +// GetTopology returns the Topology field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetTopology() string { + if c == nil || c.Topology == nil { return "" } - return *c.EventsURL + return *c.Topology } -// GetFollowersURL returns the FollowersURL field if it's non-nil, zero value otherwise. -func (c *Contributor) GetFollowersURL() string { - if c == nil || c.FollowersURL == nil { +// GetTraceID returns the TraceID field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsNodeEvent) GetTraceID() string { + if c == nil || c.TraceID == nil { return "" } - return *c.FollowersURL + return *c.TraceID } -// GetFollowingURL returns the FollowingURL field if it's non-nil, zero value otherwise. -func (c *Contributor) GetFollowingURL() string { - if c == nil || c.FollowingURL == nil { +// GetLastRequestID returns the LastRequestID field if it's non-nil, zero value otherwise. +func (c *ConfigApplyEventsOptions) GetLastRequestID() string { + if c == nil || c.LastRequestID == nil { return "" } - return *c.FollowingURL + return *c.LastRequestID } -// GetGistsURL returns the GistsURL field if it's non-nil, zero value otherwise. -func (c *Contributor) GetGistsURL() string { - if c == nil || c.GistsURL == nil { +// GetRunID returns the RunID field if it's non-nil, zero value otherwise. +func (c *ConfigApplyOptions) GetRunID() string { + if c == nil || c.RunID == nil { return "" } - return *c.GistsURL + return *c.RunID } -// GetGravatarID returns the GravatarID field if it's non-nil, zero value otherwise. -func (c *Contributor) GetGravatarID() string { - if c == nil || c.GravatarID == nil { - return "" +// GetRunning returns the Running field if it's non-nil, zero value otherwise. +func (c *ConfigApplyStatus) GetRunning() bool { + if c == nil || c.Running == nil { + return false } - return *c.GravatarID + return *c.Running } -// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. -func (c *Contributor) GetHTMLURL() string { - if c == nil || c.HTMLURL == nil { - return "" +// GetSuccessful returns the Successful field if it's non-nil, zero value otherwise. +func (c *ConfigApplyStatus) GetSuccessful() bool { + if c == nil || c.Successful == nil { + return false } - return *c.HTMLURL + return *c.Successful } -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (c *Contributor) GetID() int64 { - if c == nil || c.ID == nil { - return 0 +// GetHostname returns the Hostname field if it's non-nil, zero value otherwise. +func (c *ConfigApplyStatusNode) GetHostname() string { + if c == nil || c.Hostname == nil { + return "" } - return *c.ID + return *c.Hostname } -// GetLogin returns the Login field if it's non-nil, zero value otherwise. -func (c *Contributor) GetLogin() string { - if c == nil || c.Login == nil { +// GetRunID returns the RunID field if it's non-nil, zero value otherwise. +func (c *ConfigApplyStatusNode) GetRunID() string { + if c == nil || c.RunID == nil { return "" } - return *c.Login + return *c.RunID } -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (c *Contributor) GetName() string { - if c == nil || c.Name == nil { - return "" +// GetRunning returns the Running field if it's non-nil, zero value otherwise. +func (c *ConfigApplyStatusNode) GetRunning() bool { + if c == nil || c.Running == nil { + return false } - return *c.Name + return *c.Running } -// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (c *Contributor) GetNodeID() string { - if c == nil || c.NodeID == nil { - return "" +// GetSuccessful returns the Successful field if it's non-nil, zero value otherwise. +func (c *ConfigApplyStatusNode) GetSuccessful() bool { + if c == nil || c.Successful == nil { + return false } - return *c.NodeID + return *c.Successful } -// GetOrganizationsURL returns the OrganizationsURL field if it's non-nil, zero value otherwise. -func (c *Contributor) GetOrganizationsURL() string { - if c == nil || c.OrganizationsURL == nil { +// GetAdminPassword returns the AdminPassword field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetAdminPassword() string { + if c == nil || c.AdminPassword == nil { return "" } - return *c.OrganizationsURL + return *c.AdminPassword } -// GetReceivedEventsURL returns the ReceivedEventsURL field if it's non-nil, zero value otherwise. -func (c *Contributor) GetReceivedEventsURL() string { - if c == nil || c.ReceivedEventsURL == nil { +// GetAssets returns the Assets field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetAssets() string { + if c == nil || c.Assets == nil { return "" } - return *c.ReceivedEventsURL + return *c.Assets } -// GetReposURL returns the ReposURL field if it's non-nil, zero value otherwise. -func (c *Contributor) GetReposURL() string { - if c == nil || c.ReposURL == nil { +// GetAuthMode returns the AuthMode field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetAuthMode() string { + if c == nil || c.AuthMode == nil { return "" } - return *c.ReposURL + return *c.AuthMode } -// GetSiteAdmin returns the SiteAdmin field if it's non-nil, zero value otherwise. -func (c *Contributor) GetSiteAdmin() bool { - if c == nil || c.SiteAdmin == nil { - return false +// GetAvatar returns the Avatar field. +func (c *ConfigSettings) GetAvatar() *ConfigSettingsAvatar { + if c == nil { + return nil } - return *c.SiteAdmin + return c.Avatar } -// GetStarredURL returns the StarredURL field if it's non-nil, zero value otherwise. -func (c *Contributor) GetStarredURL() string { - if c == nil || c.StarredURL == nil { - return "" +// GetCAS returns the CAS field. +func (c *ConfigSettings) GetCAS() *ConfigSettingsCAS { + if c == nil { + return nil } - return *c.StarredURL + return c.CAS } -// GetSubscriptionsURL returns the SubscriptionsURL field if it's non-nil, zero value otherwise. -func (c *Contributor) GetSubscriptionsURL() string { - if c == nil || c.SubscriptionsURL == nil { - return "" +// GetCollectd returns the Collectd field. +func (c *ConfigSettings) GetCollectd() *ConfigSettingsCollectd { + if c == nil { + return nil } - return *c.SubscriptionsURL + return c.Collectd } -// GetType returns the Type field if it's non-nil, zero value otherwise. -func (c *Contributor) GetType() string { - if c == nil || c.Type == nil { - return "" +// GetConfigurationID returns the ConfigurationID field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetConfigurationID() int64 { + if c == nil || c.ConfigurationID == nil { + return 0 } - return *c.Type + return *c.ConfigurationID } -// GetURL returns the URL field if it's non-nil, zero value otherwise. -func (c *Contributor) GetURL() string { - if c == nil || c.URL == nil { - return "" +// GetConfigurationRunCount returns the ConfigurationRunCount field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetConfigurationRunCount() int { + if c == nil || c.ConfigurationRunCount == nil { + return 0 } - return *c.URL + return *c.ConfigurationRunCount } -// GetAuthor returns the Author field. -func (c *ContributorStats) GetAuthor() *Contributor { +// GetCustomer returns the Customer field. +func (c *ConfigSettings) GetCustomer() *ConfigSettingsCustomer { if c == nil { return nil } - return c.Author + return c.Customer } -// GetTotal returns the Total field if it's non-nil, zero value otherwise. -func (c *ContributorStats) GetTotal() int { - if c == nil || c.Total == nil { - return 0 +// GetExpireSessions returns the ExpireSessions field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetExpireSessions() bool { + if c == nil || c.ExpireSessions == nil { + return false } - return *c.Total + return *c.ExpireSessions } -// GetSeatBreakdown returns the SeatBreakdown field. -func (c *CopilotOrganizationDetails) GetSeatBreakdown() *CopilotSeatBreakdown { - if c == nil { - return nil +// GetGithubHostname returns the GithubHostname field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetGithubHostname() string { + if c == nil || c.GithubHostname == nil { + return "" } - return c.SeatBreakdown + return *c.GithubHostname } -// GetAssigningTeam returns the AssigningTeam field. -func (c *CopilotSeatDetails) GetAssigningTeam() *Team { +// GetGithubOAuth returns the GithubOAuth field. +func (c *ConfigSettings) GetGithubOAuth() *ConfigSettingsGithubOAuth { if c == nil { return nil } - return c.AssigningTeam + return c.GithubOAuth } -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (c *CopilotSeatDetails) GetCreatedAt() Timestamp { - if c == nil || c.CreatedAt == nil { - return Timestamp{} +// GetGithubSSL returns the GithubSSL field. +func (c *ConfigSettings) GetGithubSSL() *ConfigSettingsGithubSSL { + if c == nil { + return nil } - return *c.CreatedAt + return c.GithubSSL } -// GetLastActivityAt returns the LastActivityAt field if it's non-nil, zero value otherwise. -func (c *CopilotSeatDetails) GetLastActivityAt() Timestamp { - if c == nil || c.LastActivityAt == nil { - return Timestamp{} +// GetHTTPProxy returns the HTTPProxy field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetHTTPProxy() string { + if c == nil || c.HTTPProxy == nil { + return "" } - return *c.LastActivityAt + return *c.HTTPProxy } -// GetLastActivityEditor returns the LastActivityEditor field if it's non-nil, zero value otherwise. -func (c *CopilotSeatDetails) GetLastActivityEditor() string { - if c == nil || c.LastActivityEditor == nil { +// GetIdenticonsHost returns the IdenticonsHost field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetIdenticonsHost() string { + if c == nil || c.IdenticonsHost == nil { return "" } - return *c.LastActivityEditor + return *c.IdenticonsHost } -// GetPendingCancellationDate returns the PendingCancellationDate field if it's non-nil, zero value otherwise. -func (c *CopilotSeatDetails) GetPendingCancellationDate() string { - if c == nil || c.PendingCancellationDate == nil { - return "" +// GetLDAP returns the LDAP field. +func (c *ConfigSettings) GetLDAP() *ConfigSettingsLDAP { + if c == nil { + return nil } - return *c.PendingCancellationDate + return c.LDAP } -// GetPlanType returns the PlanType field if it's non-nil, zero value otherwise. -func (c *CopilotSeatDetails) GetPlanType() string { - if c == nil || c.PlanType == nil { +// GetLicense returns the License field. +func (c *ConfigSettings) GetLicense() *ConfigSettingsLicenseSettings { + if c == nil { + return nil + } + return c.License +} + +// GetLoadBalancer returns the LoadBalancer field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetLoadBalancer() string { + if c == nil || c.LoadBalancer == nil { return "" } - return *c.PlanType + return *c.LoadBalancer } -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (c *CopilotSeatDetails) GetUpdatedAt() Timestamp { - if c == nil || c.UpdatedAt == nil { - return Timestamp{} +// GetMapping returns the Mapping field. +func (c *ConfigSettings) GetMapping() *ConfigSettingsMapping { + if c == nil { + return nil } - return *c.UpdatedAt + return c.Mapping } -// GetSince returns the Since field if it's non-nil, zero value otherwise. -func (c *CopilotUsageSummaryListOptions) GetSince() time.Time { - if c == nil || c.Since == nil { - return time.Time{} +// GetNTP returns the NTP field. +func (c *ConfigSettings) GetNTP() *ConfigSettingsNTP { + if c == nil { + return nil } - return *c.Since + return c.NTP } -// GetUntil returns the Until field if it's non-nil, zero value otherwise. -func (c *CopilotUsageSummaryListOptions) GetUntil() time.Time { - if c == nil || c.Until == nil { - return time.Time{} +// GetPages returns the Pages field. +func (c *ConfigSettings) GetPages() *ConfigSettingsPagesSettings { + if c == nil { + return nil } - return *c.Until + return c.Pages } -// GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise. -func (c *CreateCheckRunOptions) GetCompletedAt() Timestamp { - if c == nil || c.CompletedAt == nil { - return Timestamp{} +// GetPrivateMode returns the PrivateMode field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetPrivateMode() bool { + if c == nil || c.PrivateMode == nil { + return false } - return *c.CompletedAt + return *c.PrivateMode } -// GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise. -func (c *CreateCheckRunOptions) GetConclusion() string { - if c == nil || c.Conclusion == nil { - return "" +// GetPublicPages returns the PublicPages field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetPublicPages() bool { + if c == nil || c.PublicPages == nil { + return false } - return *c.Conclusion + return *c.PublicPages } -// GetDetailsURL returns the DetailsURL field if it's non-nil, zero value otherwise. -func (c *CreateCheckRunOptions) GetDetailsURL() string { - if c == nil || c.DetailsURL == nil { - return "" +// GetSAML returns the SAML field. +func (c *ConfigSettings) GetSAML() *ConfigSettingsSAML { + if c == nil { + return nil } - return *c.DetailsURL + return c.SAML } -// GetExternalID returns the ExternalID field if it's non-nil, zero value otherwise. -func (c *CreateCheckRunOptions) GetExternalID() string { - if c == nil || c.ExternalID == nil { - return "" +// GetSignupEnabled returns the SignupEnabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetSignupEnabled() bool { + if c == nil || c.SignupEnabled == nil { + return false } - return *c.ExternalID + return *c.SignupEnabled } -// GetOutput returns the Output field. -func (c *CreateCheckRunOptions) GetOutput() *CheckRunOutput { +// GetSMTP returns the SMTP field. +func (c *ConfigSettings) GetSMTP() *ConfigSettingsSMTP { if c == nil { return nil } - return c.Output + return c.SMTP } -// GetStartedAt returns the StartedAt field if it's non-nil, zero value otherwise. -func (c *CreateCheckRunOptions) GetStartedAt() Timestamp { - if c == nil || c.StartedAt == nil { - return Timestamp{} +// GetSNMP returns the SNMP field. +func (c *ConfigSettings) GetSNMP() *ConfigSettingsSNMP { + if c == nil { + return nil } - return *c.StartedAt + return c.SNMP } -// GetStatus returns the Status field if it's non-nil, zero value otherwise. -func (c *CreateCheckRunOptions) GetStatus() string { - if c == nil || c.Status == nil { - return "" +// GetSubdomainIsolation returns the SubdomainIsolation field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetSubdomainIsolation() bool { + if c == nil || c.SubdomainIsolation == nil { + return false } - return *c.Status + return *c.SubdomainIsolation } -// GetHeadBranch returns the HeadBranch field if it's non-nil, zero value otherwise. -func (c *CreateCheckSuiteOptions) GetHeadBranch() string { - if c == nil || c.HeadBranch == nil { - return "" +// GetSyslog returns the Syslog field. +func (c *ConfigSettings) GetSyslog() *ConfigSettingsSyslog { + if c == nil { + return nil } - return *c.HeadBranch + return c.Syslog } -// GetClientIP returns the ClientIP field if it's non-nil, zero value otherwise. -func (c *CreateCodespaceOptions) GetClientIP() string { - if c == nil || c.ClientIP == nil { +// GetTimezone returns the Timezone field if it's non-nil, zero value otherwise. +func (c *ConfigSettings) GetTimezone() string { + if c == nil || c.Timezone == nil { return "" } - return *c.ClientIP + return *c.Timezone } -// GetDevcontainerPath returns the DevcontainerPath field if it's non-nil, zero value otherwise. -func (c *CreateCodespaceOptions) GetDevcontainerPath() string { - if c == nil || c.DevcontainerPath == nil { - return "" +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsAvatar) GetEnabled() bool { + if c == nil || c.Enabled == nil { + return false } - return *c.DevcontainerPath + return *c.Enabled } -// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. -func (c *CreateCodespaceOptions) GetDisplayName() string { - if c == nil || c.DisplayName == nil { +// GetURI returns the URI field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsAvatar) GetURI() string { + if c == nil || c.URI == nil { return "" } - return *c.DisplayName + return *c.URI } -// GetGeo returns the Geo field if it's non-nil, zero value otherwise. -func (c *CreateCodespaceOptions) GetGeo() string { - if c == nil || c.Geo == nil { +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCAS) GetURL() string { + if c == nil || c.URL == nil { return "" } - return *c.Geo + return *c.URL } -// GetIdleTimeoutMinutes returns the IdleTimeoutMinutes field if it's non-nil, zero value otherwise. -func (c *CreateCodespaceOptions) GetIdleTimeoutMinutes() int { - if c == nil || c.IdleTimeoutMinutes == nil { - return 0 +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCollectd) GetEnabled() bool { + if c == nil || c.Enabled == nil { + return false } - return *c.IdleTimeoutMinutes + return *c.Enabled } -// GetMachine returns the Machine field if it's non-nil, zero value otherwise. -func (c *CreateCodespaceOptions) GetMachine() string { - if c == nil || c.Machine == nil { +// GetEncryption returns the Encryption field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCollectd) GetEncryption() string { + if c == nil || c.Encryption == nil { return "" } - return *c.Machine + return *c.Encryption } -// GetMultiRepoPermissionsOptOut returns the MultiRepoPermissionsOptOut field if it's non-nil, zero value otherwise. -func (c *CreateCodespaceOptions) GetMultiRepoPermissionsOptOut() bool { - if c == nil || c.MultiRepoPermissionsOptOut == nil { - return false +// GetPassword returns the Password field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCollectd) GetPassword() string { + if c == nil || c.Password == nil { + return "" } - return *c.MultiRepoPermissionsOptOut + return *c.Password } -// GetRef returns the Ref field if it's non-nil, zero value otherwise. -func (c *CreateCodespaceOptions) GetRef() string { - if c == nil || c.Ref == nil { - return "" +// GetPort returns the Port field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCollectd) GetPort() int { + if c == nil || c.Port == nil { + return 0 } - return *c.Ref + return *c.Port } -// GetRetentionPeriodMinutes returns the RetentionPeriodMinutes field if it's non-nil, zero value otherwise. -func (c *CreateCodespaceOptions) GetRetentionPeriodMinutes() int { - if c == nil || c.RetentionPeriodMinutes == nil { - return 0 +// GetServer returns the Server field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCollectd) GetServer() string { + if c == nil || c.Server == nil { + return "" } - return *c.RetentionPeriodMinutes + return *c.Server } -// GetWorkingDirectory returns the WorkingDirectory field if it's non-nil, zero value otherwise. -func (c *CreateCodespaceOptions) GetWorkingDirectory() string { - if c == nil || c.WorkingDirectory == nil { +// GetUsername returns the Username field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCollectd) GetUsername() string { + if c == nil || c.Username == nil { return "" } - return *c.WorkingDirectory + return *c.Username } -// GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. -func (c *CreateEnterpriseRunnerGroupRequest) GetAllowsPublicRepositories() bool { - if c == nil || c.AllowsPublicRepositories == nil { - return false +// GetEmail returns the Email field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCustomer) GetEmail() string { + if c == nil || c.Email == nil { + return "" } - return *c.AllowsPublicRepositories + return *c.Email } // GetName returns the Name field if it's non-nil, zero value otherwise. -func (c *CreateEnterpriseRunnerGroupRequest) GetName() string { +func (c *ConfigSettingsCustomer) GetName() string { if c == nil || c.Name == nil { return "" } return *c.Name } -// GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise. -func (c *CreateEnterpriseRunnerGroupRequest) GetRestrictedToWorkflows() bool { - if c == nil || c.RestrictedToWorkflows == nil { - return false +// GetPublicKeyData returns the PublicKeyData field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCustomer) GetPublicKeyData() string { + if c == nil || c.PublicKeyData == nil { + return "" } - return *c.RestrictedToWorkflows + return *c.PublicKeyData } -// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. -func (c *CreateEnterpriseRunnerGroupRequest) GetVisibility() string { - if c == nil || c.Visibility == nil { +// GetSecret returns the Secret field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCustomer) GetSecret() string { + if c == nil || c.Secret == nil { return "" } - return *c.Visibility + return *c.Secret } -// GetDescription returns the Description field if it's non-nil, zero value otherwise. -func (c *CreateEvent) GetDescription() string { - if c == nil || c.Description == nil { +// GetUUID returns the UUID field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsCustomer) GetUUID() string { + if c == nil || c.UUID == nil { return "" } - return *c.Description + return *c.UUID } -// GetInstallation returns the Installation field. -func (c *CreateEvent) GetInstallation() *Installation { - if c == nil { - return nil +// GetClientID returns the ClientID field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsGithubOAuth) GetClientID() string { + if c == nil || c.ClientID == nil { + return "" } - return c.Installation + return *c.ClientID } -// GetMasterBranch returns the MasterBranch field if it's non-nil, zero value otherwise. -func (c *CreateEvent) GetMasterBranch() string { - if c == nil || c.MasterBranch == nil { +// GetClientSecret returns the ClientSecret field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsGithubOAuth) GetClientSecret() string { + if c == nil || c.ClientSecret == nil { return "" } - return *c.MasterBranch + return *c.ClientSecret } -// GetOrg returns the Org field. -func (c *CreateEvent) GetOrg() *Organization { - if c == nil { - return nil +// GetOrganizationName returns the OrganizationName field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsGithubOAuth) GetOrganizationName() string { + if c == nil || c.OrganizationName == nil { + return "" } - return c.Org + return *c.OrganizationName } -// GetPusherType returns the PusherType field if it's non-nil, zero value otherwise. -func (c *CreateEvent) GetPusherType() string { - if c == nil || c.PusherType == nil { +// GetOrganizationTeam returns the OrganizationTeam field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsGithubOAuth) GetOrganizationTeam() string { + if c == nil || c.OrganizationTeam == nil { return "" } - return *c.PusherType + return *c.OrganizationTeam } -// GetRef returns the Ref field if it's non-nil, zero value otherwise. -func (c *CreateEvent) GetRef() string { - if c == nil || c.Ref == nil { +// GetCert returns the Cert field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsGithubSSL) GetCert() string { + if c == nil || c.Cert == nil { return "" } - return *c.Ref + return *c.Cert } -// GetRefType returns the RefType field if it's non-nil, zero value otherwise. -func (c *CreateEvent) GetRefType() string { - if c == nil || c.RefType == nil { - return "" +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsGithubSSL) GetEnabled() bool { + if c == nil || c.Enabled == nil { + return false } - return *c.RefType + return *c.Enabled } -// GetRepo returns the Repo field. -func (c *CreateEvent) GetRepo() *Repository { - if c == nil { - return nil +// GetKey returns the Key field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsGithubSSL) GetKey() string { + if c == nil || c.Key == nil { + return "" } - return c.Repo + return *c.Key } -// GetSender returns the Sender field. -func (c *CreateEvent) GetSender() *User { - if c == nil { - return nil +// GetAdminGroup returns the AdminGroup field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetAdminGroup() string { + if c == nil || c.AdminGroup == nil { + return "" } - return c.Sender + return *c.AdminGroup } -// GetEmail returns the Email field if it's non-nil, zero value otherwise. -func (c *CreateOrgInvitationOptions) GetEmail() string { - if c == nil || c.Email == nil { +// GetBindDN returns the BindDN field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetBindDN() string { + if c == nil || c.BindDN == nil { return "" } - return *c.Email + return *c.BindDN } -// GetInviteeID returns the InviteeID field if it's non-nil, zero value otherwise. -func (c *CreateOrgInvitationOptions) GetInviteeID() int64 { - if c == nil || c.InviteeID == nil { - return 0 +// GetHost returns the Host field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetHost() string { + if c == nil || c.Host == nil { + return "" } - return *c.InviteeID + return *c.Host } -// GetRole returns the Role field if it's non-nil, zero value otherwise. -func (c *CreateOrgInvitationOptions) GetRole() string { - if c == nil || c.Role == nil { +// GetMethod returns the Method field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetMethod() string { + if c == nil || c.Method == nil { return "" } - return *c.Role + return *c.Method } -// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. -func (c *CreateOrUpdateCustomRepoRoleOptions) GetBaseRole() string { - if c == nil || c.BaseRole == nil { +// GetPassword returns the Password field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetPassword() string { + if c == nil || c.Password == nil { return "" } - return *c.BaseRole + return *c.Password } -// GetDescription returns the Description field if it's non-nil, zero value otherwise. -func (c *CreateOrUpdateCustomRepoRoleOptions) GetDescription() string { - if c == nil || c.Description == nil { - return "" +// GetPort returns the Port field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetPort() int { + if c == nil || c.Port == nil { + return 0 } - return *c.Description + return *c.Port } -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (c *CreateOrUpdateCustomRepoRoleOptions) GetName() string { - if c == nil || c.Name == nil { - return "" +// GetPosixSupport returns the PosixSupport field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetPosixSupport() bool { + if c == nil || c.PosixSupport == nil { + return false } - return *c.Name + return *c.PosixSupport } -// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. -func (c *CreateOrUpdateOrgRoleOptions) GetBaseRole() string { - if c == nil || c.BaseRole == nil { - return "" +// GetProfile returns the Profile field. +func (c *ConfigSettingsLDAP) GetProfile() *ConfigSettingsLDAPProfile { + if c == nil { + return nil } - return *c.BaseRole + return c.Profile } -// GetDescription returns the Description field if it's non-nil, zero value otherwise. -func (c *CreateOrUpdateOrgRoleOptions) GetDescription() string { - if c == nil || c.Description == nil { - return "" +// GetReconciliation returns the Reconciliation field. +func (c *ConfigSettingsLDAP) GetReconciliation() *ConfigSettingsLDAPReconciliation { + if c == nil { + return nil } - return *c.Description + return c.Reconciliation } -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (c *CreateOrUpdateOrgRoleOptions) GetName() string { - if c == nil || c.Name == nil { +// GetRecursiveGroupSearch returns the RecursiveGroupSearch field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetRecursiveGroupSearch() bool { + if c == nil || c.RecursiveGroupSearch == nil { + return false + } + return *c.RecursiveGroupSearch +} + +// GetSearchStrategy returns the SearchStrategy field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetSearchStrategy() string { + if c == nil || c.SearchStrategy == nil { return "" } - return *c.Name + return *c.SearchStrategy } -// GetFrom returns the From field if it's non-nil, zero value otherwise. -func (c *CreateProtectedChanges) GetFrom() bool { - if c == nil || c.From == nil { +// GetSyncEnabled returns the SyncEnabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetSyncEnabled() bool { + if c == nil || c.SyncEnabled == nil { return false } - return *c.From + return *c.SyncEnabled } -// GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. -func (c *CreateRunnerGroupRequest) GetAllowsPublicRepositories() bool { - if c == nil || c.AllowsPublicRepositories == nil { - return false +// GetTeamSyncInterval returns the TeamSyncInterval field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetTeamSyncInterval() int { + if c == nil || c.TeamSyncInterval == nil { + return 0 } - return *c.AllowsPublicRepositories + return *c.TeamSyncInterval } -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (c *CreateRunnerGroupRequest) GetName() string { - if c == nil || c.Name == nil { +// GetUID returns the UID field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetUID() string { + if c == nil || c.UID == nil { return "" } - return *c.Name + return *c.UID } -// GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise. -func (c *CreateRunnerGroupRequest) GetRestrictedToWorkflows() bool { - if c == nil || c.RestrictedToWorkflows == nil { +// GetUserSyncEmails returns the UserSyncEmails field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetUserSyncEmails() bool { + if c == nil || c.UserSyncEmails == nil { return false } - return *c.RestrictedToWorkflows + return *c.UserSyncEmails } -// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. -func (c *CreateRunnerGroupRequest) GetVisibility() string { - if c == nil || c.Visibility == nil { - return "" +// GetUserSyncInterval returns the UserSyncInterval field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetUserSyncInterval() int { + if c == nil || c.UserSyncInterval == nil { + return 0 } - return *c.Visibility + return *c.UserSyncInterval } -// GetCanAdminsBypass returns the CanAdminsBypass field if it's non-nil, zero value otherwise. -func (c *CreateUpdateEnvironment) GetCanAdminsBypass() bool { - if c == nil || c.CanAdminsBypass == nil { +// GetUserSyncKeys returns the UserSyncKeys field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetUserSyncKeys() bool { + if c == nil || c.UserSyncKeys == nil { return false } - return *c.CanAdminsBypass -} - -// GetDeploymentBranchPolicy returns the DeploymentBranchPolicy field. -func (c *CreateUpdateEnvironment) GetDeploymentBranchPolicy() *BranchPolicy { - if c == nil { - return nil - } - return c.DeploymentBranchPolicy + return *c.UserSyncKeys } -// GetPreventSelfReview returns the PreventSelfReview field if it's non-nil, zero value otherwise. -func (c *CreateUpdateEnvironment) GetPreventSelfReview() bool { - if c == nil || c.PreventSelfReview == nil { +// GetVirtualAttributeEnabled returns the VirtualAttributeEnabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAP) GetVirtualAttributeEnabled() bool { + if c == nil || c.VirtualAttributeEnabled == nil { return false } - return *c.PreventSelfReview + return *c.VirtualAttributeEnabled } -// GetWaitTimer returns the WaitTimer field if it's non-nil, zero value otherwise. -func (c *CreateUpdateEnvironment) GetWaitTimer() int { - if c == nil || c.WaitTimer == nil { - return 0 +// GetKey returns the Key field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAPProfile) GetKey() string { + if c == nil || c.Key == nil { + return "" } - return *c.WaitTimer + return *c.Key } -// GetRepositoryID returns the RepositoryID field if it's non-nil, zero value otherwise. -func (c *CreateUpdateRequiredWorkflowOptions) GetRepositoryID() int64 { - if c == nil || c.RepositoryID == nil { - return 0 +// GetMail returns the Mail field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAPProfile) GetMail() string { + if c == nil || c.Mail == nil { + return "" } - return *c.RepositoryID + return *c.Mail } -// GetScope returns the Scope field if it's non-nil, zero value otherwise. -func (c *CreateUpdateRequiredWorkflowOptions) GetScope() string { - if c == nil || c.Scope == nil { +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAPProfile) GetName() string { + if c == nil || c.Name == nil { return "" } - return *c.Scope + return *c.Name } -// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs field. -func (c *CreateUpdateRequiredWorkflowOptions) GetSelectedRepositoryIDs() *SelectedRepoIDs { - if c == nil { - return nil +// GetUID returns the UID field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAPProfile) GetUID() string { + if c == nil || c.UID == nil { + return "" } - return c.SelectedRepositoryIDs + return *c.UID } -// GetWorkflowFilePath returns the WorkflowFilePath field if it's non-nil, zero value otherwise. -func (c *CreateUpdateRequiredWorkflowOptions) GetWorkflowFilePath() string { - if c == nil || c.WorkflowFilePath == nil { +// GetOrg returns the Org field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAPReconciliation) GetOrg() string { + if c == nil || c.Org == nil { return "" } - return *c.WorkflowFilePath + return *c.Org } -// GetBody returns the Body field if it's non-nil, zero value otherwise. -func (c *CreateUserProjectOptions) GetBody() string { - if c == nil || c.Body == nil { +// GetUser returns the User field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLDAPReconciliation) GetUser() string { + if c == nil || c.User == nil { return "" } - return *c.Body + return *c.User } -// GetEmail returns the Email field if it's non-nil, zero value otherwise. -func (c *CreateUserRequest) GetEmail() string { - if c == nil || c.Email == nil { - return "" +// GetClusterSupport returns the ClusterSupport field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLicenseSettings) GetClusterSupport() bool { + if c == nil || c.ClusterSupport == nil { + return false } - return *c.Email + return *c.ClusterSupport } -// GetSuspended returns the Suspended field if it's non-nil, zero value otherwise. -func (c *CreateUserRequest) GetSuspended() bool { - if c == nil || c.Suspended == nil { +// GetEvaluation returns the Evaluation field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLicenseSettings) GetEvaluation() bool { + if c == nil || c.Evaluation == nil { return false } - return *c.Suspended + return *c.Evaluation } -// GetCreated returns the Created field if it's non-nil, zero value otherwise. -func (c *CreationInfo) GetCreated() Timestamp { - if c == nil || c.Created == nil { +// GetExpireAt returns the ExpireAt field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLicenseSettings) GetExpireAt() Timestamp { + if c == nil || c.ExpireAt == nil { return Timestamp{} } - return *c.Created + return *c.ExpireAt } -// GetAuthorizedCredentialExpiresAt returns the AuthorizedCredentialExpiresAt field if it's non-nil, zero value otherwise. -func (c *CredentialAuthorization) GetAuthorizedCredentialExpiresAt() Timestamp { - if c == nil || c.AuthorizedCredentialExpiresAt == nil { - return Timestamp{} +// GetPerpetual returns the Perpetual field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLicenseSettings) GetPerpetual() bool { + if c == nil || c.Perpetual == nil { + return false } - return *c.AuthorizedCredentialExpiresAt + return *c.Perpetual } -// GetAuthorizedCredentialID returns the AuthorizedCredentialID field if it's non-nil, zero value otherwise. -func (c *CredentialAuthorization) GetAuthorizedCredentialID() int64 { - if c == nil || c.AuthorizedCredentialID == nil { +// GetSeats returns the Seats field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLicenseSettings) GetSeats() int { + if c == nil || c.Seats == nil { return 0 } - return *c.AuthorizedCredentialID + return *c.Seats } -// GetAuthorizedCredentialNote returns the AuthorizedCredentialNote field if it's non-nil, zero value otherwise. -func (c *CredentialAuthorization) GetAuthorizedCredentialNote() string { - if c == nil || c.AuthorizedCredentialNote == nil { - return "" +// GetSSHAllowed returns the SSHAllowed field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLicenseSettings) GetSSHAllowed() bool { + if c == nil || c.SSHAllowed == nil { + return false } - return *c.AuthorizedCredentialNote + return *c.SSHAllowed } -// GetAuthorizedCredentialTitle returns the AuthorizedCredentialTitle field if it's non-nil, zero value otherwise. -func (c *CredentialAuthorization) GetAuthorizedCredentialTitle() string { - if c == nil || c.AuthorizedCredentialTitle == nil { +// GetSupportKey returns the SupportKey field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLicenseSettings) GetSupportKey() string { + if c == nil || c.SupportKey == nil { return "" } - return *c.AuthorizedCredentialTitle + return *c.SupportKey } -// GetCredentialAccessedAt returns the CredentialAccessedAt field if it's non-nil, zero value otherwise. -func (c *CredentialAuthorization) GetCredentialAccessedAt() Timestamp { - if c == nil || c.CredentialAccessedAt == nil { - return Timestamp{} +// GetUnlimitedSeating returns the UnlimitedSeating field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsLicenseSettings) GetUnlimitedSeating() bool { + if c == nil || c.UnlimitedSeating == nil { + return false } - return *c.CredentialAccessedAt + return *c.UnlimitedSeating } -// GetCredentialAuthorizedAt returns the CredentialAuthorizedAt field if it's non-nil, zero value otherwise. -func (c *CredentialAuthorization) GetCredentialAuthorizedAt() Timestamp { - if c == nil || c.CredentialAuthorizedAt == nil { - return Timestamp{} +// GetBasemap returns the Basemap field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsMapping) GetBasemap() string { + if c == nil || c.Basemap == nil { + return "" } - return *c.CredentialAuthorizedAt + return *c.Basemap } -// GetCredentialID returns the CredentialID field if it's non-nil, zero value otherwise. -func (c *CredentialAuthorization) GetCredentialID() int64 { - if c == nil || c.CredentialID == nil { - return 0 +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsMapping) GetEnabled() bool { + if c == nil || c.Enabled == nil { + return false } - return *c.CredentialID + return *c.Enabled } -// GetCredentialType returns the CredentialType field if it's non-nil, zero value otherwise. -func (c *CredentialAuthorization) GetCredentialType() string { - if c == nil || c.CredentialType == nil { +// GetTileserver returns the Tileserver field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsMapping) GetTileserver() string { + if c == nil || c.Tileserver == nil { return "" } - return *c.CredentialType + return *c.Tileserver } -// GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise. -func (c *CredentialAuthorization) GetFingerprint() string { - if c == nil || c.Fingerprint == nil { +// GetToken returns the Token field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsMapping) GetToken() string { + if c == nil || c.Token == nil { return "" } - return *c.Fingerprint + return *c.Token } -// GetLogin returns the Login field if it's non-nil, zero value otherwise. -func (c *CredentialAuthorization) GetLogin() string { - if c == nil || c.Login == nil { +// GetPrimaryServer returns the PrimaryServer field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsNTP) GetPrimaryServer() string { + if c == nil || c.PrimaryServer == nil { return "" } - return *c.Login + return *c.PrimaryServer } -// GetTokenLastEight returns the TokenLastEight field if it's non-nil, zero value otherwise. -func (c *CredentialAuthorization) GetTokenLastEight() string { - if c == nil || c.TokenLastEight == nil { +// GetSecondaryServer returns the SecondaryServer field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsNTP) GetSecondaryServer() string { + if c == nil || c.SecondaryServer == nil { return "" } - return *c.TokenLastEight + return *c.SecondaryServer } -// GetType returns the Type field if it's non-nil, zero value otherwise. -func (c *Credit) GetType() string { - if c == nil || c.Type == nil { - return "" +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsPagesSettings) GetEnabled() bool { + if c == nil || c.Enabled == nil { + return false } - return *c.Type + return *c.Enabled } -// GetUser returns the User field. -func (c *Credit) GetUser() *User { - if c == nil { - return nil +// GetCertificate returns the Certificate field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSAML) GetCertificate() string { + if c == nil || c.Certificate == nil { + return "" } - return c.User + return *c.Certificate } -// GetApp returns the App field. -func (c *CustomDeploymentProtectionRule) GetApp() *CustomDeploymentProtectionRuleApp { - if c == nil { - return nil +// GetCertificatePath returns the CertificatePath field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSAML) GetCertificatePath() string { + if c == nil || c.CertificatePath == nil { + return "" } - return c.App + return *c.CertificatePath } -// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. -func (c *CustomDeploymentProtectionRule) GetEnabled() bool { - if c == nil || c.Enabled == nil { +// GetDisableAdminDemote returns the DisableAdminDemote field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSAML) GetDisableAdminDemote() bool { + if c == nil || c.DisableAdminDemote == nil { return false } - return *c.Enabled + return *c.DisableAdminDemote } -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (c *CustomDeploymentProtectionRule) GetID() int64 { - if c == nil || c.ID == nil { - return 0 +// GetIDPInitiatedSSO returns the IDPInitiatedSSO field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSAML) GetIDPInitiatedSSO() bool { + if c == nil || c.IDPInitiatedSSO == nil { + return false } - return *c.ID + return *c.IDPInitiatedSSO } -// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (c *CustomDeploymentProtectionRule) GetNodeID() string { - if c == nil || c.NodeID == nil { +// GetIssuer returns the Issuer field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSAML) GetIssuer() string { + if c == nil || c.Issuer == nil { return "" } - return *c.NodeID + return *c.Issuer } -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (c *CustomDeploymentProtectionRuleApp) GetID() int64 { - if c == nil || c.ID == nil { - return 0 +// GetSSOURL returns the SSOURL field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSAML) GetSSOURL() string { + if c == nil || c.SSOURL == nil { + return "" } - return *c.ID + return *c.SSOURL } -// GetIntegrationURL returns the IntegrationURL field if it's non-nil, zero value otherwise. -func (c *CustomDeploymentProtectionRuleApp) GetIntegrationURL() string { - if c == nil || c.IntegrationURL == nil { +// GetAddress returns the Address field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetAddress() string { + if c == nil || c.Address == nil { return "" } - return *c.IntegrationURL + return *c.Address } -// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (c *CustomDeploymentProtectionRuleApp) GetNodeID() string { - if c == nil || c.NodeID == nil { +// GetAuthentication returns the Authentication field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetAuthentication() string { + if c == nil || c.Authentication == nil { return "" } - return *c.NodeID + return *c.Authentication } -// GetSlug returns the Slug field if it's non-nil, zero value otherwise. -func (c *CustomDeploymentProtectionRuleApp) GetSlug() string { - if c == nil || c.Slug == nil { +// GetDiscardToNoreplyAddress returns the DiscardToNoreplyAddress field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetDiscardToNoreplyAddress() bool { + if c == nil || c.DiscardToNoreplyAddress == nil { + return false + } + return *c.DiscardToNoreplyAddress +} + +// GetDomain returns the Domain field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetDomain() string { + if c == nil || c.Domain == nil { return "" } - return *c.Slug + return *c.Domain } -// GetIntegrationID returns the IntegrationID field if it's non-nil, zero value otherwise. -func (c *CustomDeploymentProtectionRuleRequest) GetIntegrationID() int64 { - if c == nil || c.IntegrationID == nil { - return 0 +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetEnabled() bool { + if c == nil || c.Enabled == nil { + return false } - return *c.IntegrationID + return *c.Enabled } -// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. -func (c *CustomOrgRoles) GetBaseRole() string { - if c == nil || c.BaseRole == nil { - return "" +// GetEnableStarttlsAuto returns the EnableStarttlsAuto field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetEnableStarttlsAuto() bool { + if c == nil || c.EnableStarttlsAuto == nil { + return false } - return *c.BaseRole + return *c.EnableStarttlsAuto } -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (c *CustomOrgRoles) GetCreatedAt() Timestamp { - if c == nil || c.CreatedAt == nil { - return Timestamp{} +// GetNoreplyAddress returns the NoreplyAddress field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetNoreplyAddress() string { + if c == nil || c.NoreplyAddress == nil { + return "" } - return *c.CreatedAt + return *c.NoreplyAddress } -// GetDescription returns the Description field if it's non-nil, zero value otherwise. -func (c *CustomOrgRoles) GetDescription() string { - if c == nil || c.Description == nil { +// GetPassword returns the Password field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetPassword() string { + if c == nil || c.Password == nil { return "" } - return *c.Description + return *c.Password } -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (c *CustomOrgRoles) GetID() int64 { - if c == nil || c.ID == nil { - return 0 - } - return *c.ID -} - -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (c *CustomOrgRoles) GetName() string { - if c == nil || c.Name == nil { +// GetPort returns the Port field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetPort() string { + if c == nil || c.Port == nil { return "" } - return *c.Name + return *c.Port } -// GetOrg returns the Org field. -func (c *CustomOrgRoles) GetOrg() *Organization { - if c == nil { - return nil +// GetSupportAddress returns the SupportAddress field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetSupportAddress() string { + if c == nil || c.SupportAddress == nil { + return "" } - return c.Org + return *c.SupportAddress } -// GetSource returns the Source field if it's non-nil, zero value otherwise. -func (c *CustomOrgRoles) GetSource() string { - if c == nil || c.Source == nil { +// GetSupportAddressType returns the SupportAddressType field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetSupportAddressType() string { + if c == nil || c.SupportAddressType == nil { return "" } - return *c.Source + return *c.SupportAddressType } -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (c *CustomOrgRoles) GetUpdatedAt() Timestamp { - if c == nil || c.UpdatedAt == nil { - return Timestamp{} +// GetUsername returns the Username field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetUsername() string { + if c == nil || c.Username == nil { + return "" } - return *c.UpdatedAt + return *c.Username } -// GetDefaultValue returns the DefaultValue field if it's non-nil, zero value otherwise. -func (c *CustomProperty) GetDefaultValue() string { - if c == nil || c.DefaultValue == nil { +// GetUserName returns the UserName field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSMTP) GetUserName() string { + if c == nil || c.UserName == nil { return "" } - return *c.DefaultValue + return *c.UserName } -// GetDescription returns the Description field if it's non-nil, zero value otherwise. -func (c *CustomProperty) GetDescription() string { - if c == nil || c.Description == nil { +// GetCommunity returns the Community field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSNMP) GetCommunity() string { + if c == nil || c.Community == nil { return "" } - return *c.Description + return *c.Community } -// GetPropertyName returns the PropertyName field if it's non-nil, zero value otherwise. -func (c *CustomProperty) GetPropertyName() string { - if c == nil || c.PropertyName == nil { - return "" +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSNMP) GetEnabled() bool { + if c == nil || c.Enabled == nil { + return false } - return *c.PropertyName + return *c.Enabled } -// GetRequired returns the Required field if it's non-nil, zero value otherwise. -func (c *CustomProperty) GetRequired() bool { - if c == nil || c.Required == nil { +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSyslog) GetEnabled() bool { + if c == nil || c.Enabled == nil { return false } - return *c.Required + return *c.Enabled } -// GetValuesEditableBy returns the ValuesEditableBy field if it's non-nil, zero value otherwise. -func (c *CustomProperty) GetValuesEditableBy() string { - if c == nil || c.ValuesEditableBy == nil { +// GetProtocolName returns the ProtocolName field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSyslog) GetProtocolName() string { + if c == nil || c.ProtocolName == nil { return "" } - return *c.ValuesEditableBy + return *c.ProtocolName } -// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. -func (c *CustomRepoRoles) GetBaseRole() string { - if c == nil || c.BaseRole == nil { +// GetServer returns the Server field if it's non-nil, zero value otherwise. +func (c *ConfigSettingsSyslog) GetServer() string { + if c == nil || c.Server == nil { return "" } - return *c.BaseRole + return *c.Server } -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (c *CustomRepoRoles) GetCreatedAt() Timestamp { - if c == nil || c.CreatedAt == nil { - return Timestamp{} +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *ConnectionServiceItem) GetName() string { + if c == nil || c.Name == nil { + return "" } - return *c.CreatedAt + return *c.Name } -// GetDescription returns the Description field if it's non-nil, zero value otherwise. -func (c *CustomRepoRoles) GetDescription() string { - if c == nil || c.Description == nil { - return "" +// GetNumber returns the Number field if it's non-nil, zero value otherwise. +func (c *ConnectionServiceItem) GetNumber() int { + if c == nil || c.Number == nil { + return 0 } - return *c.Description + return *c.Number } // GetID returns the ID field if it's non-nil, zero value otherwise. -func (c *CustomRepoRoles) GetID() int64 { +func (c *ContentReference) GetID() int64 { if c == nil || c.ID == nil { return 0 } return *c.ID } -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (c *CustomRepoRoles) GetName() string { - if c == nil || c.Name == nil { +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (c *ContentReference) GetNodeID() string { + if c == nil || c.NodeID == nil { return "" } - return *c.Name + return *c.NodeID } -// GetOrg returns the Org field. -func (c *CustomRepoRoles) GetOrg() *Organization { - if c == nil { - return nil +// GetReference returns the Reference field if it's non-nil, zero value otherwise. +func (c *ContentReference) GetReference() string { + if c == nil || c.Reference == nil { + return "" } - return c.Org + return *c.Reference } -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (c *CustomRepoRoles) GetUpdatedAt() Timestamp { - if c == nil || c.UpdatedAt == nil { - return Timestamp{} +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (c *ContentReferenceEvent) GetAction() string { + if c == nil || c.Action == nil { + return "" } - return *c.UpdatedAt + return *c.Action } -// GetQuerySuite returns the QuerySuite field if it's non-nil, zero value otherwise. -func (d *DefaultSetupConfiguration) GetQuerySuite() string { - if d == nil || d.QuerySuite == nil { - return "" +// GetContentReference returns the ContentReference field. +func (c *ContentReferenceEvent) GetContentReference() *ContentReference { + if c == nil { + return nil } - return *d.QuerySuite + return c.ContentReference } -// GetState returns the State field if it's non-nil, zero value otherwise. -func (d *DefaultSetupConfiguration) GetState() string { - if d == nil || d.State == nil { - return "" +// GetInstallation returns the Installation field. +func (c *ContentReferenceEvent) GetInstallation() *Installation { + if c == nil { + return nil } - return *d.State + return c.Installation } -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (d *DefaultSetupConfiguration) GetUpdatedAt() Timestamp { - if d == nil || d.UpdatedAt == nil { - return Timestamp{} +// GetRepo returns the Repo field. +func (c *ContentReferenceEvent) GetRepo() *Repository { + if c == nil { + return nil } - return *d.UpdatedAt + return c.Repo } -// GetCanApprovePullRequestReviews returns the CanApprovePullRequestReviews field if it's non-nil, zero value otherwise. -func (d *DefaultWorkflowPermissionEnterprise) GetCanApprovePullRequestReviews() bool { - if d == nil || d.CanApprovePullRequestReviews == nil { - return false +// GetSender returns the Sender field. +func (c *ContentReferenceEvent) GetSender() *User { + if c == nil { + return nil } - return *d.CanApprovePullRequestReviews + return c.Sender } -// GetDefaultWorkflowPermissions returns the DefaultWorkflowPermissions field if it's non-nil, zero value otherwise. -func (d *DefaultWorkflowPermissionEnterprise) GetDefaultWorkflowPermissions() string { - if d == nil || d.DefaultWorkflowPermissions == nil { +// GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise. +func (c *Contributor) GetAvatarURL() string { + if c == nil || c.AvatarURL == nil { return "" } - return *d.DefaultWorkflowPermissions + return *c.AvatarURL } -// GetCanApprovePullRequestReviews returns the CanApprovePullRequestReviews field if it's non-nil, zero value otherwise. -func (d *DefaultWorkflowPermissionOrganization) GetCanApprovePullRequestReviews() bool { - if d == nil || d.CanApprovePullRequestReviews == nil { - return false +// GetContributions returns the Contributions field if it's non-nil, zero value otherwise. +func (c *Contributor) GetContributions() int { + if c == nil || c.Contributions == nil { + return 0 } - return *d.CanApprovePullRequestReviews + return *c.Contributions } -// GetDefaultWorkflowPermissions returns the DefaultWorkflowPermissions field if it's non-nil, zero value otherwise. -func (d *DefaultWorkflowPermissionOrganization) GetDefaultWorkflowPermissions() string { - if d == nil || d.DefaultWorkflowPermissions == nil { +// GetEmail returns the Email field if it's non-nil, zero value otherwise. +func (c *Contributor) GetEmail() string { + if c == nil || c.Email == nil { return "" } - return *d.DefaultWorkflowPermissions + return *c.Email } -// GetCanApprovePullRequestReviews returns the CanApprovePullRequestReviews field if it's non-nil, zero value otherwise. -func (d *DefaultWorkflowPermissionRepository) GetCanApprovePullRequestReviews() bool { - if d == nil || d.CanApprovePullRequestReviews == nil { - return false +// GetEventsURL returns the EventsURL field if it's non-nil, zero value otherwise. +func (c *Contributor) GetEventsURL() string { + if c == nil || c.EventsURL == nil { + return "" } - return *d.CanApprovePullRequestReviews + return *c.EventsURL } -// GetDefaultWorkflowPermissions returns the DefaultWorkflowPermissions field if it's non-nil, zero value otherwise. -func (d *DefaultWorkflowPermissionRepository) GetDefaultWorkflowPermissions() string { - if d == nil || d.DefaultWorkflowPermissions == nil { +// GetFollowersURL returns the FollowersURL field if it's non-nil, zero value otherwise. +func (c *Contributor) GetFollowersURL() string { + if c == nil || c.FollowersURL == nil { return "" } - return *d.DefaultWorkflowPermissions + return *c.FollowersURL } -// GetConfirmDeleteURL returns the ConfirmDeleteURL field if it's non-nil, zero value otherwise. -func (d *DeleteAnalysis) GetConfirmDeleteURL() string { - if d == nil || d.ConfirmDeleteURL == nil { +// GetFollowingURL returns the FollowingURL field if it's non-nil, zero value otherwise. +func (c *Contributor) GetFollowingURL() string { + if c == nil || c.FollowingURL == nil { return "" } - return *d.ConfirmDeleteURL + return *c.FollowingURL } -// GetNextAnalysisURL returns the NextAnalysisURL field if it's non-nil, zero value otherwise. -func (d *DeleteAnalysis) GetNextAnalysisURL() string { - if d == nil || d.NextAnalysisURL == nil { +// GetGistsURL returns the GistsURL field if it's non-nil, zero value otherwise. +func (c *Contributor) GetGistsURL() string { + if c == nil || c.GistsURL == nil { return "" } - return *d.NextAnalysisURL + return *c.GistsURL } -// GetInstallation returns the Installation field. -func (d *DeleteEvent) GetInstallation() *Installation { - if d == nil { - return nil +// GetGravatarID returns the GravatarID field if it's non-nil, zero value otherwise. +func (c *Contributor) GetGravatarID() string { + if c == nil || c.GravatarID == nil { + return "" } - return d.Installation + return *c.GravatarID } -// GetOrg returns the Org field. -func (d *DeleteEvent) GetOrg() *Organization { - if d == nil { - return nil +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (c *Contributor) GetHTMLURL() string { + if c == nil || c.HTMLURL == nil { + return "" } - return d.Org + return *c.HTMLURL } -// GetPusherType returns the PusherType field if it's non-nil, zero value otherwise. -func (d *DeleteEvent) GetPusherType() string { - if d == nil || d.PusherType == nil { - return "" +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (c *Contributor) GetID() int64 { + if c == nil || c.ID == nil { + return 0 } - return *d.PusherType + return *c.ID } -// GetRef returns the Ref field if it's non-nil, zero value otherwise. -func (d *DeleteEvent) GetRef() string { - if d == nil || d.Ref == nil { +// GetLogin returns the Login field if it's non-nil, zero value otherwise. +func (c *Contributor) GetLogin() string { + if c == nil || c.Login == nil { return "" } - return *d.Ref + return *c.Login } -// GetRefType returns the RefType field if it's non-nil, zero value otherwise. -func (d *DeleteEvent) GetRefType() string { - if d == nil || d.RefType == nil { +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *Contributor) GetName() string { + if c == nil || c.Name == nil { return "" } - return *d.RefType + return *c.Name } -// GetRepo returns the Repo field. -func (d *DeleteEvent) GetRepo() *Repository { - if d == nil { - return nil - } - return d.Repo -} - -// GetSender returns the Sender field. -func (d *DeleteEvent) GetSender() *User { - if d == nil { - return nil - } - return d.Sender -} - -// GetAutoDismissedAt returns the AutoDismissedAt field if it's non-nil, zero value otherwise. -func (d *DependabotAlert) GetAutoDismissedAt() Timestamp { - if d == nil || d.AutoDismissedAt == nil { - return Timestamp{} +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (c *Contributor) GetNodeID() string { + if c == nil || c.NodeID == nil { + return "" } - return *d.AutoDismissedAt + return *c.NodeID } -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (d *DependabotAlert) GetCreatedAt() Timestamp { - if d == nil || d.CreatedAt == nil { - return Timestamp{} +// GetOrganizationsURL returns the OrganizationsURL field if it's non-nil, zero value otherwise. +func (c *Contributor) GetOrganizationsURL() string { + if c == nil || c.OrganizationsURL == nil { + return "" } - return *d.CreatedAt + return *c.OrganizationsURL } -// GetDependency returns the Dependency field. -func (d *DependabotAlert) GetDependency() *Dependency { - if d == nil { - return nil +// GetReceivedEventsURL returns the ReceivedEventsURL field if it's non-nil, zero value otherwise. +func (c *Contributor) GetReceivedEventsURL() string { + if c == nil || c.ReceivedEventsURL == nil { + return "" } - return d.Dependency + return *c.ReceivedEventsURL } -// GetDismissedAt returns the DismissedAt field if it's non-nil, zero value otherwise. -func (d *DependabotAlert) GetDismissedAt() Timestamp { - if d == nil || d.DismissedAt == nil { - return Timestamp{} +// GetReposURL returns the ReposURL field if it's non-nil, zero value otherwise. +func (c *Contributor) GetReposURL() string { + if c == nil || c.ReposURL == nil { + return "" } - return *d.DismissedAt + return *c.ReposURL } -// GetDismissedBy returns the DismissedBy field. -func (d *DependabotAlert) GetDismissedBy() *User { - if d == nil { - return nil +// GetSiteAdmin returns the SiteAdmin field if it's non-nil, zero value otherwise. +func (c *Contributor) GetSiteAdmin() bool { + if c == nil || c.SiteAdmin == nil { + return false } - return d.DismissedBy + return *c.SiteAdmin } -// GetDismissedComment returns the DismissedComment field if it's non-nil, zero value otherwise. -func (d *DependabotAlert) GetDismissedComment() string { - if d == nil || d.DismissedComment == nil { +// GetStarredURL returns the StarredURL field if it's non-nil, zero value otherwise. +func (c *Contributor) GetStarredURL() string { + if c == nil || c.StarredURL == nil { return "" } - return *d.DismissedComment + return *c.StarredURL } -// GetDismissedReason returns the DismissedReason field if it's non-nil, zero value otherwise. -func (d *DependabotAlert) GetDismissedReason() string { - if d == nil || d.DismissedReason == nil { +// GetSubscriptionsURL returns the SubscriptionsURL field if it's non-nil, zero value otherwise. +func (c *Contributor) GetSubscriptionsURL() string { + if c == nil || c.SubscriptionsURL == nil { return "" } - return *d.DismissedReason -} - -// GetFixedAt returns the FixedAt field if it's non-nil, zero value otherwise. -func (d *DependabotAlert) GetFixedAt() Timestamp { - if d == nil || d.FixedAt == nil { - return Timestamp{} - } - return *d.FixedAt + return *c.SubscriptionsURL } -// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. -func (d *DependabotAlert) GetHTMLURL() string { - if d == nil || d.HTMLURL == nil { +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (c *Contributor) GetType() string { + if c == nil || c.Type == nil { return "" } - return *d.HTMLURL -} - -// GetNumber returns the Number field if it's non-nil, zero value otherwise. -func (d *DependabotAlert) GetNumber() int { - if d == nil || d.Number == nil { - return 0 - } - return *d.Number + return *c.Type } -// GetRepository returns the Repository field. -func (d *DependabotAlert) GetRepository() *Repository { - if d == nil { - return nil +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (c *Contributor) GetURL() string { + if c == nil || c.URL == nil { + return "" } - return d.Repository + return *c.URL } -// GetSecurityAdvisory returns the SecurityAdvisory field. -func (d *DependabotAlert) GetSecurityAdvisory() *DependabotSecurityAdvisory { - if d == nil { +// GetAuthor returns the Author field. +func (c *ContributorStats) GetAuthor() *Contributor { + if c == nil { return nil } - return d.SecurityAdvisory + return c.Author } -// GetSecurityVulnerability returns the SecurityVulnerability field. -func (d *DependabotAlert) GetSecurityVulnerability() *AdvisoryVulnerability { - if d == nil { - return nil +// GetTotal returns the Total field if it's non-nil, zero value otherwise. +func (c *ContributorStats) GetTotal() int { + if c == nil || c.Total == nil { + return 0 } - return d.SecurityVulnerability + return *c.Total } -// GetState returns the State field if it's non-nil, zero value otherwise. -func (d *DependabotAlert) GetState() string { - if d == nil || d.State == nil { +// GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise. +func (c *CopilotDotcomChatModel) GetCustomModelTrainingDate() string { + if c == nil || c.CustomModelTrainingDate == nil { return "" } - return *d.State -} - -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (d *DependabotAlert) GetUpdatedAt() Timestamp { - if d == nil || d.UpdatedAt == nil { - return Timestamp{} - } - return *d.UpdatedAt + return *c.CustomModelTrainingDate } -// GetURL returns the URL field if it's non-nil, zero value otherwise. -func (d *DependabotAlert) GetURL() string { - if d == nil || d.URL == nil { +// GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise. +func (c *CopilotDotcomPullRequestsModel) GetCustomModelTrainingDate() string { + if c == nil || c.CustomModelTrainingDate == nil { return "" } - return *d.URL + return *c.CustomModelTrainingDate } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (d *DependabotAlertEvent) GetAction() string { - if d == nil || d.Action == nil { +// GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise. +func (c *CopilotIDEChatModel) GetCustomModelTrainingDate() string { + if c == nil || c.CustomModelTrainingDate == nil { return "" } - return *d.Action + return *c.CustomModelTrainingDate } -// GetAlert returns the Alert field. -func (d *DependabotAlertEvent) GetAlert() *DependabotAlert { - if d == nil { - return nil +// GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise. +func (c *CopilotIDECodeCompletionsModel) GetCustomModelTrainingDate() string { + if c == nil || c.CustomModelTrainingDate == nil { + return "" } - return d.Alert + return *c.CustomModelTrainingDate } -// GetEnterprise returns the Enterprise field. -func (d *DependabotAlertEvent) GetEnterprise() *Enterprise { - if d == nil { +// GetCopilotDotcomChat returns the CopilotDotcomChat field. +func (c *CopilotMetrics) GetCopilotDotcomChat() *CopilotDotcomChat { + if c == nil { return nil } - return d.Enterprise + return c.CopilotDotcomChat } -// GetInstallation returns the Installation field. -func (d *DependabotAlertEvent) GetInstallation() *Installation { - if d == nil { +// GetCopilotDotcomPullRequests returns the CopilotDotcomPullRequests field. +func (c *CopilotMetrics) GetCopilotDotcomPullRequests() *CopilotDotcomPullRequests { + if c == nil { return nil } - return d.Installation + return c.CopilotDotcomPullRequests } -// GetOrganization returns the Organization field. -func (d *DependabotAlertEvent) GetOrganization() *Organization { - if d == nil { +// GetCopilotIDEChat returns the CopilotIDEChat field. +func (c *CopilotMetrics) GetCopilotIDEChat() *CopilotIDEChat { + if c == nil { return nil } - return d.Organization + return c.CopilotIDEChat } -// GetRepo returns the Repo field. -func (d *DependabotAlertEvent) GetRepo() *Repository { - if d == nil { +// GetCopilotIDECodeCompletions returns the CopilotIDECodeCompletions field. +func (c *CopilotMetrics) GetCopilotIDECodeCompletions() *CopilotIDECodeCompletions { + if c == nil { return nil } - return d.Repo + return c.CopilotIDECodeCompletions } -// GetSender returns the Sender field. -func (d *DependabotAlertEvent) GetSender() *User { - if d == nil { - return nil +// GetTotalActiveUsers returns the TotalActiveUsers field if it's non-nil, zero value otherwise. +func (c *CopilotMetrics) GetTotalActiveUsers() int { + if c == nil || c.TotalActiveUsers == nil { + return 0 } - return d.Sender + return *c.TotalActiveUsers } -// GetDismissedComment returns the DismissedComment field if it's non-nil, zero value otherwise. -func (d *DependabotAlertState) GetDismissedComment() string { - if d == nil || d.DismissedComment == nil { - return "" +// GetTotalEngagedUsers returns the TotalEngagedUsers field if it's non-nil, zero value otherwise. +func (c *CopilotMetrics) GetTotalEngagedUsers() int { + if c == nil || c.TotalEngagedUsers == nil { + return 0 } - return *d.DismissedComment + return *c.TotalEngagedUsers } -// GetDismissedReason returns the DismissedReason field if it's non-nil, zero value otherwise. -func (d *DependabotAlertState) GetDismissedReason() string { - if d == nil || d.DismissedReason == nil { - return "" +// GetSince returns the Since field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsListOptions) GetSince() time.Time { + if c == nil || c.Since == nil { + return time.Time{} } - return *d.DismissedReason + return *c.Since } -// GetCVEID returns the CVEID field if it's non-nil, zero value otherwise. -func (d *DependabotSecurityAdvisory) GetCVEID() string { - if d == nil || d.CVEID == nil { - return "" +// GetUntil returns the Until field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsListOptions) GetUntil() time.Time { + if c == nil || c.Until == nil { + return time.Time{} } - return *d.CVEID + return *c.Until } -// GetCVSS returns the CVSS field. -func (d *DependabotSecurityAdvisory) GetCVSS() *AdvisoryCVSS { - if d == nil { +// GetSeatBreakdown returns the SeatBreakdown field. +func (c *CopilotOrganizationDetails) GetSeatBreakdown() *CopilotSeatBreakdown { + if c == nil { return nil } - return d.CVSS + return c.SeatBreakdown } -// GetDescription returns the Description field if it's non-nil, zero value otherwise. -func (d *DependabotSecurityAdvisory) GetDescription() string { - if d == nil || d.Description == nil { - return "" +// GetAssigningTeam returns the AssigningTeam field. +func (c *CopilotSeatDetails) GetAssigningTeam() *Team { + if c == nil { + return nil } - return *d.Description + return c.AssigningTeam } -// GetGHSAID returns the GHSAID field if it's non-nil, zero value otherwise. -func (d *DependabotSecurityAdvisory) GetGHSAID() string { - if d == nil || d.GHSAID == nil { - return "" +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetCreatedAt() Timestamp { + if c == nil || c.CreatedAt == nil { + return Timestamp{} } - return *d.GHSAID + return *c.CreatedAt } -// GetPublishedAt returns the PublishedAt field if it's non-nil, zero value otherwise. -func (d *DependabotSecurityAdvisory) GetPublishedAt() Timestamp { - if d == nil || d.PublishedAt == nil { +// GetLastActivityAt returns the LastActivityAt field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetLastActivityAt() Timestamp { + if c == nil || c.LastActivityAt == nil { return Timestamp{} } - return *d.PublishedAt + return *c.LastActivityAt } -// GetSeverity returns the Severity field if it's non-nil, zero value otherwise. -func (d *DependabotSecurityAdvisory) GetSeverity() string { - if d == nil || d.Severity == nil { +// GetLastActivityEditor returns the LastActivityEditor field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetLastActivityEditor() string { + if c == nil || c.LastActivityEditor == nil { return "" } - return *d.Severity + return *c.LastActivityEditor } -// GetSummary returns the Summary field if it's non-nil, zero value otherwise. -func (d *DependabotSecurityAdvisory) GetSummary() string { - if d == nil || d.Summary == nil { +// GetPendingCancellationDate returns the PendingCancellationDate field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetPendingCancellationDate() string { + if c == nil || c.PendingCancellationDate == nil { return "" } - return *d.Summary + return *c.PendingCancellationDate } -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (d *DependabotSecurityAdvisory) GetUpdatedAt() Timestamp { - if d == nil || d.UpdatedAt == nil { - return Timestamp{} +// GetPlanType returns the PlanType field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetPlanType() string { + if c == nil || c.PlanType == nil { + return "" } - return *d.UpdatedAt + return *c.PlanType } -// GetWithdrawnAt returns the WithdrawnAt field if it's non-nil, zero value otherwise. -func (d *DependabotSecurityAdvisory) GetWithdrawnAt() Timestamp { - if d == nil || d.WithdrawnAt == nil { +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetUpdatedAt() Timestamp { + if c == nil || c.UpdatedAt == nil { return Timestamp{} } - return *d.WithdrawnAt + return *c.UpdatedAt } -// GetStatus returns the Status field if it's non-nil, zero value otherwise. -func (d *DependabotSecurityUpdates) GetStatus() string { - if d == nil || d.Status == nil { - return "" +// GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise. +func (c *CreateCheckRunOptions) GetCompletedAt() Timestamp { + if c == nil || c.CompletedAt == nil { + return Timestamp{} } - return *d.Status + return *c.CompletedAt } -// GetManifestPath returns the ManifestPath field if it's non-nil, zero value otherwise. -func (d *Dependency) GetManifestPath() string { - if d == nil || d.ManifestPath == nil { +// GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise. +func (c *CreateCheckRunOptions) GetConclusion() string { + if c == nil || c.Conclusion == nil { return "" } - return *d.ManifestPath -} - -// GetPackage returns the Package field. -func (d *Dependency) GetPackage() *VulnerabilityPackage { - if d == nil { - return nil - } - return d.Package + return *c.Conclusion } -// GetScope returns the Scope field if it's non-nil, zero value otherwise. -func (d *Dependency) GetScope() string { - if d == nil || d.Scope == nil { +// GetDetailsURL returns the DetailsURL field if it's non-nil, zero value otherwise. +func (c *CreateCheckRunOptions) GetDetailsURL() string { + if c == nil || c.DetailsURL == nil { return "" } - return *d.Scope + return *c.DetailsURL } -// GetLabeledRunners returns the LabeledRunners field if it's non-nil, zero value otherwise. -func (d *DependencyGraphAutosubmitActionOptions) GetLabeledRunners() bool { - if d == nil || d.LabeledRunners == nil { - return false +// GetExternalID returns the ExternalID field if it's non-nil, zero value otherwise. +func (c *CreateCheckRunOptions) GetExternalID() string { + if c == nil || c.ExternalID == nil { + return "" } - return *d.LabeledRunners + return *c.ExternalID } -// GetDetector returns the Detector field. -func (d *DependencyGraphSnapshot) GetDetector() *DependencyGraphSnapshotDetector { - if d == nil { +// GetOutput returns the Output field. +func (c *CreateCheckRunOptions) GetOutput() *CheckRunOutput { + if c == nil { return nil } - return d.Detector + return c.Output } -// GetJob returns the Job field. -func (d *DependencyGraphSnapshot) GetJob() *DependencyGraphSnapshotJob { - if d == nil { - return nil +// GetStartedAt returns the StartedAt field if it's non-nil, zero value otherwise. +func (c *CreateCheckRunOptions) GetStartedAt() Timestamp { + if c == nil || c.StartedAt == nil { + return Timestamp{} } - return d.Job + return *c.StartedAt } -// GetRef returns the Ref field if it's non-nil, zero value otherwise. -func (d *DependencyGraphSnapshot) GetRef() string { - if d == nil || d.Ref == nil { +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (c *CreateCheckRunOptions) GetStatus() string { + if c == nil || c.Status == nil { return "" } - return *d.Ref + return *c.Status } -// GetScanned returns the Scanned field if it's non-nil, zero value otherwise. -func (d *DependencyGraphSnapshot) GetScanned() Timestamp { - if d == nil || d.Scanned == nil { - return Timestamp{} +// GetHeadBranch returns the HeadBranch field if it's non-nil, zero value otherwise. +func (c *CreateCheckSuiteOptions) GetHeadBranch() string { + if c == nil || c.HeadBranch == nil { + return "" } - return *d.Scanned + return *c.HeadBranch } -// GetSha returns the Sha field if it's non-nil, zero value otherwise. -func (d *DependencyGraphSnapshot) GetSha() string { - if d == nil || d.Sha == nil { +// GetClientIP returns the ClientIP field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceOptions) GetClientIP() string { + if c == nil || c.ClientIP == nil { return "" } - return *d.Sha + return *c.ClientIP } -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (d *DependencyGraphSnapshotCreationData) GetCreatedAt() Timestamp { - if d == nil || d.CreatedAt == nil { - return Timestamp{} +// GetDevcontainerPath returns the DevcontainerPath field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceOptions) GetDevcontainerPath() string { + if c == nil || c.DevcontainerPath == nil { + return "" } - return *d.CreatedAt + return *c.DevcontainerPath } -// GetMessage returns the Message field if it's non-nil, zero value otherwise. -func (d *DependencyGraphSnapshotCreationData) GetMessage() string { - if d == nil || d.Message == nil { +// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceOptions) GetDisplayName() string { + if c == nil || c.DisplayName == nil { return "" } - return *d.Message + return *c.DisplayName } -// GetResult returns the Result field if it's non-nil, zero value otherwise. -func (d *DependencyGraphSnapshotCreationData) GetResult() string { - if d == nil || d.Result == nil { +// GetGeo returns the Geo field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceOptions) GetGeo() string { + if c == nil || c.Geo == nil { return "" } - return *d.Result + return *c.Geo } -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (d *DependencyGraphSnapshotDetector) GetName() string { - if d == nil || d.Name == nil { - return "" +// GetIdleTimeoutMinutes returns the IdleTimeoutMinutes field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceOptions) GetIdleTimeoutMinutes() int { + if c == nil || c.IdleTimeoutMinutes == nil { + return 0 } - return *d.Name + return *c.IdleTimeoutMinutes } -// GetURL returns the URL field if it's non-nil, zero value otherwise. -func (d *DependencyGraphSnapshotDetector) GetURL() string { - if d == nil || d.URL == nil { +// GetMachine returns the Machine field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceOptions) GetMachine() string { + if c == nil || c.Machine == nil { return "" } - return *d.URL + return *c.Machine } -// GetVersion returns the Version field if it's non-nil, zero value otherwise. -func (d *DependencyGraphSnapshotDetector) GetVersion() string { - if d == nil || d.Version == nil { - return "" +// GetMultiRepoPermissionsOptOut returns the MultiRepoPermissionsOptOut field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceOptions) GetMultiRepoPermissionsOptOut() bool { + if c == nil || c.MultiRepoPermissionsOptOut == nil { + return false } - return *d.Version + return *c.MultiRepoPermissionsOptOut } -// GetCorrelator returns the Correlator field if it's non-nil, zero value otherwise. -func (d *DependencyGraphSnapshotJob) GetCorrelator() string { - if d == nil || d.Correlator == nil { +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceOptions) GetRef() string { + if c == nil || c.Ref == nil { return "" } - return *d.Correlator + return *c.Ref } -// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. -func (d *DependencyGraphSnapshotJob) GetHTMLURL() string { - if d == nil || d.HTMLURL == nil { - return "" +// GetRetentionPeriodMinutes returns the RetentionPeriodMinutes field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceOptions) GetRetentionPeriodMinutes() int { + if c == nil || c.RetentionPeriodMinutes == nil { + return 0 } - return *d.HTMLURL + return *c.RetentionPeriodMinutes } -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (d *DependencyGraphSnapshotJob) GetID() string { - if d == nil || d.ID == nil { +// GetWorkingDirectory returns the WorkingDirectory field if it's non-nil, zero value otherwise. +func (c *CreateCodespaceOptions) GetWorkingDirectory() string { + if c == nil || c.WorkingDirectory == nil { return "" } - return *d.ID + return *c.WorkingDirectory } -// GetFile returns the File field. -func (d *DependencyGraphSnapshotManifest) GetFile() *DependencyGraphSnapshotManifestFile { - if d == nil { - return nil +// GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. +func (c *CreateEnterpriseRunnerGroupRequest) GetAllowsPublicRepositories() bool { + if c == nil || c.AllowsPublicRepositories == nil { + return false } - return d.File + return *c.AllowsPublicRepositories } // GetName returns the Name field if it's non-nil, zero value otherwise. -func (d *DependencyGraphSnapshotManifest) GetName() string { - if d == nil || d.Name == nil { +func (c *CreateEnterpriseRunnerGroupRequest) GetName() string { + if c == nil || c.Name == nil { return "" } - return *d.Name + return *c.Name } -// GetSourceLocation returns the SourceLocation field if it's non-nil, zero value otherwise. -func (d *DependencyGraphSnapshotManifestFile) GetSourceLocation() string { - if d == nil || d.SourceLocation == nil { - return "" +// GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise. +func (c *CreateEnterpriseRunnerGroupRequest) GetRestrictedToWorkflows() bool { + if c == nil || c.RestrictedToWorkflows == nil { + return false } - return *d.SourceLocation + return *c.RestrictedToWorkflows } -// GetPackageURL returns the PackageURL field if it's non-nil, zero value otherwise. -func (d *DependencyGraphSnapshotResolvedDependency) GetPackageURL() string { - if d == nil || d.PackageURL == nil { +// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. +func (c *CreateEnterpriseRunnerGroupRequest) GetVisibility() string { + if c == nil || c.Visibility == nil { return "" } - return *d.PackageURL + return *c.Visibility } -// GetRelationship returns the Relationship field if it's non-nil, zero value otherwise. -func (d *DependencyGraphSnapshotResolvedDependency) GetRelationship() string { - if d == nil || d.Relationship == nil { +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (c *CreateEvent) GetDescription() string { + if c == nil || c.Description == nil { return "" } - return *d.Relationship + return *c.Description } -// GetScope returns the Scope field if it's non-nil, zero value otherwise. -func (d *DependencyGraphSnapshotResolvedDependency) GetScope() string { - if d == nil || d.Scope == nil { - return "" +// GetInstallation returns the Installation field. +func (c *CreateEvent) GetInstallation() *Installation { + if c == nil { + return nil } - return *d.Scope + return c.Installation } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (d *DeployKeyEvent) GetAction() string { - if d == nil || d.Action == nil { +// GetMasterBranch returns the MasterBranch field if it's non-nil, zero value otherwise. +func (c *CreateEvent) GetMasterBranch() string { + if c == nil || c.MasterBranch == nil { return "" } - return *d.Action + return *c.MasterBranch } -// GetInstallation returns the Installation field. -func (d *DeployKeyEvent) GetInstallation() *Installation { - if d == nil { +// GetOrg returns the Org field. +func (c *CreateEvent) GetOrg() *Organization { + if c == nil { return nil } - return d.Installation + return c.Org } -// GetKey returns the Key field. -func (d *DeployKeyEvent) GetKey() *Key { - if d == nil { - return nil +// GetPusherType returns the PusherType field if it's non-nil, zero value otherwise. +func (c *CreateEvent) GetPusherType() string { + if c == nil || c.PusherType == nil { + return "" } - return d.Key + return *c.PusherType } -// GetOrganization returns the Organization field. -func (d *DeployKeyEvent) GetOrganization() *Organization { - if d == nil { - return nil +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (c *CreateEvent) GetRef() string { + if c == nil || c.Ref == nil { + return "" } - return d.Organization + return *c.Ref } -// GetRepo returns the Repo field. -func (d *DeployKeyEvent) GetRepo() *Repository { - if d == nil { - return nil +// GetRefType returns the RefType field if it's non-nil, zero value otherwise. +func (c *CreateEvent) GetRefType() string { + if c == nil || c.RefType == nil { + return "" } - return d.Repo + return *c.RefType } -// GetSender returns the Sender field. -func (d *DeployKeyEvent) GetSender() *User { - if d == nil { +// GetRepo returns the Repo field. +func (c *CreateEvent) GetRepo() *Repository { + if c == nil { return nil } - return d.Sender -} - -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (d *Deployment) GetCreatedAt() Timestamp { - if d == nil || d.CreatedAt == nil { - return Timestamp{} - } - return *d.CreatedAt + return c.Repo } -// GetCreator returns the Creator field. -func (d *Deployment) GetCreator() *User { - if d == nil { +// GetSender returns the Sender field. +func (c *CreateEvent) GetSender() *User { + if c == nil { return nil } - return d.Creator -} - -// GetDescription returns the Description field if it's non-nil, zero value otherwise. -func (d *Deployment) GetDescription() string { - if d == nil || d.Description == nil { - return "" - } - return *d.Description + return c.Sender } -// GetEnvironment returns the Environment field if it's non-nil, zero value otherwise. -func (d *Deployment) GetEnvironment() string { - if d == nil || d.Environment == nil { +// GetEmail returns the Email field if it's non-nil, zero value otherwise. +func (c *CreateOrgInvitationOptions) GetEmail() string { + if c == nil || c.Email == nil { return "" } - return *d.Environment + return *c.Email } -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (d *Deployment) GetID() int64 { - if d == nil || d.ID == nil { +// GetInviteeID returns the InviteeID field if it's non-nil, zero value otherwise. +func (c *CreateOrgInvitationOptions) GetInviteeID() int64 { + if c == nil || c.InviteeID == nil { return 0 } - return *d.ID + return *c.InviteeID } -// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (d *Deployment) GetNodeID() string { - if d == nil || d.NodeID == nil { +// GetRole returns the Role field if it's non-nil, zero value otherwise. +func (c *CreateOrgInvitationOptions) GetRole() string { + if c == nil || c.Role == nil { return "" } - return *d.NodeID + return *c.Role } -// GetRef returns the Ref field if it's non-nil, zero value otherwise. -func (d *Deployment) GetRef() string { - if d == nil || d.Ref == nil { +// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateCustomRepoRoleOptions) GetBaseRole() string { + if c == nil || c.BaseRole == nil { return "" } - return *d.Ref + return *c.BaseRole } -// GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise. -func (d *Deployment) GetRepositoryURL() string { - if d == nil || d.RepositoryURL == nil { +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateCustomRepoRoleOptions) GetDescription() string { + if c == nil || c.Description == nil { return "" } - return *d.RepositoryURL + return *c.Description } -// GetSHA returns the SHA field if it's non-nil, zero value otherwise. -func (d *Deployment) GetSHA() string { - if d == nil || d.SHA == nil { +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateCustomRepoRoleOptions) GetName() string { + if c == nil || c.Name == nil { return "" } - return *d.SHA + return *c.Name } -// GetStatusesURL returns the StatusesURL field if it's non-nil, zero value otherwise. -func (d *Deployment) GetStatusesURL() string { - if d == nil || d.StatusesURL == nil { +// GetColor returns the Color field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateIssueTypesOptions) GetColor() string { + if c == nil || c.Color == nil { return "" } - return *d.StatusesURL + return *c.Color } -// GetTask returns the Task field if it's non-nil, zero value otherwise. -func (d *Deployment) GetTask() string { - if d == nil || d.Task == nil { +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateIssueTypesOptions) GetDescription() string { + if c == nil || c.Description == nil { return "" } - return *d.Task + return *c.Description } -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (d *Deployment) GetUpdatedAt() Timestamp { - if d == nil || d.UpdatedAt == nil { - return Timestamp{} +// GetIsPrivate returns the IsPrivate field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateIssueTypesOptions) GetIsPrivate() bool { + if c == nil || c.IsPrivate == nil { + return false } - return *d.UpdatedAt + return *c.IsPrivate } -// GetURL returns the URL field if it's non-nil, zero value otherwise. -func (d *Deployment) GetURL() string { - if d == nil || d.URL == nil { +// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateOrgRoleOptions) GetBaseRole() string { + if c == nil || c.BaseRole == nil { return "" } - return *d.URL + return *c.BaseRole } -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (d *DeploymentBranchPolicy) GetID() int64 { - if d == nil || d.ID == nil { - return 0 +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateOrgRoleOptions) GetDescription() string { + if c == nil || c.Description == nil { + return "" } - return *d.ID + return *c.Description } // GetName returns the Name field if it's non-nil, zero value otherwise. -func (d *DeploymentBranchPolicy) GetName() string { - if d == nil || d.Name == nil { +func (c *CreateOrUpdateOrgRoleOptions) GetName() string { + if c == nil || c.Name == nil { return "" } - return *d.Name + return *c.Name } -// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (d *DeploymentBranchPolicy) GetNodeID() string { - if d == nil || d.NodeID == nil { - return "" +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (c *CreateProtectedChanges) GetFrom() bool { + if c == nil || c.From == nil { + return false } - return *d.NodeID + return *c.From } -// GetType returns the Type field if it's non-nil, zero value otherwise. -func (d *DeploymentBranchPolicy) GetType() string { - if d == nil || d.Type == nil { - return "" +// GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. +func (c *CreateRunnerGroupRequest) GetAllowsPublicRepositories() bool { + if c == nil || c.AllowsPublicRepositories == nil { + return false } - return *d.Type + return *c.AllowsPublicRepositories } // GetName returns the Name field if it's non-nil, zero value otherwise. -func (d *DeploymentBranchPolicyRequest) GetName() string { - if d == nil || d.Name == nil { +func (c *CreateRunnerGroupRequest) GetName() string { + if c == nil || c.Name == nil { return "" } - return *d.Name + return *c.Name } -// GetType returns the Type field if it's non-nil, zero value otherwise. -func (d *DeploymentBranchPolicyRequest) GetType() string { - if d == nil || d.Type == nil { +// GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise. +func (c *CreateRunnerGroupRequest) GetRestrictedToWorkflows() bool { + if c == nil || c.RestrictedToWorkflows == nil { + return false + } + return *c.RestrictedToWorkflows +} + +// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise. +func (c *CreateRunnerGroupRequest) GetVisibility() string { + if c == nil || c.Visibility == nil { return "" } - return *d.Type + return *c.Visibility } -// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. -func (d *DeploymentBranchPolicyResponse) GetTotalCount() int { - if d == nil || d.TotalCount == nil { - return 0 +// GetCanAdminsBypass returns the CanAdminsBypass field if it's non-nil, zero value otherwise. +func (c *CreateUpdateEnvironment) GetCanAdminsBypass() bool { + if c == nil || c.CanAdminsBypass == nil { + return false } - return *d.TotalCount + return *c.CanAdminsBypass } -// GetDeployment returns the Deployment field. -func (d *DeploymentEvent) GetDeployment() *Deployment { - if d == nil { +// GetDeploymentBranchPolicy returns the DeploymentBranchPolicy field. +func (c *CreateUpdateEnvironment) GetDeploymentBranchPolicy() *BranchPolicy { + if c == nil { return nil } - return d.Deployment + return c.DeploymentBranchPolicy } -// GetInstallation returns the Installation field. -func (d *DeploymentEvent) GetInstallation() *Installation { - if d == nil { - return nil +// GetPreventSelfReview returns the PreventSelfReview field if it's non-nil, zero value otherwise. +func (c *CreateUpdateEnvironment) GetPreventSelfReview() bool { + if c == nil || c.PreventSelfReview == nil { + return false } - return d.Installation + return *c.PreventSelfReview } -// GetOrg returns the Org field. -func (d *DeploymentEvent) GetOrg() *Organization { - if d == nil { - return nil +// GetWaitTimer returns the WaitTimer field if it's non-nil, zero value otherwise. +func (c *CreateUpdateEnvironment) GetWaitTimer() int { + if c == nil || c.WaitTimer == nil { + return 0 } - return d.Org + return *c.WaitTimer } -// GetRepo returns the Repo field. -func (d *DeploymentEvent) GetRepo() *Repository { - if d == nil { - return nil +// GetEmail returns the Email field if it's non-nil, zero value otherwise. +func (c *CreateUserRequest) GetEmail() string { + if c == nil || c.Email == nil { + return "" } - return d.Repo + return *c.Email } -// GetSender returns the Sender field. -func (d *DeploymentEvent) GetSender() *User { - if d == nil { - return nil +// GetSuspended returns the Suspended field if it's non-nil, zero value otherwise. +func (c *CreateUserRequest) GetSuspended() bool { + if c == nil || c.Suspended == nil { + return false } - return d.Sender + return *c.Suspended } -// GetWorkflow returns the Workflow field. -func (d *DeploymentEvent) GetWorkflow() *Workflow { - if d == nil { - return nil +// GetInputs returns the Inputs map if it's non-nil, an empty map otherwise. +func (c *CreateWorkflowDispatchEventRequest) GetInputs() map[string]any { + if c == nil || c.Inputs == nil { + return map[string]any{} } - return d.Workflow + return c.Inputs +} + +// GetCreated returns the Created field if it's non-nil, zero value otherwise. +func (c *CreationInfo) GetCreated() Timestamp { + if c == nil || c.Created == nil { + return Timestamp{} + } + return *c.Created +} + +// GetAuthorizedCredentialExpiresAt returns the AuthorizedCredentialExpiresAt field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetAuthorizedCredentialExpiresAt() Timestamp { + if c == nil || c.AuthorizedCredentialExpiresAt == nil { + return Timestamp{} + } + return *c.AuthorizedCredentialExpiresAt +} + +// GetAuthorizedCredentialID returns the AuthorizedCredentialID field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetAuthorizedCredentialID() int64 { + if c == nil || c.AuthorizedCredentialID == nil { + return 0 + } + return *c.AuthorizedCredentialID +} + +// GetAuthorizedCredentialNote returns the AuthorizedCredentialNote field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetAuthorizedCredentialNote() string { + if c == nil || c.AuthorizedCredentialNote == nil { + return "" + } + return *c.AuthorizedCredentialNote +} + +// GetAuthorizedCredentialTitle returns the AuthorizedCredentialTitle field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetAuthorizedCredentialTitle() string { + if c == nil || c.AuthorizedCredentialTitle == nil { + return "" + } + return *c.AuthorizedCredentialTitle +} + +// GetCredentialAccessedAt returns the CredentialAccessedAt field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetCredentialAccessedAt() Timestamp { + if c == nil || c.CredentialAccessedAt == nil { + return Timestamp{} + } + return *c.CredentialAccessedAt +} + +// GetCredentialAuthorizedAt returns the CredentialAuthorizedAt field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetCredentialAuthorizedAt() Timestamp { + if c == nil || c.CredentialAuthorizedAt == nil { + return Timestamp{} + } + return *c.CredentialAuthorizedAt +} + +// GetCredentialID returns the CredentialID field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetCredentialID() int64 { + if c == nil || c.CredentialID == nil { + return 0 + } + return *c.CredentialID +} + +// GetCredentialType returns the CredentialType field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetCredentialType() string { + if c == nil || c.CredentialType == nil { + return "" + } + return *c.CredentialType +} + +// GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetFingerprint() string { + if c == nil || c.Fingerprint == nil { + return "" + } + return *c.Fingerprint +} + +// GetLogin returns the Login field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetLogin() string { + if c == nil || c.Login == nil { + return "" + } + return *c.Login +} + +// GetTokenLastEight returns the TokenLastEight field if it's non-nil, zero value otherwise. +func (c *CredentialAuthorization) GetTokenLastEight() string { + if c == nil || c.TokenLastEight == nil { + return "" + } + return *c.TokenLastEight +} + +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (c *Credit) GetType() string { + if c == nil || c.Type == nil { + return "" + } + return *c.Type +} + +// GetUser returns the User field. +func (c *Credit) GetUser() *User { + if c == nil { + return nil + } + return c.User +} + +// GetApp returns the App field. +func (c *CustomDeploymentProtectionRule) GetApp() *CustomDeploymentProtectionRuleApp { + if c == nil { + return nil + } + return c.App +} + +// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise. +func (c *CustomDeploymentProtectionRule) GetEnabled() bool { + if c == nil || c.Enabled == nil { + return false + } + return *c.Enabled +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (c *CustomDeploymentProtectionRule) GetID() int64 { + if c == nil || c.ID == nil { + return 0 + } + return *c.ID +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (c *CustomDeploymentProtectionRule) GetNodeID() string { + if c == nil || c.NodeID == nil { + return "" + } + return *c.NodeID +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (c *CustomDeploymentProtectionRuleApp) GetID() int64 { + if c == nil || c.ID == nil { + return 0 + } + return *c.ID +} + +// GetIntegrationURL returns the IntegrationURL field if it's non-nil, zero value otherwise. +func (c *CustomDeploymentProtectionRuleApp) GetIntegrationURL() string { + if c == nil || c.IntegrationURL == nil { + return "" + } + return *c.IntegrationURL +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (c *CustomDeploymentProtectionRuleApp) GetNodeID() string { + if c == nil || c.NodeID == nil { + return "" + } + return *c.NodeID +} + +// GetSlug returns the Slug field if it's non-nil, zero value otherwise. +func (c *CustomDeploymentProtectionRuleApp) GetSlug() string { + if c == nil || c.Slug == nil { + return "" + } + return *c.Slug +} + +// GetIntegrationID returns the IntegrationID field if it's non-nil, zero value otherwise. +func (c *CustomDeploymentProtectionRuleRequest) GetIntegrationID() int64 { + if c == nil || c.IntegrationID == nil { + return 0 + } + return *c.IntegrationID +} + +// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. +func (c *CustomOrgRoles) GetBaseRole() string { + if c == nil || c.BaseRole == nil { + return "" + } + return *c.BaseRole +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (c *CustomOrgRoles) GetCreatedAt() Timestamp { + if c == nil || c.CreatedAt == nil { + return Timestamp{} + } + return *c.CreatedAt +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (c *CustomOrgRoles) GetDescription() string { + if c == nil || c.Description == nil { + return "" + } + return *c.Description +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (c *CustomOrgRoles) GetID() int64 { + if c == nil || c.ID == nil { + return 0 + } + return *c.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *CustomOrgRoles) GetName() string { + if c == nil || c.Name == nil { + return "" + } + return *c.Name +} + +// GetOrg returns the Org field. +func (c *CustomOrgRoles) GetOrg() *Organization { + if c == nil { + return nil + } + return c.Org +} + +// GetSource returns the Source field if it's non-nil, zero value otherwise. +func (c *CustomOrgRoles) GetSource() string { + if c == nil || c.Source == nil { + return "" + } + return *c.Source +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (c *CustomOrgRoles) GetUpdatedAt() Timestamp { + if c == nil || c.UpdatedAt == nil { + return Timestamp{} + } + return *c.UpdatedAt +} + +// GetDefaultValue returns the DefaultValue field if it's non-nil, zero value otherwise. +func (c *CustomProperty) GetDefaultValue() string { + if c == nil || c.DefaultValue == nil { + return "" + } + return *c.DefaultValue +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (c *CustomProperty) GetDescription() string { + if c == nil || c.Description == nil { + return "" + } + return *c.Description +} + +// GetPropertyName returns the PropertyName field if it's non-nil, zero value otherwise. +func (c *CustomProperty) GetPropertyName() string { + if c == nil || c.PropertyName == nil { + return "" + } + return *c.PropertyName +} + +// GetRequired returns the Required field if it's non-nil, zero value otherwise. +func (c *CustomProperty) GetRequired() bool { + if c == nil || c.Required == nil { + return false + } + return *c.Required +} + +// GetSourceType returns the SourceType field if it's non-nil, zero value otherwise. +func (c *CustomProperty) GetSourceType() string { + if c == nil || c.SourceType == nil { + return "" + } + return *c.SourceType +} + +// GetValuesEditableBy returns the ValuesEditableBy field if it's non-nil, zero value otherwise. +func (c *CustomProperty) GetValuesEditableBy() string { + if c == nil || c.ValuesEditableBy == nil { + return "" + } + return *c.ValuesEditableBy +} + +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (c *CustomPropertyEvent) GetAction() string { + if c == nil || c.Action == nil { + return "" + } + return *c.Action +} + +// GetDefinition returns the Definition field. +func (c *CustomPropertyEvent) GetDefinition() *CustomProperty { + if c == nil { + return nil + } + return c.Definition +} + +// GetEnterprise returns the Enterprise field. +func (c *CustomPropertyEvent) GetEnterprise() *Enterprise { + if c == nil { + return nil + } + return c.Enterprise +} + +// GetInstallation returns the Installation field. +func (c *CustomPropertyEvent) GetInstallation() *Installation { + if c == nil { + return nil + } + return c.Installation +} + +// GetOrg returns the Org field. +func (c *CustomPropertyEvent) GetOrg() *Organization { + if c == nil { + return nil + } + return c.Org +} + +// GetSender returns the Sender field. +func (c *CustomPropertyEvent) GetSender() *User { + if c == nil { + return nil + } + return c.Sender +} + +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (c *CustomPropertyValuesEvent) GetAction() string { + if c == nil || c.Action == nil { + return "" + } + return *c.Action +} + +// GetEnterprise returns the Enterprise field. +func (c *CustomPropertyValuesEvent) GetEnterprise() *Enterprise { + if c == nil { + return nil + } + return c.Enterprise +} + +// GetInstallation returns the Installation field. +func (c *CustomPropertyValuesEvent) GetInstallation() *Installation { + if c == nil { + return nil + } + return c.Installation +} + +// GetOrg returns the Org field. +func (c *CustomPropertyValuesEvent) GetOrg() *Organization { + if c == nil { + return nil + } + return c.Org +} + +// GetRepo returns the Repo field. +func (c *CustomPropertyValuesEvent) GetRepo() *Repository { + if c == nil { + return nil + } + return c.Repo +} + +// GetSender returns the Sender field. +func (c *CustomPropertyValuesEvent) GetSender() *User { + if c == nil { + return nil + } + return c.Sender +} + +// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. +func (c *CustomRepoRoles) GetBaseRole() string { + if c == nil || c.BaseRole == nil { + return "" + } + return *c.BaseRole +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (c *CustomRepoRoles) GetCreatedAt() Timestamp { + if c == nil || c.CreatedAt == nil { + return Timestamp{} + } + return *c.CreatedAt +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (c *CustomRepoRoles) GetDescription() string { + if c == nil || c.Description == nil { + return "" + } + return *c.Description +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (c *CustomRepoRoles) GetID() int64 { + if c == nil || c.ID == nil { + return 0 + } + return *c.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *CustomRepoRoles) GetName() string { + if c == nil || c.Name == nil { + return "" + } + return *c.Name +} + +// GetOrg returns the Org field. +func (c *CustomRepoRoles) GetOrg() *Organization { + if c == nil { + return nil + } + return c.Org +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (c *CustomRepoRoles) GetUpdatedAt() Timestamp { + if c == nil || c.UpdatedAt == nil { + return Timestamp{} + } + return *c.UpdatedAt +} + +// GetQuerySuite returns the QuerySuite field if it's non-nil, zero value otherwise. +func (d *DefaultSetupConfiguration) GetQuerySuite() string { + if d == nil || d.QuerySuite == nil { + return "" + } + return *d.QuerySuite +} + +// GetState returns the State field if it's non-nil, zero value otherwise. +func (d *DefaultSetupConfiguration) GetState() string { + if d == nil || d.State == nil { + return "" + } + return *d.State +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (d *DefaultSetupConfiguration) GetUpdatedAt() Timestamp { + if d == nil || d.UpdatedAt == nil { + return Timestamp{} + } + return *d.UpdatedAt +} + +// GetCanApprovePullRequestReviews returns the CanApprovePullRequestReviews field if it's non-nil, zero value otherwise. +func (d *DefaultWorkflowPermissionEnterprise) GetCanApprovePullRequestReviews() bool { + if d == nil || d.CanApprovePullRequestReviews == nil { + return false + } + return *d.CanApprovePullRequestReviews +} + +// GetDefaultWorkflowPermissions returns the DefaultWorkflowPermissions field if it's non-nil, zero value otherwise. +func (d *DefaultWorkflowPermissionEnterprise) GetDefaultWorkflowPermissions() string { + if d == nil || d.DefaultWorkflowPermissions == nil { + return "" + } + return *d.DefaultWorkflowPermissions +} + +// GetCanApprovePullRequestReviews returns the CanApprovePullRequestReviews field if it's non-nil, zero value otherwise. +func (d *DefaultWorkflowPermissionOrganization) GetCanApprovePullRequestReviews() bool { + if d == nil || d.CanApprovePullRequestReviews == nil { + return false + } + return *d.CanApprovePullRequestReviews +} + +// GetDefaultWorkflowPermissions returns the DefaultWorkflowPermissions field if it's non-nil, zero value otherwise. +func (d *DefaultWorkflowPermissionOrganization) GetDefaultWorkflowPermissions() string { + if d == nil || d.DefaultWorkflowPermissions == nil { + return "" + } + return *d.DefaultWorkflowPermissions +} + +// GetCanApprovePullRequestReviews returns the CanApprovePullRequestReviews field if it's non-nil, zero value otherwise. +func (d *DefaultWorkflowPermissionRepository) GetCanApprovePullRequestReviews() bool { + if d == nil || d.CanApprovePullRequestReviews == nil { + return false + } + return *d.CanApprovePullRequestReviews +} + +// GetDefaultWorkflowPermissions returns the DefaultWorkflowPermissions field if it's non-nil, zero value otherwise. +func (d *DefaultWorkflowPermissionRepository) GetDefaultWorkflowPermissions() string { + if d == nil || d.DefaultWorkflowPermissions == nil { + return "" + } + return *d.DefaultWorkflowPermissions +} + +// GetConfirmDeleteURL returns the ConfirmDeleteURL field if it's non-nil, zero value otherwise. +func (d *DeleteAnalysis) GetConfirmDeleteURL() string { + if d == nil || d.ConfirmDeleteURL == nil { + return "" + } + return *d.ConfirmDeleteURL +} + +// GetNextAnalysisURL returns the NextAnalysisURL field if it's non-nil, zero value otherwise. +func (d *DeleteAnalysis) GetNextAnalysisURL() string { + if d == nil || d.NextAnalysisURL == nil { + return "" + } + return *d.NextAnalysisURL +} + +// GetInstallation returns the Installation field. +func (d *DeleteEvent) GetInstallation() *Installation { + if d == nil { + return nil + } + return d.Installation +} + +// GetOrg returns the Org field. +func (d *DeleteEvent) GetOrg() *Organization { + if d == nil { + return nil + } + return d.Org +} + +// GetPusherType returns the PusherType field if it's non-nil, zero value otherwise. +func (d *DeleteEvent) GetPusherType() string { + if d == nil || d.PusherType == nil { + return "" + } + return *d.PusherType +} + +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (d *DeleteEvent) GetRef() string { + if d == nil || d.Ref == nil { + return "" + } + return *d.Ref +} + +// GetRefType returns the RefType field if it's non-nil, zero value otherwise. +func (d *DeleteEvent) GetRefType() string { + if d == nil || d.RefType == nil { + return "" + } + return *d.RefType +} + +// GetRepo returns the Repo field. +func (d *DeleteEvent) GetRepo() *Repository { + if d == nil { + return nil + } + return d.Repo +} + +// GetSender returns the Sender field. +func (d *DeleteEvent) GetSender() *User { + if d == nil { + return nil + } + return d.Sender +} + +// GetAutoDismissedAt returns the AutoDismissedAt field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetAutoDismissedAt() Timestamp { + if d == nil || d.AutoDismissedAt == nil { + return Timestamp{} + } + return *d.AutoDismissedAt +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetCreatedAt() Timestamp { + if d == nil || d.CreatedAt == nil { + return Timestamp{} + } + return *d.CreatedAt +} + +// GetDependency returns the Dependency field. +func (d *DependabotAlert) GetDependency() *Dependency { + if d == nil { + return nil + } + return d.Dependency +} + +// GetDismissedAt returns the DismissedAt field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetDismissedAt() Timestamp { + if d == nil || d.DismissedAt == nil { + return Timestamp{} + } + return *d.DismissedAt +} + +// GetDismissedBy returns the DismissedBy field. +func (d *DependabotAlert) GetDismissedBy() *User { + if d == nil { + return nil + } + return d.DismissedBy +} + +// GetDismissedComment returns the DismissedComment field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetDismissedComment() string { + if d == nil || d.DismissedComment == nil { + return "" + } + return *d.DismissedComment +} + +// GetDismissedReason returns the DismissedReason field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetDismissedReason() string { + if d == nil || d.DismissedReason == nil { + return "" + } + return *d.DismissedReason +} + +// GetFixedAt returns the FixedAt field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetFixedAt() Timestamp { + if d == nil || d.FixedAt == nil { + return Timestamp{} + } + return *d.FixedAt +} + +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetHTMLURL() string { + if d == nil || d.HTMLURL == nil { + return "" + } + return *d.HTMLURL +} + +// GetNumber returns the Number field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetNumber() int { + if d == nil || d.Number == nil { + return 0 + } + return *d.Number +} + +// GetRepository returns the Repository field. +func (d *DependabotAlert) GetRepository() *Repository { + if d == nil { + return nil + } + return d.Repository +} + +// GetSecurityAdvisory returns the SecurityAdvisory field. +func (d *DependabotAlert) GetSecurityAdvisory() *DependabotSecurityAdvisory { + if d == nil { + return nil + } + return d.SecurityAdvisory +} + +// GetSecurityVulnerability returns the SecurityVulnerability field. +func (d *DependabotAlert) GetSecurityVulnerability() *AdvisoryVulnerability { + if d == nil { + return nil + } + return d.SecurityVulnerability +} + +// GetState returns the State field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetState() string { + if d == nil || d.State == nil { + return "" + } + return *d.State +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetUpdatedAt() Timestamp { + if d == nil || d.UpdatedAt == nil { + return Timestamp{} + } + return *d.UpdatedAt +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (d *DependabotAlert) GetURL() string { + if d == nil || d.URL == nil { + return "" + } + return *d.URL +} + +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (d *DependabotAlertEvent) GetAction() string { + if d == nil || d.Action == nil { + return "" + } + return *d.Action +} + +// GetAlert returns the Alert field. +func (d *DependabotAlertEvent) GetAlert() *DependabotAlert { + if d == nil { + return nil + } + return d.Alert +} + +// GetEnterprise returns the Enterprise field. +func (d *DependabotAlertEvent) GetEnterprise() *Enterprise { + if d == nil { + return nil + } + return d.Enterprise +} + +// GetInstallation returns the Installation field. +func (d *DependabotAlertEvent) GetInstallation() *Installation { + if d == nil { + return nil + } + return d.Installation +} + +// GetOrganization returns the Organization field. +func (d *DependabotAlertEvent) GetOrganization() *Organization { + if d == nil { + return nil + } + return d.Organization +} + +// GetRepo returns the Repo field. +func (d *DependabotAlertEvent) GetRepo() *Repository { + if d == nil { + return nil + } + return d.Repo +} + +// GetSender returns the Sender field. +func (d *DependabotAlertEvent) GetSender() *User { + if d == nil { + return nil + } + return d.Sender +} + +// GetDismissedComment returns the DismissedComment field if it's non-nil, zero value otherwise. +func (d *DependabotAlertState) GetDismissedComment() string { + if d == nil || d.DismissedComment == nil { + return "" + } + return *d.DismissedComment +} + +// GetDismissedReason returns the DismissedReason field if it's non-nil, zero value otherwise. +func (d *DependabotAlertState) GetDismissedReason() string { + if d == nil || d.DismissedReason == nil { + return "" + } + return *d.DismissedReason +} + +// GetCVEID returns the CVEID field if it's non-nil, zero value otherwise. +func (d *DependabotSecurityAdvisory) GetCVEID() string { + if d == nil || d.CVEID == nil { + return "" + } + return *d.CVEID +} + +// GetCVSS returns the CVSS field. +func (d *DependabotSecurityAdvisory) GetCVSS() *AdvisoryCVSS { + if d == nil { + return nil + } + return d.CVSS +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (d *DependabotSecurityAdvisory) GetDescription() string { + if d == nil || d.Description == nil { + return "" + } + return *d.Description +} + +// GetEPSS returns the EPSS field. +func (d *DependabotSecurityAdvisory) GetEPSS() *AdvisoryEPSS { + if d == nil { + return nil + } + return d.EPSS +} + +// GetGHSAID returns the GHSAID field if it's non-nil, zero value otherwise. +func (d *DependabotSecurityAdvisory) GetGHSAID() string { + if d == nil || d.GHSAID == nil { + return "" + } + return *d.GHSAID +} + +// GetPublishedAt returns the PublishedAt field if it's non-nil, zero value otherwise. +func (d *DependabotSecurityAdvisory) GetPublishedAt() Timestamp { + if d == nil || d.PublishedAt == nil { + return Timestamp{} + } + return *d.PublishedAt +} + +// GetSeverity returns the Severity field if it's non-nil, zero value otherwise. +func (d *DependabotSecurityAdvisory) GetSeverity() string { + if d == nil || d.Severity == nil { + return "" + } + return *d.Severity +} + +// GetSummary returns the Summary field if it's non-nil, zero value otherwise. +func (d *DependabotSecurityAdvisory) GetSummary() string { + if d == nil || d.Summary == nil { + return "" + } + return *d.Summary +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (d *DependabotSecurityAdvisory) GetUpdatedAt() Timestamp { + if d == nil || d.UpdatedAt == nil { + return Timestamp{} + } + return *d.UpdatedAt +} + +// GetWithdrawnAt returns the WithdrawnAt field if it's non-nil, zero value otherwise. +func (d *DependabotSecurityAdvisory) GetWithdrawnAt() Timestamp { + if d == nil || d.WithdrawnAt == nil { + return Timestamp{} + } + return *d.WithdrawnAt +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (d *DependabotSecurityUpdates) GetStatus() string { + if d == nil || d.Status == nil { + return "" + } + return *d.Status +} + +// GetManifestPath returns the ManifestPath field if it's non-nil, zero value otherwise. +func (d *Dependency) GetManifestPath() string { + if d == nil || d.ManifestPath == nil { + return "" + } + return *d.ManifestPath +} + +// GetPackage returns the Package field. +func (d *Dependency) GetPackage() *VulnerabilityPackage { + if d == nil { + return nil + } + return d.Package +} + +// GetScope returns the Scope field if it's non-nil, zero value otherwise. +func (d *Dependency) GetScope() string { + if d == nil || d.Scope == nil { + return "" + } + return *d.Scope +} + +// GetLabeledRunners returns the LabeledRunners field if it's non-nil, zero value otherwise. +func (d *DependencyGraphAutosubmitActionOptions) GetLabeledRunners() bool { + if d == nil || d.LabeledRunners == nil { + return false + } + return *d.LabeledRunners +} + +// GetDetector returns the Detector field. +func (d *DependencyGraphSnapshot) GetDetector() *DependencyGraphSnapshotDetector { + if d == nil { + return nil + } + return d.Detector +} + +// GetJob returns the Job field. +func (d *DependencyGraphSnapshot) GetJob() *DependencyGraphSnapshotJob { + if d == nil { + return nil + } + return d.Job +} + +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshot) GetRef() string { + if d == nil || d.Ref == nil { + return "" + } + return *d.Ref +} + +// GetScanned returns the Scanned field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshot) GetScanned() Timestamp { + if d == nil || d.Scanned == nil { + return Timestamp{} + } + return *d.Scanned +} + +// GetSha returns the Sha field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshot) GetSha() string { + if d == nil || d.Sha == nil { + return "" + } + return *d.Sha +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotCreationData) GetCreatedAt() Timestamp { + if d == nil || d.CreatedAt == nil { + return Timestamp{} + } + return *d.CreatedAt +} + +// GetMessage returns the Message field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotCreationData) GetMessage() string { + if d == nil || d.Message == nil { + return "" + } + return *d.Message +} + +// GetResult returns the Result field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotCreationData) GetResult() string { + if d == nil || d.Result == nil { + return "" + } + return *d.Result +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotDetector) GetName() string { + if d == nil || d.Name == nil { + return "" + } + return *d.Name +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotDetector) GetURL() string { + if d == nil || d.URL == nil { + return "" + } + return *d.URL +} + +// GetVersion returns the Version field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotDetector) GetVersion() string { + if d == nil || d.Version == nil { + return "" + } + return *d.Version +} + +// GetCorrelator returns the Correlator field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotJob) GetCorrelator() string { + if d == nil || d.Correlator == nil { + return "" + } + return *d.Correlator +} + +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotJob) GetHTMLURL() string { + if d == nil || d.HTMLURL == nil { + return "" + } + return *d.HTMLURL +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotJob) GetID() string { + if d == nil || d.ID == nil { + return "" + } + return *d.ID +} + +// GetFile returns the File field. +func (d *DependencyGraphSnapshotManifest) GetFile() *DependencyGraphSnapshotManifestFile { + if d == nil { + return nil + } + return d.File +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotManifest) GetName() string { + if d == nil || d.Name == nil { + return "" + } + return *d.Name +} + +// GetSourceLocation returns the SourceLocation field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotManifestFile) GetSourceLocation() string { + if d == nil || d.SourceLocation == nil { + return "" + } + return *d.SourceLocation +} + +// GetPackageURL returns the PackageURL field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotResolvedDependency) GetPackageURL() string { + if d == nil || d.PackageURL == nil { + return "" + } + return *d.PackageURL +} + +// GetRelationship returns the Relationship field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotResolvedDependency) GetRelationship() string { + if d == nil || d.Relationship == nil { + return "" + } + return *d.Relationship +} + +// GetScope returns the Scope field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotResolvedDependency) GetScope() string { + if d == nil || d.Scope == nil { + return "" + } + return *d.Scope +} + +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (d *DeployKeyEvent) GetAction() string { + if d == nil || d.Action == nil { + return "" + } + return *d.Action +} + +// GetInstallation returns the Installation field. +func (d *DeployKeyEvent) GetInstallation() *Installation { + if d == nil { + return nil + } + return d.Installation +} + +// GetKey returns the Key field. +func (d *DeployKeyEvent) GetKey() *Key { + if d == nil { + return nil + } + return d.Key +} + +// GetOrganization returns the Organization field. +func (d *DeployKeyEvent) GetOrganization() *Organization { + if d == nil { + return nil + } + return d.Organization +} + +// GetRepo returns the Repo field. +func (d *DeployKeyEvent) GetRepo() *Repository { + if d == nil { + return nil + } + return d.Repo +} + +// GetSender returns the Sender field. +func (d *DeployKeyEvent) GetSender() *User { + if d == nil { + return nil + } + return d.Sender +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (d *Deployment) GetCreatedAt() Timestamp { + if d == nil || d.CreatedAt == nil { + return Timestamp{} + } + return *d.CreatedAt +} + +// GetCreator returns the Creator field. +func (d *Deployment) GetCreator() *User { + if d == nil { + return nil + } + return d.Creator +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (d *Deployment) GetDescription() string { + if d == nil || d.Description == nil { + return "" + } + return *d.Description +} + +// GetEnvironment returns the Environment field if it's non-nil, zero value otherwise. +func (d *Deployment) GetEnvironment() string { + if d == nil || d.Environment == nil { + return "" + } + return *d.Environment +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (d *Deployment) GetID() int64 { + if d == nil || d.ID == nil { + return 0 + } + return *d.ID +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (d *Deployment) GetNodeID() string { + if d == nil || d.NodeID == nil { + return "" + } + return *d.NodeID +} + +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (d *Deployment) GetRef() string { + if d == nil || d.Ref == nil { + return "" + } + return *d.Ref +} + +// GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise. +func (d *Deployment) GetRepositoryURL() string { + if d == nil || d.RepositoryURL == nil { + return "" + } + return *d.RepositoryURL +} + +// GetSHA returns the SHA field if it's non-nil, zero value otherwise. +func (d *Deployment) GetSHA() string { + if d == nil || d.SHA == nil { + return "" + } + return *d.SHA +} + +// GetStatusesURL returns the StatusesURL field if it's non-nil, zero value otherwise. +func (d *Deployment) GetStatusesURL() string { + if d == nil || d.StatusesURL == nil { + return "" + } + return *d.StatusesURL +} + +// GetTask returns the Task field if it's non-nil, zero value otherwise. +func (d *Deployment) GetTask() string { + if d == nil || d.Task == nil { + return "" + } + return *d.Task +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (d *Deployment) GetUpdatedAt() Timestamp { + if d == nil || d.UpdatedAt == nil { + return Timestamp{} + } + return *d.UpdatedAt +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (d *Deployment) GetURL() string { + if d == nil || d.URL == nil { + return "" + } + return *d.URL +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (d *DeploymentBranchPolicy) GetID() int64 { + if d == nil || d.ID == nil { + return 0 + } + return *d.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (d *DeploymentBranchPolicy) GetName() string { + if d == nil || d.Name == nil { + return "" + } + return *d.Name +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (d *DeploymentBranchPolicy) GetNodeID() string { + if d == nil || d.NodeID == nil { + return "" + } + return *d.NodeID +} + +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (d *DeploymentBranchPolicy) GetType() string { + if d == nil || d.Type == nil { + return "" + } + return *d.Type +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (d *DeploymentBranchPolicyRequest) GetName() string { + if d == nil || d.Name == nil { + return "" + } + return *d.Name +} + +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (d *DeploymentBranchPolicyRequest) GetType() string { + if d == nil || d.Type == nil { + return "" + } + return *d.Type +} + +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (d *DeploymentBranchPolicyResponse) GetTotalCount() int { + if d == nil || d.TotalCount == nil { + return 0 + } + return *d.TotalCount +} + +// GetDeployment returns the Deployment field. +func (d *DeploymentEvent) GetDeployment() *Deployment { + if d == nil { + return nil + } + return d.Deployment +} + +// GetInstallation returns the Installation field. +func (d *DeploymentEvent) GetInstallation() *Installation { + if d == nil { + return nil + } + return d.Installation +} + +// GetOrg returns the Org field. +func (d *DeploymentEvent) GetOrg() *Organization { + if d == nil { + return nil + } + return d.Org +} + +// GetRepo returns the Repo field. +func (d *DeploymentEvent) GetRepo() *Repository { + if d == nil { + return nil + } + return d.Repo +} + +// GetSender returns the Sender field. +func (d *DeploymentEvent) GetSender() *User { + if d == nil { + return nil + } + return d.Sender +} + +// GetWorkflow returns the Workflow field. +func (d *DeploymentEvent) GetWorkflow() *Workflow { + if d == nil { + return nil + } + return d.Workflow } // GetWorkflowRun returns the WorkflowRun field. @@ -8614,6 +9990,14 @@ func (h *Hook) GetID() int64 { return *h.ID } +// GetLastResponse returns the LastResponse map if it's non-nil, an empty map otherwise. +func (h *Hook) GetLastResponse() map[string]any { + if h == nil || h.LastResponse == nil { + return map[string]any{} + } + return h.LastResponse +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (h *Hook) GetName() string { if h == nil || h.Name == nil { @@ -8854,6 +10238,134 @@ func (h *HookStats) GetTotalHooks() int { return *h.TotalHooks } +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetID() int64 { + if h == nil || h.ID == nil { + return 0 + } + return *h.ID +} + +// GetImageDetails returns the ImageDetails field. +func (h *HostedRunner) GetImageDetails() *HostedRunnerImageDetail { + if h == nil { + return nil + } + return h.ImageDetails +} + +// GetLastActiveOn returns the LastActiveOn field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetLastActiveOn() Timestamp { + if h == nil || h.LastActiveOn == nil { + return Timestamp{} + } + return *h.LastActiveOn +} + +// GetMachineSizeDetails returns the MachineSizeDetails field. +func (h *HostedRunner) GetMachineSizeDetails() *HostedRunnerMachineSpec { + if h == nil { + return nil + } + return h.MachineSizeDetails +} + +// GetMaximumRunners returns the MaximumRunners field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetMaximumRunners() int64 { + if h == nil || h.MaximumRunners == nil { + return 0 + } + return *h.MaximumRunners +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetName() string { + if h == nil || h.Name == nil { + return "" + } + return *h.Name +} + +// GetPlatform returns the Platform field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetPlatform() string { + if h == nil || h.Platform == nil { + return "" + } + return *h.Platform +} + +// GetPublicIPEnabled returns the PublicIPEnabled field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetPublicIPEnabled() bool { + if h == nil || h.PublicIPEnabled == nil { + return false + } + return *h.PublicIPEnabled +} + +// GetRunnerGroupID returns the RunnerGroupID field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetRunnerGroupID() int64 { + if h == nil || h.RunnerGroupID == nil { + return 0 + } + return *h.RunnerGroupID +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetStatus() string { + if h == nil || h.Status == nil { + return "" + } + return *h.Status +} + +// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. +func (h *HostedRunnerImageDetail) GetDisplayName() string { + if h == nil || h.DisplayName == nil { + return "" + } + return *h.DisplayName +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (h *HostedRunnerImageDetail) GetID() string { + if h == nil || h.ID == nil { + return "" + } + return *h.ID +} + +// GetSizeGB returns the SizeGB field if it's non-nil, zero value otherwise. +func (h *HostedRunnerImageDetail) GetSizeGB() int64 { + if h == nil || h.SizeGB == nil { + return 0 + } + return *h.SizeGB +} + +// GetSource returns the Source field if it's non-nil, zero value otherwise. +func (h *HostedRunnerImageDetail) GetSource() string { + if h == nil || h.Source == nil { + return "" + } + return *h.Source +} + +// GetVersion returns the Version field if it's non-nil, zero value otherwise. +func (h *HostedRunnerImageDetail) GetVersion() string { + if h == nil || h.Version == nil { + return "" + } + return *h.Version +} + +// GetPublicIPs returns the PublicIPs field. +func (h *HostedRunnerPublicIPLimits) GetPublicIPs() *PublicIPUsage { + if h == nil { + return nil + } + return h.PublicIPs +} + // GetGroupDescription returns the GroupDescription field if it's non-nil, zero value otherwise. func (i *IDPGroup) GetGroupDescription() string { if i == nil || i.GroupDescription == nil { @@ -9275,31 +10787,79 @@ func (i *InstallationPermissions) GetActionsVariables() string { if i == nil || i.ActionsVariables == nil { return "" } - return *i.ActionsVariables + return *i.ActionsVariables +} + +// GetAdministration returns the Administration field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetAdministration() string { + if i == nil || i.Administration == nil { + return "" + } + return *i.Administration +} + +// GetAttestations returns the Attestations field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetAttestations() string { + if i == nil || i.Attestations == nil { + return "" + } + return *i.Attestations +} + +// GetBlocking returns the Blocking field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetBlocking() string { + if i == nil || i.Blocking == nil { + return "" + } + return *i.Blocking +} + +// GetChecks returns the Checks field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetChecks() string { + if i == nil || i.Checks == nil { + return "" + } + return *i.Checks +} + +// GetCodespaces returns the Codespaces field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetCodespaces() string { + if i == nil || i.Codespaces == nil { + return "" + } + return *i.Codespaces +} + +// GetCodespacesLifecycleAdmin returns the CodespacesLifecycleAdmin field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetCodespacesLifecycleAdmin() string { + if i == nil || i.CodespacesLifecycleAdmin == nil { + return "" + } + return *i.CodespacesLifecycleAdmin } -// GetAdministration returns the Administration field if it's non-nil, zero value otherwise. -func (i *InstallationPermissions) GetAdministration() string { - if i == nil || i.Administration == nil { +// GetCodespacesMetadata returns the CodespacesMetadata field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetCodespacesMetadata() string { + if i == nil || i.CodespacesMetadata == nil { return "" } - return *i.Administration + return *i.CodespacesMetadata } -// GetBlocking returns the Blocking field if it's non-nil, zero value otherwise. -func (i *InstallationPermissions) GetBlocking() string { - if i == nil || i.Blocking == nil { +// GetCodespacesSecrets returns the CodespacesSecrets field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetCodespacesSecrets() string { + if i == nil || i.CodespacesSecrets == nil { return "" } - return *i.Blocking + return *i.CodespacesSecrets } -// GetChecks returns the Checks field if it's non-nil, zero value otherwise. -func (i *InstallationPermissions) GetChecks() string { - if i == nil || i.Checks == nil { +// GetCodespacesUserSecrets returns the CodespacesUserSecrets field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetCodespacesUserSecrets() string { + if i == nil || i.CodespacesUserSecrets == nil { return "" } - return *i.Checks + return *i.CodespacesUserSecrets } // GetContentReferences returns the ContentReferences field if it's non-nil, zero value otherwise. @@ -9318,6 +10878,22 @@ func (i *InstallationPermissions) GetContents() string { return *i.Contents } +// GetCopilotMessages returns the CopilotMessages field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetCopilotMessages() string { + if i == nil || i.CopilotMessages == nil { + return "" + } + return *i.CopilotMessages +} + +// GetDependabotSecrets returns the DependabotSecrets field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetDependabotSecrets() string { + if i == nil || i.DependabotSecrets == nil { + return "" + } + return *i.DependabotSecrets +} + // GetDeployments returns the Deployments field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetDeployments() string { if i == nil || i.Deployments == nil { @@ -9326,6 +10902,14 @@ func (i *InstallationPermissions) GetDeployments() string { return *i.Deployments } +// GetDiscussions returns the Discussions field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetDiscussions() string { + if i == nil || i.Discussions == nil { + return "" + } + return *i.Discussions +} + // GetEmails returns the Emails field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetEmails() string { if i == nil || i.Emails == nil { @@ -9350,6 +10934,38 @@ func (i *InstallationPermissions) GetFollowers() string { return *i.Followers } +// GetGists returns the Gists field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetGists() string { + if i == nil || i.Gists == nil { + return "" + } + return *i.Gists +} + +// GetGitSigningSSHPublicKeys returns the GitSigningSSHPublicKeys field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetGitSigningSSHPublicKeys() string { + if i == nil || i.GitSigningSSHPublicKeys == nil { + return "" + } + return *i.GitSigningSSHPublicKeys +} + +// GetGPGKeys returns the GPGKeys field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetGPGKeys() string { + if i == nil || i.GPGKeys == nil { + return "" + } + return *i.GPGKeys +} + +// GetInteractionLimits returns the InteractionLimits field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetInteractionLimits() string { + if i == nil || i.InteractionLimits == nil { + return "" + } + return *i.InteractionLimits +} + // GetIssues returns the Issues field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetIssues() string { if i == nil || i.Issues == nil { @@ -9358,6 +10974,14 @@ func (i *InstallationPermissions) GetIssues() string { return *i.Issues } +// GetKeys returns the Keys field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetKeys() string { + if i == nil || i.Keys == nil { + return "" + } + return *i.Keys +} + // GetMembers returns the Members field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetMembers() string { if i == nil || i.Members == nil { @@ -9366,6 +10990,14 @@ func (i *InstallationPermissions) GetMembers() string { return *i.Members } +// GetMergeQueues returns the MergeQueues field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetMergeQueues() string { + if i == nil || i.MergeQueues == nil { + return "" + } + return *i.MergeQueues +} + // GetMetadata returns the Metadata field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetMetadata() string { if i == nil || i.Metadata == nil { @@ -9374,6 +11006,14 @@ func (i *InstallationPermissions) GetMetadata() string { return *i.Metadata } +// GetOrganizationActionsVariables returns the OrganizationActionsVariables field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationActionsVariables() string { + if i == nil || i.OrganizationActionsVariables == nil { + return "" + } + return *i.OrganizationActionsVariables +} + // GetOrganizationAdministration returns the OrganizationAdministration field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetOrganizationAdministration() string { if i == nil || i.OrganizationAdministration == nil { @@ -9382,6 +11022,54 @@ func (i *InstallationPermissions) GetOrganizationAdministration() string { return *i.OrganizationAdministration } +// GetOrganizationAnnouncementBanners returns the OrganizationAnnouncementBanners field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationAnnouncementBanners() string { + if i == nil || i.OrganizationAnnouncementBanners == nil { + return "" + } + return *i.OrganizationAnnouncementBanners +} + +// GetOrganizationAPIInsights returns the OrganizationAPIInsights field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationAPIInsights() string { + if i == nil || i.OrganizationAPIInsights == nil { + return "" + } + return *i.OrganizationAPIInsights +} + +// GetOrganizationCodespaces returns the OrganizationCodespaces field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationCodespaces() string { + if i == nil || i.OrganizationCodespaces == nil { + return "" + } + return *i.OrganizationCodespaces +} + +// GetOrganizationCodespacesSecrets returns the OrganizationCodespacesSecrets field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationCodespacesSecrets() string { + if i == nil || i.OrganizationCodespacesSecrets == nil { + return "" + } + return *i.OrganizationCodespacesSecrets +} + +// GetOrganizationCodespacesSettings returns the OrganizationCodespacesSettings field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationCodespacesSettings() string { + if i == nil || i.OrganizationCodespacesSettings == nil { + return "" + } + return *i.OrganizationCodespacesSettings +} + +// GetOrganizationCopilotSeatManagement returns the OrganizationCopilotSeatManagement field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationCopilotSeatManagement() string { + if i == nil || i.OrganizationCopilotSeatManagement == nil { + return "" + } + return *i.OrganizationCopilotSeatManagement +} + // GetOrganizationCustomOrgRoles returns the OrganizationCustomOrgRoles field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetOrganizationCustomOrgRoles() string { if i == nil || i.OrganizationCustomOrgRoles == nil { @@ -9406,6 +11094,22 @@ func (i *InstallationPermissions) GetOrganizationCustomRoles() string { return *i.OrganizationCustomRoles } +// GetOrganizationDependabotSecrets returns the OrganizationDependabotSecrets field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationDependabotSecrets() string { + if i == nil || i.OrganizationDependabotSecrets == nil { + return "" + } + return *i.OrganizationDependabotSecrets +} + +// GetOrganizationEvents returns the OrganizationEvents field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationEvents() string { + if i == nil || i.OrganizationEvents == nil { + return "" + } + return *i.OrganizationEvents +} + // GetOrganizationHooks returns the OrganizationHooks field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetOrganizationHooks() string { if i == nil || i.OrganizationHooks == nil { @@ -9414,6 +11118,14 @@ func (i *InstallationPermissions) GetOrganizationHooks() string { return *i.OrganizationHooks } +// GetOrganizationKnowledgeBases returns the OrganizationKnowledgeBases field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationKnowledgeBases() string { + if i == nil || i.OrganizationKnowledgeBases == nil { + return "" + } + return *i.OrganizationKnowledgeBases +} + // GetOrganizationPackages returns the OrganizationPackages field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetOrganizationPackages() string { if i == nil || i.OrganizationPackages == nil { @@ -9502,6 +11214,22 @@ func (i *InstallationPermissions) GetPages() string { return *i.Pages } +// GetPlan returns the Plan field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetPlan() string { + if i == nil || i.Plan == nil { + return "" + } + return *i.Plan +} + +// GetProfile returns the Profile field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetProfile() string { + if i == nil || i.Profile == nil { + return "" + } + return *i.Profile +} + // GetPullRequests returns the PullRequests field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetPullRequests() string { if i == nil || i.PullRequests == nil { @@ -9510,6 +11238,22 @@ func (i *InstallationPermissions) GetPullRequests() string { return *i.PullRequests } +// GetRepositoryAdvisories returns the RepositoryAdvisories field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetRepositoryAdvisories() string { + if i == nil || i.RepositoryAdvisories == nil { + return "" + } + return *i.RepositoryAdvisories +} + +// GetRepositoryCustomProperties returns the RepositoryCustomProperties field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetRepositoryCustomProperties() string { + if i == nil || i.RepositoryCustomProperties == nil { + return "" + } + return *i.RepositoryCustomProperties +} + // GetRepositoryHooks returns the RepositoryHooks field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetRepositoryHooks() string { if i == nil || i.RepositoryHooks == nil { @@ -9566,6 +11310,14 @@ func (i *InstallationPermissions) GetSingleFile() string { return *i.SingleFile } +// GetStarring returns the Starring field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetStarring() string { + if i == nil || i.Starring == nil { + return "" + } + return *i.Starring +} + // GetStatuses returns the Statuses field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetStatuses() string { if i == nil || i.Statuses == nil { @@ -9582,6 +11334,14 @@ func (i *InstallationPermissions) GetTeamDiscussions() string { return *i.TeamDiscussions } +// GetUserEvents returns the UserEvents field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetUserEvents() string { + if i == nil || i.UserEvents == nil { + return "" + } + return *i.UserEvents +} + // GetVulnerabilityAlerts returns the VulnerabilityAlerts field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetVulnerabilityAlerts() string { if i == nil || i.VulnerabilityAlerts == nil { @@ -9590,6 +11350,14 @@ func (i *InstallationPermissions) GetVulnerabilityAlerts() string { return *i.VulnerabilityAlerts } +// GetWatching returns the Watching field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetWatching() string { + if i == nil || i.Watching == nil { + return "" + } + return *i.Watching +} + // GetWorkflows returns the Workflows field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetWorkflows() string { if i == nil || i.Workflows == nil { @@ -10110,6 +11878,14 @@ func (i *Issue) GetTitle() string { return *i.Title } +// GetType returns the Type field. +func (i *Issue) GetType() *IssueType { + if i == nil { + return nil + } + return i.Type +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (i *Issue) GetUpdatedAt() Timestamp { if i == nil || i.UpdatedAt == nil { @@ -10390,14 +12166,6 @@ func (i *IssueEvent) GetPerformedViaGithubApp() *App { return i.PerformedViaGithubApp } -// GetProjectCard returns the ProjectCard field. -func (i *IssueEvent) GetProjectCard() *ProjectCard { - if i == nil { - return nil - } - return i.ProjectCard -} - // GetRename returns the Rename field. func (i *IssueEvent) GetRename() *Rename { if i == nil { @@ -10694,6 +12462,14 @@ func (i *IssueRequest) GetTitle() string { return *i.Title } +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (i *IssueRequest) GetType() string { + if i == nil || i.Type == nil { + return "" + } + return *i.Type +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (i *IssuesEvent) GetAction() string { if i == nil || i.Action == nil { @@ -10814,6 +12590,62 @@ func (i *IssueStats) GetTotalIssues() int { return *i.TotalIssues } +// GetColor returns the Color field if it's non-nil, zero value otherwise. +func (i *IssueType) GetColor() string { + if i == nil || i.Color == nil { + return "" + } + return *i.Color +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (i *IssueType) GetCreatedAt() Timestamp { + if i == nil || i.CreatedAt == nil { + return Timestamp{} + } + return *i.CreatedAt +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (i *IssueType) GetDescription() string { + if i == nil || i.Description == nil { + return "" + } + return *i.Description +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (i *IssueType) GetID() int64 { + if i == nil || i.ID == nil { + return 0 + } + return *i.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (i *IssueType) GetName() string { + if i == nil || i.Name == nil { + return "" + } + return *i.Name +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (i *IssueType) GetNodeID() string { + if i == nil || i.NodeID == nil { + return "" + } + return *i.NodeID +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (i *IssueType) GetUpdatedAt() Timestamp { + if i == nil || i.UpdatedAt == nil { + return Timestamp{} + } + return *i.UpdatedAt +} + // GetEncodedJITConfig returns the EncodedJITConfig field if it's non-nil, zero value otherwise. func (j *JITRunnerConfig) GetEncodedJITConfig() string { if j == nil || j.EncodedJITConfig == nil { @@ -11219,7 +13051,159 @@ func (l *License) GetURL() string { if l == nil || l.URL == nil { return "" } - return *l.URL + return *l.URL +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (l *LicenseCheck) GetStatus() string { + if l == nil || l.Status == nil { + return "" + } + return *l.Status +} + +// GetAdvancedSecurityEnabled returns the AdvancedSecurityEnabled field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetAdvancedSecurityEnabled() bool { + if l == nil || l.AdvancedSecurityEnabled == nil { + return false + } + return *l.AdvancedSecurityEnabled +} + +// GetAdvancedSecuritySeats returns the AdvancedSecuritySeats field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetAdvancedSecuritySeats() int { + if l == nil || l.AdvancedSecuritySeats == nil { + return 0 + } + return *l.AdvancedSecuritySeats +} + +// GetClusterSupport returns the ClusterSupport field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetClusterSupport() bool { + if l == nil || l.ClusterSupport == nil { + return false + } + return *l.ClusterSupport +} + +// GetCompany returns the Company field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetCompany() string { + if l == nil || l.Company == nil { + return "" + } + return *l.Company +} + +// GetCroquetSupport returns the CroquetSupport field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetCroquetSupport() bool { + if l == nil || l.CroquetSupport == nil { + return false + } + return *l.CroquetSupport +} + +// GetCustomTerms returns the CustomTerms field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetCustomTerms() bool { + if l == nil || l.CustomTerms == nil { + return false + } + return *l.CustomTerms +} + +// GetEvaluation returns the Evaluation field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetEvaluation() bool { + if l == nil || l.Evaluation == nil { + return false + } + return *l.Evaluation +} + +// GetExpireAt returns the ExpireAt field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetExpireAt() Timestamp { + if l == nil || l.ExpireAt == nil { + return Timestamp{} + } + return *l.ExpireAt +} + +// GetInsightsEnabled returns the InsightsEnabled field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetInsightsEnabled() bool { + if l == nil || l.InsightsEnabled == nil { + return false + } + return *l.InsightsEnabled +} + +// GetInsightsExpireAt returns the InsightsExpireAt field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetInsightsExpireAt() Timestamp { + if l == nil || l.InsightsExpireAt == nil { + return Timestamp{} + } + return *l.InsightsExpireAt +} + +// GetLearningLabEvaluationExpires returns the LearningLabEvaluationExpires field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetLearningLabEvaluationExpires() Timestamp { + if l == nil || l.LearningLabEvaluationExpires == nil { + return Timestamp{} + } + return *l.LearningLabEvaluationExpires +} + +// GetLearningLabSeats returns the LearningLabSeats field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetLearningLabSeats() int { + if l == nil || l.LearningLabSeats == nil { + return 0 + } + return *l.LearningLabSeats +} + +// GetPerpetual returns the Perpetual field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetPerpetual() bool { + if l == nil || l.Perpetual == nil { + return false + } + return *l.Perpetual +} + +// GetReferenceNumber returns the ReferenceNumber field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetReferenceNumber() string { + if l == nil || l.ReferenceNumber == nil { + return "" + } + return *l.ReferenceNumber +} + +// GetSeats returns the Seats field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetSeats() int { + if l == nil || l.Seats == nil { + return 0 + } + return *l.Seats +} + +// GetSSHAllowed returns the SSHAllowed field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetSSHAllowed() bool { + if l == nil || l.SSHAllowed == nil { + return false + } + return *l.SSHAllowed +} + +// GetSupportKey returns the SupportKey field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetSupportKey() string { + if l == nil || l.SupportKey == nil { + return "" + } + return *l.SupportKey +} + +// GetUnlimitedSeating returns the UnlimitedSeating field if it's non-nil, zero value otherwise. +func (l *LicenseStatus) GetUnlimitedSeating() bool { + if l == nil || l.UnlimitedSeating == nil { + return false + } + return *l.UnlimitedSeating } // GetFrom returns the From field if it's non-nil, zero value otherwise. @@ -11335,7 +13319,7 @@ func (l *ListCheckRunsResults) GetTotal() int { } // GetAppID returns the AppID field if it's non-nil, zero value otherwise. -func (l *ListCheckSuiteOptions) GetAppID() int { +func (l *ListCheckSuiteOptions) GetAppID() int64 { if l == nil || l.AppID == nil { return 0 } @@ -11366,14 +13350,6 @@ func (l *ListCodespaces) GetTotalCount() int { return *l.TotalCount } -// GetAffiliation returns the Affiliation field if it's non-nil, zero value otherwise. -func (l *ListCollaboratorOptions) GetAffiliation() string { - if l == nil || l.Affiliation == nil { - return "" - } - return *l.Affiliation -} - // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (l *ListCustomDeploymentRuleIntegrationsResponse) GetTotalCount() int { if l == nil || l.TotalCount == nil { @@ -11502,6 +13478,38 @@ func (l *ListRunnersOptions) GetName() string { return *l.Name } +// GetCount returns the Count field if it's non-nil, zero value otherwise. +func (l *ListSCIMProvisionedGroupsForEnterpriseOptions) GetCount() int { + if l == nil || l.Count == nil { + return 0 + } + return *l.Count +} + +// GetExcludedAttributes returns the ExcludedAttributes field if it's non-nil, zero value otherwise. +func (l *ListSCIMProvisionedGroupsForEnterpriseOptions) GetExcludedAttributes() string { + if l == nil || l.ExcludedAttributes == nil { + return "" + } + return *l.ExcludedAttributes +} + +// GetFilter returns the Filter field if it's non-nil, zero value otherwise. +func (l *ListSCIMProvisionedGroupsForEnterpriseOptions) GetFilter() string { + if l == nil || l.Filter == nil { + return "" + } + return *l.Filter +} + +// GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise. +func (l *ListSCIMProvisionedGroupsForEnterpriseOptions) GetStartIndex() int { + if l == nil || l.StartIndex == nil { + return 0 + } + return *l.StartIndex +} + // GetCount returns the Count field if it's non-nil, zero value otherwise. func (l *ListSCIMProvisionedIdentitiesOptions) GetCount() int { if l == nil || l.Count == nil { @@ -11574,6 +13582,102 @@ func (l *LockBranch) GetEnabled() bool { return *l.Enabled } +// GetHostname returns the Hostname field if it's non-nil, zero value otherwise. +func (m *MaintenanceOperationStatus) GetHostname() string { + if m == nil || m.Hostname == nil { + return "" + } + return *m.Hostname +} + +// GetMessage returns the Message field if it's non-nil, zero value otherwise. +func (m *MaintenanceOperationStatus) GetMessage() string { + if m == nil || m.Message == nil { + return "" + } + return *m.Message +} + +// GetUUID returns the UUID field if it's non-nil, zero value otherwise. +func (m *MaintenanceOperationStatus) GetUUID() string { + if m == nil || m.UUID == nil { + return "" + } + return *m.UUID +} + +// GetMaintenanceModeMessage returns the MaintenanceModeMessage field if it's non-nil, zero value otherwise. +func (m *MaintenanceOptions) GetMaintenanceModeMessage() string { + if m == nil || m.MaintenanceModeMessage == nil { + return "" + } + return *m.MaintenanceModeMessage +} + +// GetUUID returns the UUID field if it's non-nil, zero value otherwise. +func (m *MaintenanceOptions) GetUUID() string { + if m == nil || m.UUID == nil { + return "" + } + return *m.UUID +} + +// GetWhen returns the When field if it's non-nil, zero value otherwise. +func (m *MaintenanceOptions) GetWhen() string { + if m == nil || m.When == nil { + return "" + } + return *m.When +} + +// GetCanUnsetMaintenance returns the CanUnsetMaintenance field if it's non-nil, zero value otherwise. +func (m *MaintenanceStatus) GetCanUnsetMaintenance() bool { + if m == nil || m.CanUnsetMaintenance == nil { + return false + } + return *m.CanUnsetMaintenance +} + +// GetHostname returns the Hostname field if it's non-nil, zero value otherwise. +func (m *MaintenanceStatus) GetHostname() string { + if m == nil || m.Hostname == nil { + return "" + } + return *m.Hostname +} + +// GetMaintenanceModeMessage returns the MaintenanceModeMessage field if it's non-nil, zero value otherwise. +func (m *MaintenanceStatus) GetMaintenanceModeMessage() string { + if m == nil || m.MaintenanceModeMessage == nil { + return "" + } + return *m.MaintenanceModeMessage +} + +// GetScheduledTime returns the ScheduledTime field if it's non-nil, zero value otherwise. +func (m *MaintenanceStatus) GetScheduledTime() Timestamp { + if m == nil || m.ScheduledTime == nil { + return Timestamp{} + } + return *m.ScheduledTime +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (m *MaintenanceStatus) GetStatus() string { + if m == nil || m.Status == nil { + return "" + } + return *m.Status +} + +// GetUUID returns the UUID field if it's non-nil, zero value otherwise. +func (m *MaintenanceStatus) GetUUID() string { + if m == nil || m.UUID == nil { + return "" + } + return *m.UUID +} + // GetEffectiveDate returns the EffectiveDate field if it's non-nil, zero value otherwise. func (m *MarketplacePendingChange) GetEffectiveDate() Timestamp { if m == nil || m.EffectiveDate == nil { @@ -12230,6 +14334,14 @@ func (m *MergeGroupEvent) GetOrg() *Organization { return m.Org } +// GetReason returns the Reason field if it's non-nil, zero value otherwise. +func (m *MergeGroupEvent) GetReason() string { + if m == nil || m.Reason == nil { + return "" + } + return *m.Reason +} + // GetRepo returns the Repo field. func (m *MergeGroupEvent) GetRepo() *Repository { if m == nil { @@ -12702,6 +14814,102 @@ func (m *MostRecentInstance) GetState() string { return *m.State } +// GetComputeService returns the ComputeService field. +func (n *NetworkConfiguration) GetComputeService() *ComputeService { + if n == nil { + return nil + } + return n.ComputeService +} + +// GetCreatedOn returns the CreatedOn field if it's non-nil, zero value otherwise. +func (n *NetworkConfiguration) GetCreatedOn() Timestamp { + if n == nil || n.CreatedOn == nil { + return Timestamp{} + } + return *n.CreatedOn +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (n *NetworkConfiguration) GetID() string { + if n == nil || n.ID == nil { + return "" + } + return *n.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (n *NetworkConfiguration) GetName() string { + if n == nil || n.Name == nil { + return "" + } + return *n.Name +} + +// GetComputeService returns the ComputeService field. +func (n *NetworkConfigurationRequest) GetComputeService() *ComputeService { + if n == nil { + return nil + } + return n.ComputeService +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (n *NetworkConfigurationRequest) GetName() string { + if n == nil || n.Name == nil { + return "" + } + return *n.Name +} + +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (n *NetworkConfigurations) GetTotalCount() int64 { + if n == nil || n.TotalCount == nil { + return 0 + } + return *n.TotalCount +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (n *NetworkSettingsResource) GetID() string { + if n == nil || n.ID == nil { + return "" + } + return *n.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (n *NetworkSettingsResource) GetName() string { + if n == nil || n.Name == nil { + return "" + } + return *n.Name +} + +// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise. +func (n *NetworkSettingsResource) GetNetworkConfigurationID() string { + if n == nil || n.NetworkConfigurationID == nil { + return "" + } + return *n.NetworkConfigurationID +} + +// GetRegion returns the Region field if it's non-nil, zero value otherwise. +func (n *NetworkSettingsResource) GetRegion() string { + if n == nil || n.Region == nil { + return "" + } + return *n.Region +} + +// GetSubnetID returns the SubnetID field if it's non-nil, zero value otherwise. +func (n *NetworkSettingsResource) GetSubnetID() string { + if n == nil || n.SubnetID == nil { + return "" + } + return *n.SubnetID +} + // GetBase returns the Base field if it's non-nil, zero value otherwise. func (n *NewPullRequest) GetBase() string { if n == nil || n.Base == nil { @@ -12814,6 +15022,62 @@ func (n *NewTeam) GetPrivacy() string { return *n.Privacy } +// GetHostname returns the Hostname field if it's non-nil, zero value otherwise. +func (n *NodeDetails) GetHostname() string { + if n == nil || n.Hostname == nil { + return "" + } + return *n.Hostname +} + +// GetUUID returns the UUID field if it's non-nil, zero value otherwise. +func (n *NodeDetails) GetUUID() string { + if n == nil || n.UUID == nil { + return "" + } + return *n.UUID +} + +// GetTopology returns the Topology field if it's non-nil, zero value otherwise. +func (n *NodeMetadataStatus) GetTopology() string { + if n == nil || n.Topology == nil { + return "" + } + return *n.Topology +} + +// GetClusterRoles returns the ClusterRoles field if it's non-nil, zero value otherwise. +func (n *NodeQueryOptions) GetClusterRoles() string { + if n == nil || n.ClusterRoles == nil { + return "" + } + return *n.ClusterRoles +} + +// GetUUID returns the UUID field if it's non-nil, zero value otherwise. +func (n *NodeQueryOptions) GetUUID() string { + if n == nil || n.UUID == nil { + return "" + } + return *n.UUID +} + +// GetHostname returns the Hostname field if it's non-nil, zero value otherwise. +func (n *NodeReleaseVersion) GetHostname() string { + if n == nil || n.Hostname == nil { + return "" + } + return *n.Hostname +} + +// GetVersion returns the Version field. +func (n *NodeReleaseVersion) GetVersion() *ReleaseVersion { + if n == nil { + return nil + } + return n.Version +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (n *Notification) GetID() string { if n == nil || n.ID == nil { @@ -13451,143 +15715,55 @@ func (o *OrganizationEvent) GetSender() *User { if o == nil { return nil } - return o.Sender -} - -// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. -func (o *OrganizationInstallations) GetTotalCount() int { - if o == nil || o.TotalCount == nil { - return 0 - } - return *o.TotalCount -} - -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (o *OrgBlockEvent) GetAction() string { - if o == nil || o.Action == nil { - return "" - } - return *o.Action -} - -// GetBlockedUser returns the BlockedUser field. -func (o *OrgBlockEvent) GetBlockedUser() *User { - if o == nil { - return nil - } - return o.BlockedUser -} - -// GetInstallation returns the Installation field. -func (o *OrgBlockEvent) GetInstallation() *Installation { - if o == nil { - return nil - } - return o.Installation -} - -// GetOrganization returns the Organization field. -func (o *OrgBlockEvent) GetOrganization() *Organization { - if o == nil { - return nil - } - return o.Organization -} - -// GetSender returns the Sender field. -func (o *OrgBlockEvent) GetSender() *User { - if o == nil { - return nil - } - return o.Sender -} - -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetCreatedAt() Timestamp { - if o == nil || o.CreatedAt == nil { - return Timestamp{} - } - return *o.CreatedAt -} - -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetID() int64 { - if o == nil || o.ID == nil { - return 0 - } - return *o.ID -} - -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetName() string { - if o == nil || o.Name == nil { - return "" - } - return *o.Name -} - -// GetPath returns the Path field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetPath() string { - if o == nil || o.Path == nil { - return "" - } - return *o.Path -} - -// GetRef returns the Ref field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetRef() string { - if o == nil || o.Ref == nil { - return "" - } - return *o.Ref + return o.Sender } -// GetRepository returns the Repository field. -func (o *OrgRequiredWorkflow) GetRepository() *Repository { - if o == nil { - return nil +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (o *OrganizationInstallations) GetTotalCount() int { + if o == nil || o.TotalCount == nil { + return 0 } - return o.Repository + return *o.TotalCount } -// GetScope returns the Scope field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetScope() string { - if o == nil || o.Scope == nil { +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (o *OrgBlockEvent) GetAction() string { + if o == nil || o.Action == nil { return "" } - return *o.Scope + return *o.Action } -// GetSelectedRepositoriesURL returns the SelectedRepositoriesURL field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetSelectedRepositoriesURL() string { - if o == nil || o.SelectedRepositoriesURL == nil { - return "" +// GetBlockedUser returns the BlockedUser field. +func (o *OrgBlockEvent) GetBlockedUser() *User { + if o == nil { + return nil } - return *o.SelectedRepositoriesURL + return o.BlockedUser } -// GetState returns the State field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetState() string { - if o == nil || o.State == nil { - return "" +// GetInstallation returns the Installation field. +func (o *OrgBlockEvent) GetInstallation() *Installation { + if o == nil { + return nil } - return *o.State + return o.Installation } -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetUpdatedAt() Timestamp { - if o == nil || o.UpdatedAt == nil { - return Timestamp{} +// GetOrganization returns the Organization field. +func (o *OrgBlockEvent) GetOrganization() *Organization { + if o == nil { + return nil } - return *o.UpdatedAt + return o.Organization } -// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflows) GetTotalCount() int { - if o == nil || o.TotalCount == nil { - return 0 +// GetSender returns the Sender field. +func (o *OrgBlockEvent) GetSender() *User { + if o == nil { + return nil } - return *o.TotalCount + return o.Sender } // GetDisabledOrgs returns the DisabledOrgs field if it's non-nil, zero value otherwise. @@ -13646,6 +15822,22 @@ func (p *Package) GetCreatedAt() Timestamp { return *p.CreatedAt } +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (p *Package) GetDescription() string { + if p == nil || p.Description == nil { + return "" + } + return *p.Description +} + +// GetEcosystem returns the Ecosystem field if it's non-nil, zero value otherwise. +func (p *Package) GetEcosystem() string { + if p == nil || p.Ecosystem == nil { + return "" + } + return *p.Ecosystem +} + // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. func (p *Package) GetHTMLURL() string { if p == nil || p.HTMLURL == nil { @@ -13670,6 +15862,14 @@ func (p *Package) GetName() string { return *p.Name } +// GetNamespace returns the Namespace field if it's non-nil, zero value otherwise. +func (p *Package) GetNamespace() string { + if p == nil || p.Namespace == nil { + return "" + } + return *p.Namespace +} + // GetOwner returns the Owner field. func (p *Package) GetOwner() *User { if p == nil { @@ -13790,6 +15990,46 @@ func (p *PackageEvent) GetSender() *User { return p.Sender } +// GetLabels returns the Labels map if it's non-nil, an empty map otherwise. +func (p *PackageEventContainerMetadata) GetLabels() map[string]any { + if p == nil || p.Labels == nil { + return map[string]any{} + } + return p.Labels +} + +// GetManifest returns the Manifest map if it's non-nil, an empty map otherwise. +func (p *PackageEventContainerMetadata) GetManifest() map[string]any { + if p == nil || p.Manifest == nil { + return map[string]any{} + } + return p.Manifest +} + +// GetTag returns the Tag field. +func (p *PackageEventContainerMetadata) GetTag() *PackageEventContainerMetadataTag { + if p == nil { + return nil + } + return p.Tag +} + +// GetDigest returns the Digest field if it's non-nil, zero value otherwise. +func (p *PackageEventContainerMetadataTag) GetDigest() string { + if p == nil || p.Digest == nil { + return "" + } + return *p.Digest +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *PackageEventContainerMetadataTag) GetName() string { + if p == nil || p.Name == nil { + return "" + } + return *p.Name +} + // GetAuthor returns the Author field. func (p *PackageFile) GetAuthor() *User { if p == nil { @@ -13926,1424 +16166,1336 @@ func (p *PackageMetadata) GetPackageType() string { return *p.PackageType } -// GetAboutURL returns the AboutURL field if it's non-nil, zero value otherwise. -func (p *PackageRegistry) GetAboutURL() string { - if p == nil || p.AboutURL == nil { - return "" - } - return *p.AboutURL -} - -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (p *PackageRegistry) GetName() string { - if p == nil || p.Name == nil { - return "" - } - return *p.Name -} - -// GetType returns the Type field if it's non-nil, zero value otherwise. -func (p *PackageRegistry) GetType() string { - if p == nil || p.Type == nil { - return "" - } - return *p.Type -} - -// GetURL returns the URL field if it's non-nil, zero value otherwise. -func (p *PackageRegistry) GetURL() string { - if p == nil || p.URL == nil { - return "" - } - return *p.URL -} - -// GetVendor returns the Vendor field if it's non-nil, zero value otherwise. -func (p *PackageRegistry) GetVendor() string { - if p == nil || p.Vendor == nil { - return "" - } - return *p.Vendor -} - -// GetAuthor returns the Author field. -func (p *PackageRelease) GetAuthor() *User { - if p == nil { - return nil +// GetAuthor returns the Author map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetAuthor() map[string]string { + if p == nil || p.Author == nil { + return map[string]string{} } return p.Author } -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (p *PackageRelease) GetCreatedAt() Timestamp { - if p == nil || p.CreatedAt == nil { - return Timestamp{} +// GetBin returns the Bin map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetBin() map[string]any { + if p == nil || p.Bin == nil { + return map[string]any{} } - return *p.CreatedAt + return p.Bin } -// GetDraft returns the Draft field if it's non-nil, zero value otherwise. -func (p *PackageRelease) GetDraft() bool { - if p == nil || p.Draft == nil { - return false +// GetBugs returns the Bugs map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetBugs() map[string]string { + if p == nil || p.Bugs == nil { + return map[string]string{} } - return *p.Draft + return p.Bugs } -// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. -func (p *PackageRelease) GetHTMLURL() string { - if p == nil || p.HTMLURL == nil { +// GetCommitOID returns the CommitOID field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetCommitOID() string { + if p == nil || p.CommitOID == nil { return "" } - return *p.HTMLURL + return *p.CommitOID } -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (p *PackageRelease) GetID() int64 { - if p == nil || p.ID == nil { +// GetDeletedByID returns the DeletedByID field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetDeletedByID() int64 { + if p == nil || p.DeletedByID == nil { return 0 } - return *p.ID -} - -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (p *PackageRelease) GetName() string { - if p == nil || p.Name == nil { - return "" - } - return *p.Name -} - -// GetPrerelease returns the Prerelease field if it's non-nil, zero value otherwise. -func (p *PackageRelease) GetPrerelease() bool { - if p == nil || p.Prerelease == nil { - return false - } - return *p.Prerelease -} - -// GetPublishedAt returns the PublishedAt field if it's non-nil, zero value otherwise. -func (p *PackageRelease) GetPublishedAt() Timestamp { - if p == nil || p.PublishedAt == nil { - return Timestamp{} - } - return *p.PublishedAt -} - -// GetTagName returns the TagName field if it's non-nil, zero value otherwise. -func (p *PackageRelease) GetTagName() string { - if p == nil || p.TagName == nil { - return "" - } - return *p.TagName -} - -// GetTargetCommitish returns the TargetCommitish field if it's non-nil, zero value otherwise. -func (p *PackageRelease) GetTargetCommitish() string { - if p == nil || p.TargetCommitish == nil { - return "" - } - return *p.TargetCommitish -} - -// GetURL returns the URL field if it's non-nil, zero value otherwise. -func (p *PackageRelease) GetURL() string { - if p == nil || p.URL == nil { - return "" - } - return *p.URL -} - -// GetAuthor returns the Author field. -func (p *PackageVersion) GetAuthor() *User { - if p == nil { - return nil - } - return p.Author -} - -// GetBody returns the Body field if it's non-nil, zero value otherwise. -func (p *PackageVersion) GetBody() string { - if p == nil || p.Body == nil { - return "" - } - return *p.Body -} - -// GetBodyHTML returns the BodyHTML field if it's non-nil, zero value otherwise. -func (p *PackageVersion) GetBodyHTML() string { - if p == nil || p.BodyHTML == nil { - return "" - } - return *p.BodyHTML -} - -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (p *PackageVersion) GetCreatedAt() Timestamp { - if p == nil || p.CreatedAt == nil { - return Timestamp{} - } - return *p.CreatedAt + return *p.DeletedByID } -// GetDraft returns the Draft field if it's non-nil, zero value otherwise. -func (p *PackageVersion) GetDraft() bool { - if p == nil || p.Draft == nil { - return false +// GetDependencies returns the Dependencies map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetDependencies() map[string]string { + if p == nil || p.Dependencies == nil { + return map[string]string{} } - return *p.Draft + return p.Dependencies } -// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. -func (p *PackageVersion) GetHTMLURL() string { - if p == nil || p.HTMLURL == nil { +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetDescription() string { + if p == nil || p.Description == nil { return "" } - return *p.HTMLURL -} - -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (p *PackageVersion) GetID() int64 { - if p == nil || p.ID == nil { - return 0 - } - return *p.ID -} - -// GetInstallationCommand returns the InstallationCommand field if it's non-nil, zero value otherwise. -func (p *PackageVersion) GetInstallationCommand() string { - if p == nil || p.InstallationCommand == nil { - return "" + return *p.Description +} + +// GetDevDependencies returns the DevDependencies map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetDevDependencies() map[string]string { + if p == nil || p.DevDependencies == nil { + return map[string]string{} } - return *p.InstallationCommand + return p.DevDependencies } -// GetManifest returns the Manifest field if it's non-nil, zero value otherwise. -func (p *PackageVersion) GetManifest() string { - if p == nil || p.Manifest == nil { - return "" +// GetDirectories returns the Directories map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetDirectories() map[string]string { + if p == nil || p.Directories == nil { + return map[string]string{} } - return *p.Manifest + return p.Directories } -// GetMetadata returns the Metadata field. -func (p *PackageVersion) GetMetadata() *PackageMetadata { - if p == nil { - return nil +// GetDist returns the Dist map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetDist() map[string]string { + if p == nil || p.Dist == nil { + return map[string]string{} } - return p.Metadata + return p.Dist } -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (p *PackageVersion) GetName() string { - if p == nil || p.Name == nil { - return "" +// GetEngines returns the Engines map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetEngines() map[string]string { + if p == nil || p.Engines == nil { + return map[string]string{} } - return *p.Name + return p.Engines } -// GetPackageHTMLURL returns the PackageHTMLURL field if it's non-nil, zero value otherwise. -func (p *PackageVersion) GetPackageHTMLURL() string { - if p == nil || p.PackageHTMLURL == nil { +// GetGitHead returns the GitHead field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetGitHead() string { + if p == nil || p.GitHead == nil { return "" } - return *p.PackageHTMLURL + return *p.GitHead } -// GetPrerelease returns the Prerelease field if it's non-nil, zero value otherwise. -func (p *PackageVersion) GetPrerelease() bool { - if p == nil || p.Prerelease == nil { +// GetHasShrinkwrap returns the HasShrinkwrap field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetHasShrinkwrap() bool { + if p == nil || p.HasShrinkwrap == nil { return false } - return *p.Prerelease + return *p.HasShrinkwrap } -// GetRelease returns the Release field. -func (p *PackageVersion) GetRelease() *PackageRelease { - if p == nil { - return nil +// GetHomepage returns the Homepage field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetHomepage() string { + if p == nil || p.Homepage == nil { + return "" } - return p.Release + return *p.Homepage } -// GetSummary returns the Summary field if it's non-nil, zero value otherwise. -func (p *PackageVersion) GetSummary() string { - if p == nil || p.Summary == nil { +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetID() string { + if p == nil || p.ID == nil { return "" } - return *p.Summary + return *p.ID } -// GetTagName returns the TagName field if it's non-nil, zero value otherwise. -func (p *PackageVersion) GetTagName() string { - if p == nil || p.TagName == nil { +// GetInstallationCommand returns the InstallationCommand field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetInstallationCommand() string { + if p == nil || p.InstallationCommand == nil { return "" } - return *p.TagName + return *p.InstallationCommand } -// GetTargetCommitish returns the TargetCommitish field if it's non-nil, zero value otherwise. -func (p *PackageVersion) GetTargetCommitish() string { - if p == nil || p.TargetCommitish == nil { +// GetLicense returns the License field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetLicense() string { + if p == nil || p.License == nil { return "" } - return *p.TargetCommitish + return *p.License } -// GetTargetOID returns the TargetOID field if it's non-nil, zero value otherwise. -func (p *PackageVersion) GetTargetOID() string { - if p == nil || p.TargetOID == nil { +// GetMain returns the Main field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetMain() string { + if p == nil || p.Main == nil { return "" } - return *p.TargetOID + return *p.Main } -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (p *PackageVersion) GetUpdatedAt() Timestamp { - if p == nil || p.UpdatedAt == nil { - return Timestamp{} +// GetMan returns the Man map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetMan() map[string]any { + if p == nil || p.Man == nil { + return map[string]any{} } - return *p.UpdatedAt + return p.Man } -// GetURL returns the URL field if it's non-nil, zero value otherwise. -func (p *PackageVersion) GetURL() string { - if p == nil || p.URL == nil { +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetName() string { + if p == nil || p.Name == nil { return "" } - return *p.URL + return *p.Name } -// GetVersion returns the Version field if it's non-nil, zero value otherwise. -func (p *PackageVersion) GetVersion() string { - if p == nil || p.Version == nil { +// GetNodeVersion returns the NodeVersion field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetNodeVersion() string { + if p == nil || p.NodeVersion == nil { return "" } - return *p.Version + return *p.NodeVersion } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *Page) GetAction() string { - if p == nil || p.Action == nil { +// GetNPMUser returns the NPMUser field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetNPMUser() string { + if p == nil || p.NPMUser == nil { return "" } - return *p.Action + return *p.NPMUser } -// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. -func (p *Page) GetHTMLURL() string { - if p == nil || p.HTMLURL == nil { +// GetNPMVersion returns the NPMVersion field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetNPMVersion() string { + if p == nil || p.NPMVersion == nil { return "" } - return *p.HTMLURL + return *p.NPMVersion } -// GetPageName returns the PageName field if it's non-nil, zero value otherwise. -func (p *Page) GetPageName() string { - if p == nil || p.PageName == nil { - return "" +// GetOptionalDependencies returns the OptionalDependencies map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetOptionalDependencies() map[string]string { + if p == nil || p.OptionalDependencies == nil { + return map[string]string{} } - return *p.PageName + return p.OptionalDependencies } -// GetSHA returns the SHA field if it's non-nil, zero value otherwise. -func (p *Page) GetSHA() string { - if p == nil || p.SHA == nil { - return "" +// GetPeerDependencies returns the PeerDependencies map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetPeerDependencies() map[string]string { + if p == nil || p.PeerDependencies == nil { + return map[string]string{} } - return *p.SHA + return p.PeerDependencies } -// GetSummary returns the Summary field if it's non-nil, zero value otherwise. -func (p *Page) GetSummary() string { - if p == nil || p.Summary == nil { - return "" +// GetPublishedViaActions returns the PublishedViaActions field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetPublishedViaActions() bool { + if p == nil || p.PublishedViaActions == nil { + return false } - return *p.Summary + return *p.PublishedViaActions } -// GetTitle returns the Title field if it's non-nil, zero value otherwise. -func (p *Page) GetTitle() string { - if p == nil || p.Title == nil { +// GetReadme returns the Readme field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetReadme() string { + if p == nil || p.Readme == nil { return "" } - return *p.Title + return *p.Readme } -// GetBuild returns the Build field. -func (p *PageBuildEvent) GetBuild() *PagesBuild { - if p == nil { - return nil +// GetReleaseID returns the ReleaseID field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetReleaseID() int64 { + if p == nil || p.ReleaseID == nil { + return 0 } - return p.Build + return *p.ReleaseID } -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (p *PageBuildEvent) GetID() int64 { - if p == nil || p.ID == nil { - return 0 +// GetRepository returns the Repository map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetRepository() map[string]string { + if p == nil || p.Repository == nil { + return map[string]string{} } - return *p.ID + return p.Repository } -// GetInstallation returns the Installation field. -func (p *PageBuildEvent) GetInstallation() *Installation { - if p == nil { - return nil +// GetScripts returns the Scripts map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetScripts() map[string]any { + if p == nil || p.Scripts == nil { + return map[string]any{} } - return p.Installation + return p.Scripts } -// GetOrg returns the Org field. -func (p *PageBuildEvent) GetOrg() *Organization { - if p == nil { - return nil +// GetVersion returns the Version field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetVersion() string { + if p == nil || p.Version == nil { + return "" } - return p.Org + return *p.Version } -// GetRepo returns the Repo field. -func (p *PageBuildEvent) GetRepo() *Repository { - if p == nil { - return nil +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *PackageNugetMetadata) GetName() string { + if p == nil || p.Name == nil { + return "" } - return p.Repo + return *p.Name } -// GetSender returns the Sender field. -func (p *PageBuildEvent) GetSender() *User { - if p == nil { - return nil +// GetAboutURL returns the AboutURL field if it's non-nil, zero value otherwise. +func (p *PackageRegistry) GetAboutURL() string { + if p == nil || p.AboutURL == nil { + return "" } - return p.Sender + return *p.AboutURL } -// GetBuildType returns the BuildType field if it's non-nil, zero value otherwise. -func (p *Pages) GetBuildType() string { - if p == nil || p.BuildType == nil { +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *PackageRegistry) GetName() string { + if p == nil || p.Name == nil { return "" } - return *p.BuildType + return *p.Name } -// GetCNAME returns the CNAME field if it's non-nil, zero value otherwise. -func (p *Pages) GetCNAME() string { - if p == nil || p.CNAME == nil { +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (p *PackageRegistry) GetType() string { + if p == nil || p.Type == nil { return "" } - return *p.CNAME + return *p.Type } -// GetCustom404 returns the Custom404 field if it's non-nil, zero value otherwise. -func (p *Pages) GetCustom404() bool { - if p == nil || p.Custom404 == nil { - return false +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (p *PackageRegistry) GetURL() string { + if p == nil || p.URL == nil { + return "" } - return *p.Custom404 + return *p.URL } -// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. -func (p *Pages) GetHTMLURL() string { - if p == nil || p.HTMLURL == nil { +// GetVendor returns the Vendor field if it's non-nil, zero value otherwise. +func (p *PackageRegistry) GetVendor() string { + if p == nil || p.Vendor == nil { return "" } - return *p.HTMLURL + return *p.Vendor } -// GetHTTPSCertificate returns the HTTPSCertificate field. -func (p *Pages) GetHTTPSCertificate() *PagesHTTPSCertificate { +// GetAuthor returns the Author field. +func (p *PackageRelease) GetAuthor() *User { if p == nil { return nil } - return p.HTTPSCertificate + return p.Author } -// GetHTTPSEnforced returns the HTTPSEnforced field if it's non-nil, zero value otherwise. -func (p *Pages) GetHTTPSEnforced() bool { - if p == nil || p.HTTPSEnforced == nil { - return false +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (p *PackageRelease) GetCreatedAt() Timestamp { + if p == nil || p.CreatedAt == nil { + return Timestamp{} } - return *p.HTTPSEnforced + return *p.CreatedAt } -// GetPublic returns the Public field if it's non-nil, zero value otherwise. -func (p *Pages) GetPublic() bool { - if p == nil || p.Public == nil { +// GetDraft returns the Draft field if it's non-nil, zero value otherwise. +func (p *PackageRelease) GetDraft() bool { + if p == nil || p.Draft == nil { return false } - return *p.Public + return *p.Draft } -// GetSource returns the Source field. -func (p *Pages) GetSource() *PagesSource { - if p == nil { - return nil +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (p *PackageRelease) GetHTMLURL() string { + if p == nil || p.HTMLURL == nil { + return "" } - return p.Source + return *p.HTMLURL } -// GetStatus returns the Status field if it's non-nil, zero value otherwise. -func (p *Pages) GetStatus() string { - if p == nil || p.Status == nil { - return "" +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (p *PackageRelease) GetID() int64 { + if p == nil || p.ID == nil { + return 0 } - return *p.Status + return *p.ID } -// GetURL returns the URL field if it's non-nil, zero value otherwise. -func (p *Pages) GetURL() string { - if p == nil || p.URL == nil { +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *PackageRelease) GetName() string { + if p == nil || p.Name == nil { return "" } - return *p.URL + return *p.Name } -// GetCommit returns the Commit field if it's non-nil, zero value otherwise. -func (p *PagesBuild) GetCommit() string { - if p == nil || p.Commit == nil { - return "" +// GetPrerelease returns the Prerelease field if it's non-nil, zero value otherwise. +func (p *PackageRelease) GetPrerelease() bool { + if p == nil || p.Prerelease == nil { + return false } - return *p.Commit + return *p.Prerelease } -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (p *PagesBuild) GetCreatedAt() Timestamp { - if p == nil || p.CreatedAt == nil { +// GetPublishedAt returns the PublishedAt field if it's non-nil, zero value otherwise. +func (p *PackageRelease) GetPublishedAt() Timestamp { + if p == nil || p.PublishedAt == nil { return Timestamp{} } - return *p.CreatedAt + return *p.PublishedAt +} + +// GetTagName returns the TagName field if it's non-nil, zero value otherwise. +func (p *PackageRelease) GetTagName() string { + if p == nil || p.TagName == nil { + return "" + } + return *p.TagName } -// GetDuration returns the Duration field if it's non-nil, zero value otherwise. -func (p *PagesBuild) GetDuration() int { - if p == nil || p.Duration == nil { - return 0 +// GetTargetCommitish returns the TargetCommitish field if it's non-nil, zero value otherwise. +func (p *PackageRelease) GetTargetCommitish() string { + if p == nil || p.TargetCommitish == nil { + return "" } - return *p.Duration + return *p.TargetCommitish } -// GetError returns the Error field. -func (p *PagesBuild) GetError() *PagesError { - if p == nil { - return nil +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (p *PackageRelease) GetURL() string { + if p == nil || p.URL == nil { + return "" } - return p.Error + return *p.URL } -// GetPusher returns the Pusher field. -func (p *PagesBuild) GetPusher() *User { +// GetAuthor returns the Author field. +func (p *PackageVersion) GetAuthor() *User { if p == nil { return nil } - return p.Pusher + return p.Author } -// GetStatus returns the Status field if it's non-nil, zero value otherwise. -func (p *PagesBuild) GetStatus() string { - if p == nil || p.Status == nil { +// GetBodyHTML returns the BodyHTML field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetBodyHTML() string { + if p == nil || p.BodyHTML == nil { return "" } - return *p.Status + return *p.BodyHTML } -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (p *PagesBuild) GetUpdatedAt() Timestamp { - if p == nil || p.UpdatedAt == nil { - return Timestamp{} +// GetContainerMetadata returns the ContainerMetadata field. +func (p *PackageVersion) GetContainerMetadata() *PackageEventContainerMetadata { + if p == nil { + return nil } - return *p.UpdatedAt + return p.ContainerMetadata } -// GetURL returns the URL field if it's non-nil, zero value otherwise. -func (p *PagesBuild) GetURL() string { - if p == nil || p.URL == nil { - return "" +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetCreatedAt() Timestamp { + if p == nil || p.CreatedAt == nil { + return Timestamp{} } - return *p.URL + return *p.CreatedAt } -// GetCAAError returns the CAAError field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetCAAError() string { - if p == nil || p.CAAError == nil { - return "" +// GetDeletedAt returns the DeletedAt field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetDeletedAt() Timestamp { + if p == nil || p.DeletedAt == nil { + return Timestamp{} } - return *p.CAAError + return *p.DeletedAt } -// GetDNSResolves returns the DNSResolves field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetDNSResolves() bool { - if p == nil || p.DNSResolves == nil { - return false +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetDescription() string { + if p == nil || p.Description == nil { + return "" } - return *p.DNSResolves + return *p.Description } -// GetEnforcesHTTPS returns the EnforcesHTTPS field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetEnforcesHTTPS() bool { - if p == nil || p.EnforcesHTTPS == nil { +// GetDraft returns the Draft field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetDraft() bool { + if p == nil || p.Draft == nil { return false } - return *p.EnforcesHTTPS + return *p.Draft } -// GetHasCNAMERecord returns the HasCNAMERecord field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetHasCNAMERecord() bool { - if p == nil || p.HasCNAMERecord == nil { - return false +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetHTMLURL() string { + if p == nil || p.HTMLURL == nil { + return "" } - return *p.HasCNAMERecord + return *p.HTMLURL } -// GetHasMXRecordsPresent returns the HasMXRecordsPresent field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetHasMXRecordsPresent() bool { - if p == nil || p.HasMXRecordsPresent == nil { - return false +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetID() int64 { + if p == nil || p.ID == nil { + return 0 } - return *p.HasMXRecordsPresent + return *p.ID } -// GetHost returns the Host field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetHost() string { - if p == nil || p.Host == nil { +// GetInstallationCommand returns the InstallationCommand field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetInstallationCommand() string { + if p == nil || p.InstallationCommand == nil { return "" } - return *p.Host + return *p.InstallationCommand } -// GetHTTPSError returns the HTTPSError field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetHTTPSError() string { - if p == nil || p.HTTPSError == nil { +// GetLicense returns the License field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetLicense() string { + if p == nil || p.License == nil { return "" } - return *p.HTTPSError + return *p.License } -// GetIsApexDomain returns the IsApexDomain field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetIsApexDomain() bool { - if p == nil || p.IsApexDomain == nil { - return false +// GetManifest returns the Manifest field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetManifest() string { + if p == nil || p.Manifest == nil { + return "" } - return *p.IsApexDomain + return *p.Manifest } -// GetIsARecord returns the IsARecord field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetIsARecord() bool { - if p == nil || p.IsARecord == nil { - return false +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetName() string { + if p == nil || p.Name == nil { + return "" } - return *p.IsARecord + return *p.Name } -// GetIsCloudflareIP returns the IsCloudflareIP field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetIsCloudflareIP() bool { - if p == nil || p.IsCloudflareIP == nil { - return false +// GetNPMMetadata returns the NPMMetadata field. +func (p *PackageVersion) GetNPMMetadata() *PackageNPMMetadata { + if p == nil { + return nil } - return *p.IsCloudflareIP + return p.NPMMetadata } -// GetIsCNAMEToFastly returns the IsCNAMEToFastly field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetIsCNAMEToFastly() bool { - if p == nil || p.IsCNAMEToFastly == nil { - return false +// GetPackageHTMLURL returns the PackageHTMLURL field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetPackageHTMLURL() string { + if p == nil || p.PackageHTMLURL == nil { + return "" } - return *p.IsCNAMEToFastly + return *p.PackageHTMLURL } -// GetIsCNAMEToGithubUserDomain returns the IsCNAMEToGithubUserDomain field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetIsCNAMEToGithubUserDomain() bool { - if p == nil || p.IsCNAMEToGithubUserDomain == nil { - return false +// GetPackageURL returns the PackageURL field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetPackageURL() string { + if p == nil || p.PackageURL == nil { + return "" } - return *p.IsCNAMEToGithubUserDomain + return *p.PackageURL } -// GetIsCNAMEToPagesDotGithubDotCom returns the IsCNAMEToPagesDotGithubDotCom field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetIsCNAMEToPagesDotGithubDotCom() bool { - if p == nil || p.IsCNAMEToPagesDotGithubDotCom == nil { +// GetPrerelease returns the Prerelease field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetPrerelease() bool { + if p == nil || p.Prerelease == nil { return false } - return *p.IsCNAMEToPagesDotGithubDotCom + return *p.Prerelease } -// GetIsFastlyIP returns the IsFastlyIP field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetIsFastlyIP() bool { - if p == nil || p.IsFastlyIP == nil { - return false +// GetRelease returns the Release field. +func (p *PackageVersion) GetRelease() *PackageRelease { + if p == nil { + return nil } - return *p.IsFastlyIP + return p.Release } -// GetIsHTTPSEligible returns the IsHTTPSEligible field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetIsHTTPSEligible() bool { - if p == nil || p.IsHTTPSEligible == nil { - return false +// GetRubyMetadata returns the RubyMetadata map if it's non-nil, an empty map otherwise. +func (p *PackageVersion) GetRubyMetadata() map[string]any { + if p == nil || p.RubyMetadata == nil { + return map[string]any{} } - return *p.IsHTTPSEligible + return p.RubyMetadata } -// GetIsNonGithubPagesIPPresent returns the IsNonGithubPagesIPPresent field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetIsNonGithubPagesIPPresent() bool { - if p == nil || p.IsNonGithubPagesIPPresent == nil { - return false +// GetSourceURL returns the SourceURL field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetSourceURL() string { + if p == nil || p.SourceURL == nil { + return "" } - return *p.IsNonGithubPagesIPPresent + return *p.SourceURL } -// GetIsOldIPAddress returns the IsOldIPAddress field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetIsOldIPAddress() bool { - if p == nil || p.IsOldIPAddress == nil { - return false +// GetSummary returns the Summary field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetSummary() string { + if p == nil || p.Summary == nil { + return "" } - return *p.IsOldIPAddress + return *p.Summary } -// GetIsPagesDomain returns the IsPagesDomain field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetIsPagesDomain() bool { - if p == nil || p.IsPagesDomain == nil { - return false +// GetTagName returns the TagName field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetTagName() string { + if p == nil || p.TagName == nil { + return "" } - return *p.IsPagesDomain + return *p.TagName } -// GetIsPointedToGithubPagesIP returns the IsPointedToGithubPagesIP field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetIsPointedToGithubPagesIP() bool { - if p == nil || p.IsPointedToGithubPagesIP == nil { - return false +// GetTargetCommitish returns the TargetCommitish field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetTargetCommitish() string { + if p == nil || p.TargetCommitish == nil { + return "" } - return *p.IsPointedToGithubPagesIP + return *p.TargetCommitish } -// GetIsProxied returns the IsProxied field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetIsProxied() bool { - if p == nil || p.IsProxied == nil { - return false +// GetTargetOID returns the TargetOID field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetTargetOID() string { + if p == nil || p.TargetOID == nil { + return "" } - return *p.IsProxied + return *p.TargetOID } -// GetIsServedByPages returns the IsServedByPages field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetIsServedByPages() bool { - if p == nil || p.IsServedByPages == nil { - return false +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetUpdatedAt() Timestamp { + if p == nil || p.UpdatedAt == nil { + return Timestamp{} } - return *p.IsServedByPages + return *p.UpdatedAt } -// GetIsValid returns the IsValid field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetIsValid() bool { - if p == nil || p.IsValid == nil { - return false +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetURL() string { + if p == nil || p.URL == nil { + return "" } - return *p.IsValid + return *p.URL } -// GetIsValidDomain returns the IsValidDomain field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetIsValidDomain() bool { - if p == nil || p.IsValidDomain == nil { - return false +// GetVersion returns the Version field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetVersion() string { + if p == nil || p.Version == nil { + return "" } - return *p.IsValidDomain + return *p.Version } -// GetNameservers returns the Nameservers field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetNameservers() string { - if p == nil || p.Nameservers == nil { - return "" +// GetInfo returns the Info field. +func (p *PackageVersionBody) GetInfo() *PackageVersionBodyInfo { + if p == nil { + return nil } - return *p.Nameservers + return p.Info } -// GetReason returns the Reason field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetReason() string { - if p == nil || p.Reason == nil { - return "" +// GetRepo returns the Repo field. +func (p *PackageVersionBody) GetRepo() *Repository { + if p == nil { + return nil } - return *p.Reason + return p.Repo } -// GetRespondsToHTTPS returns the RespondsToHTTPS field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetRespondsToHTTPS() bool { - if p == nil || p.RespondsToHTTPS == nil { +// GetCollection returns the Collection field if it's non-nil, zero value otherwise. +func (p *PackageVersionBodyInfo) GetCollection() bool { + if p == nil || p.Collection == nil { return false } - return *p.RespondsToHTTPS + return *p.Collection } -// GetShouldBeARecord returns the ShouldBeARecord field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetShouldBeARecord() bool { - if p == nil || p.ShouldBeARecord == nil { - return false +// GetMode returns the Mode field if it's non-nil, zero value otherwise. +func (p *PackageVersionBodyInfo) GetMode() int64 { + if p == nil || p.Mode == nil { + return 0 } - return *p.ShouldBeARecord + return *p.Mode } -// GetURI returns the URI field if it's non-nil, zero value otherwise. -func (p *PagesDomain) GetURI() string { - if p == nil || p.URI == nil { +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *PackageVersionBodyInfo) GetName() string { + if p == nil || p.Name == nil { return "" } - return *p.URI + return *p.Name } -// GetMessage returns the Message field if it's non-nil, zero value otherwise. -func (p *PagesError) GetMessage() string { - if p == nil || p.Message == nil { +// GetOID returns the OID field if it's non-nil, zero value otherwise. +func (p *PackageVersionBodyInfo) GetOID() string { + if p == nil || p.OID == nil { return "" } - return *p.Message + return *p.OID } -// GetAltDomain returns the AltDomain field. -func (p *PagesHealthCheckResponse) GetAltDomain() *PagesDomain { - if p == nil { - return nil +// GetPath returns the Path field if it's non-nil, zero value otherwise. +func (p *PackageVersionBodyInfo) GetPath() string { + if p == nil || p.Path == nil { + return "" } - return p.AltDomain + return *p.Path } -// GetDomain returns the Domain field. -func (p *PagesHealthCheckResponse) GetDomain() *PagesDomain { - if p == nil { - return nil +// GetSize returns the Size field if it's non-nil, zero value otherwise. +func (p *PackageVersionBodyInfo) GetSize() int64 { + if p == nil || p.Size == nil { + return 0 } - return p.Domain + return *p.Size } -// GetDescription returns the Description field if it's non-nil, zero value otherwise. -func (p *PagesHTTPSCertificate) GetDescription() string { - if p == nil || p.Description == nil { +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (p *PackageVersionBodyInfo) GetType() string { + if p == nil || p.Type == nil { return "" } - return *p.Description + return *p.Type } -// GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. -func (p *PagesHTTPSCertificate) GetExpiresAt() string { - if p == nil || p.ExpiresAt == nil { +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (p *Page) GetAction() string { + if p == nil || p.Action == nil { return "" } - return *p.ExpiresAt + return *p.Action } -// GetState returns the State field if it's non-nil, zero value otherwise. -func (p *PagesHTTPSCertificate) GetState() string { - if p == nil || p.State == nil { +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (p *Page) GetHTMLURL() string { + if p == nil || p.HTMLURL == nil { return "" } - return *p.State + return *p.HTMLURL } -// GetBranch returns the Branch field if it's non-nil, zero value otherwise. -func (p *PagesSource) GetBranch() string { - if p == nil || p.Branch == nil { +// GetPageName returns the PageName field if it's non-nil, zero value otherwise. +func (p *Page) GetPageName() string { + if p == nil || p.PageName == nil { return "" } - return *p.Branch + return *p.PageName } -// GetPath returns the Path field if it's non-nil, zero value otherwise. -func (p *PagesSource) GetPath() string { - if p == nil || p.Path == nil { +// GetSHA returns the SHA field if it's non-nil, zero value otherwise. +func (p *Page) GetSHA() string { + if p == nil || p.SHA == nil { return "" } - return *p.Path + return *p.SHA } -// GetTotalPages returns the TotalPages field if it's non-nil, zero value otherwise. -func (p *PageStats) GetTotalPages() int { - if p == nil || p.TotalPages == nil { - return 0 +// GetSummary returns the Summary field if it's non-nil, zero value otherwise. +func (p *Page) GetSummary() string { + if p == nil || p.Summary == nil { + return "" } - return *p.TotalPages + return *p.Summary } -// GetBuildType returns the BuildType field if it's non-nil, zero value otherwise. -func (p *PagesUpdate) GetBuildType() string { - if p == nil || p.BuildType == nil { +// GetTitle returns the Title field if it's non-nil, zero value otherwise. +func (p *Page) GetTitle() string { + if p == nil || p.Title == nil { return "" } - return *p.BuildType + return *p.Title } -// GetCNAME returns the CNAME field if it's non-nil, zero value otherwise. -func (p *PagesUpdate) GetCNAME() string { - if p == nil || p.CNAME == nil { - return "" +// GetBuild returns the Build field. +func (p *PageBuildEvent) GetBuild() *PagesBuild { + if p == nil { + return nil } - return *p.CNAME + return p.Build } -// GetHTTPSEnforced returns the HTTPSEnforced field if it's non-nil, zero value otherwise. -func (p *PagesUpdate) GetHTTPSEnforced() bool { - if p == nil || p.HTTPSEnforced == nil { - return false +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (p *PageBuildEvent) GetID() int64 { + if p == nil || p.ID == nil { + return 0 } - return *p.HTTPSEnforced + return *p.ID } -// GetPublic returns the Public field if it's non-nil, zero value otherwise. -func (p *PagesUpdate) GetPublic() bool { - if p == nil || p.Public == nil { - return false +// GetInstallation returns the Installation field. +func (p *PageBuildEvent) GetInstallation() *Installation { + if p == nil { + return nil } - return *p.Public + return p.Installation } -// GetSource returns the Source field. -func (p *PagesUpdate) GetSource() *PagesSource { +// GetOrg returns the Org field. +func (p *PageBuildEvent) GetOrg() *Organization { if p == nil { return nil } - return p.Source + return p.Org } -// GetCurrentUserCanApprove returns the CurrentUserCanApprove field if it's non-nil, zero value otherwise. -func (p *PendingDeployment) GetCurrentUserCanApprove() bool { - if p == nil || p.CurrentUserCanApprove == nil { - return false +// GetRepo returns the Repo field. +func (p *PageBuildEvent) GetRepo() *Repository { + if p == nil { + return nil } - return *p.CurrentUserCanApprove + return p.Repo } -// GetEnvironment returns the Environment field. -func (p *PendingDeployment) GetEnvironment() *PendingDeploymentEnvironment { +// GetSender returns the Sender field. +func (p *PageBuildEvent) GetSender() *User { if p == nil { return nil } - return p.Environment + return p.Sender } -// GetWaitTimer returns the WaitTimer field if it's non-nil, zero value otherwise. -func (p *PendingDeployment) GetWaitTimer() int64 { - if p == nil || p.WaitTimer == nil { - return 0 +// GetBuildType returns the BuildType field if it's non-nil, zero value otherwise. +func (p *Pages) GetBuildType() string { + if p == nil || p.BuildType == nil { + return "" } - return *p.WaitTimer + return *p.BuildType } -// GetWaitTimerStartedAt returns the WaitTimerStartedAt field if it's non-nil, zero value otherwise. -func (p *PendingDeployment) GetWaitTimerStartedAt() Timestamp { - if p == nil || p.WaitTimerStartedAt == nil { - return Timestamp{} +// GetCNAME returns the CNAME field if it's non-nil, zero value otherwise. +func (p *Pages) GetCNAME() string { + if p == nil || p.CNAME == nil { + return "" } - return *p.WaitTimerStartedAt + return *p.CNAME +} + +// GetCustom404 returns the Custom404 field if it's non-nil, zero value otherwise. +func (p *Pages) GetCustom404() bool { + if p == nil || p.Custom404 == nil { + return false + } + return *p.Custom404 } // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. -func (p *PendingDeploymentEnvironment) GetHTMLURL() string { +func (p *Pages) GetHTMLURL() string { if p == nil || p.HTMLURL == nil { return "" } return *p.HTMLURL } -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (p *PendingDeploymentEnvironment) GetID() int64 { - if p == nil || p.ID == nil { - return 0 +// GetHTTPSCertificate returns the HTTPSCertificate field. +func (p *Pages) GetHTTPSCertificate() *PagesHTTPSCertificate { + if p == nil { + return nil } - return *p.ID + return p.HTTPSCertificate } -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (p *PendingDeploymentEnvironment) GetName() string { - if p == nil || p.Name == nil { - return "" +// GetHTTPSEnforced returns the HTTPSEnforced field if it's non-nil, zero value otherwise. +func (p *Pages) GetHTTPSEnforced() bool { + if p == nil || p.HTTPSEnforced == nil { + return false } - return *p.Name + return *p.HTTPSEnforced } -// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (p *PendingDeploymentEnvironment) GetNodeID() string { - if p == nil || p.NodeID == nil { +// GetPublic returns the Public field if it's non-nil, zero value otherwise. +func (p *Pages) GetPublic() bool { + if p == nil || p.Public == nil { + return false + } + return *p.Public +} + +// GetSource returns the Source field. +func (p *Pages) GetSource() *PagesSource { + if p == nil { + return nil + } + return p.Source +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (p *Pages) GetStatus() string { + if p == nil || p.Status == nil { return "" } - return *p.NodeID + return *p.Status } // GetURL returns the URL field if it's non-nil, zero value otherwise. -func (p *PendingDeploymentEnvironment) GetURL() string { +func (p *Pages) GetURL() string { if p == nil || p.URL == nil { return "" } return *p.URL } -// GetAccessGrantedAt returns the AccessGrantedAt field if it's non-nil, zero value otherwise. -func (p *PersonalAccessToken) GetAccessGrantedAt() Timestamp { - if p == nil || p.AccessGrantedAt == nil { +// GetCommit returns the Commit field if it's non-nil, zero value otherwise. +func (p *PagesBuild) GetCommit() string { + if p == nil || p.Commit == nil { + return "" + } + return *p.Commit +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (p *PagesBuild) GetCreatedAt() Timestamp { + if p == nil || p.CreatedAt == nil { return Timestamp{} } - return *p.AccessGrantedAt + return *p.CreatedAt } -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (p *PersonalAccessToken) GetID() int64 { - if p == nil || p.ID == nil { +// GetDuration returns the Duration field if it's non-nil, zero value otherwise. +func (p *PagesBuild) GetDuration() int { + if p == nil || p.Duration == nil { return 0 } - return *p.ID + return *p.Duration } -// GetOwner returns the Owner field. -func (p *PersonalAccessToken) GetOwner() *User { +// GetError returns the Error field. +func (p *PagesBuild) GetError() *PagesError { if p == nil { return nil } - return p.Owner + return p.Error } -// GetPermissions returns the Permissions field. -func (p *PersonalAccessToken) GetPermissions() *PersonalAccessTokenPermissions { +// GetPusher returns the Pusher field. +func (p *PagesBuild) GetPusher() *User { if p == nil { return nil } - return p.Permissions -} - -// GetRepositoriesURL returns the RepositoriesURL field if it's non-nil, zero value otherwise. -func (p *PersonalAccessToken) GetRepositoriesURL() string { - if p == nil || p.RepositoriesURL == nil { - return "" - } - return *p.RepositoriesURL + return p.Pusher } -// GetRepositorySelection returns the RepositorySelection field if it's non-nil, zero value otherwise. -func (p *PersonalAccessToken) GetRepositorySelection() string { - if p == nil || p.RepositorySelection == nil { +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (p *PagesBuild) GetStatus() string { + if p == nil || p.Status == nil { return "" } - return *p.RepositorySelection + return *p.Status } -// GetTokenExpired returns the TokenExpired field if it's non-nil, zero value otherwise. -func (p *PersonalAccessToken) GetTokenExpired() bool { - if p == nil || p.TokenExpired == nil { - return false +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (p *PagesBuild) GetUpdatedAt() Timestamp { + if p == nil || p.UpdatedAt == nil { + return Timestamp{} } - return *p.TokenExpired + return *p.UpdatedAt } -// GetTokenExpiresAt returns the TokenExpiresAt field if it's non-nil, zero value otherwise. -func (p *PersonalAccessToken) GetTokenExpiresAt() Timestamp { - if p == nil || p.TokenExpiresAt == nil { - return Timestamp{} +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (p *PagesBuild) GetURL() string { + if p == nil || p.URL == nil { + return "" } - return *p.TokenExpiresAt + return *p.URL } -// GetTokenLastUsedAt returns the TokenLastUsedAt field if it's non-nil, zero value otherwise. -func (p *PersonalAccessToken) GetTokenLastUsedAt() Timestamp { - if p == nil || p.TokenLastUsedAt == nil { - return Timestamp{} +// GetCAAError returns the CAAError field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetCAAError() string { + if p == nil || p.CAAError == nil { + return "" } - return *p.TokenLastUsedAt + return *p.CAAError } -// GetOrg returns the Org map if it's non-nil, an empty map otherwise. -func (p *PersonalAccessTokenPermissions) GetOrg() map[string]string { - if p == nil || p.Org == nil { - return map[string]string{} +// GetDNSResolves returns the DNSResolves field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetDNSResolves() bool { + if p == nil || p.DNSResolves == nil { + return false } - return p.Org + return *p.DNSResolves } -// GetOther returns the Other map if it's non-nil, an empty map otherwise. -func (p *PersonalAccessTokenPermissions) GetOther() map[string]string { - if p == nil || p.Other == nil { - return map[string]string{} +// GetEnforcesHTTPS returns the EnforcesHTTPS field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetEnforcesHTTPS() bool { + if p == nil || p.EnforcesHTTPS == nil { + return false } - return p.Other + return *p.EnforcesHTTPS } -// GetRepo returns the Repo map if it's non-nil, an empty map otherwise. -func (p *PersonalAccessTokenPermissions) GetRepo() map[string]string { - if p == nil || p.Repo == nil { - return map[string]string{} +// GetHasCNAMERecord returns the HasCNAMERecord field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetHasCNAMERecord() bool { + if p == nil || p.HasCNAMERecord == nil { + return false } - return p.Repo + return *p.HasCNAMERecord } -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (p *PersonalAccessTokenRequest) GetCreatedAt() Timestamp { - if p == nil || p.CreatedAt == nil { - return Timestamp{} +// GetHasMXRecordsPresent returns the HasMXRecordsPresent field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetHasMXRecordsPresent() bool { + if p == nil || p.HasMXRecordsPresent == nil { + return false } - return *p.CreatedAt + return *p.HasMXRecordsPresent } -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (p *PersonalAccessTokenRequest) GetID() int64 { - if p == nil || p.ID == nil { - return 0 +// GetHost returns the Host field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetHost() string { + if p == nil || p.Host == nil { + return "" } - return *p.ID + return *p.Host } -// GetOrg returns the Org field. -func (p *PersonalAccessTokenRequest) GetOrg() *Organization { - if p == nil { - return nil +// GetHTTPSError returns the HTTPSError field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetHTTPSError() string { + if p == nil || p.HTTPSError == nil { + return "" } - return p.Org + return *p.HTTPSError } -// GetOwner returns the Owner field. -func (p *PersonalAccessTokenRequest) GetOwner() *User { - if p == nil { - return nil +// GetIsApexDomain returns the IsApexDomain field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsApexDomain() bool { + if p == nil || p.IsApexDomain == nil { + return false } - return p.Owner + return *p.IsApexDomain } -// GetPermissionsAdded returns the PermissionsAdded field. -func (p *PersonalAccessTokenRequest) GetPermissionsAdded() *PersonalAccessTokenPermissions { - if p == nil { - return nil +// GetIsARecord returns the IsARecord field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsARecord() bool { + if p == nil || p.IsARecord == nil { + return false } - return p.PermissionsAdded + return *p.IsARecord } -// GetPermissionsResult returns the PermissionsResult field. -func (p *PersonalAccessTokenRequest) GetPermissionsResult() *PersonalAccessTokenPermissions { - if p == nil { - return nil +// GetIsCloudflareIP returns the IsCloudflareIP field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsCloudflareIP() bool { + if p == nil || p.IsCloudflareIP == nil { + return false } - return p.PermissionsResult + return *p.IsCloudflareIP } -// GetPermissionsUpgraded returns the PermissionsUpgraded field. -func (p *PersonalAccessTokenRequest) GetPermissionsUpgraded() *PersonalAccessTokenPermissions { - if p == nil { - return nil +// GetIsCNAMEToFastly returns the IsCNAMEToFastly field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsCNAMEToFastly() bool { + if p == nil || p.IsCNAMEToFastly == nil { + return false } - return p.PermissionsUpgraded + return *p.IsCNAMEToFastly } -// GetRepositoryCount returns the RepositoryCount field if it's non-nil, zero value otherwise. -func (p *PersonalAccessTokenRequest) GetRepositoryCount() int64 { - if p == nil || p.RepositoryCount == nil { - return 0 +// GetIsCNAMEToGithubUserDomain returns the IsCNAMEToGithubUserDomain field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsCNAMEToGithubUserDomain() bool { + if p == nil || p.IsCNAMEToGithubUserDomain == nil { + return false } - return *p.RepositoryCount + return *p.IsCNAMEToGithubUserDomain } -// GetRepositorySelection returns the RepositorySelection field if it's non-nil, zero value otherwise. -func (p *PersonalAccessTokenRequest) GetRepositorySelection() string { - if p == nil || p.RepositorySelection == nil { - return "" +// GetIsCNAMEToPagesDotGithubDotCom returns the IsCNAMEToPagesDotGithubDotCom field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsCNAMEToPagesDotGithubDotCom() bool { + if p == nil || p.IsCNAMEToPagesDotGithubDotCom == nil { + return false } - return *p.RepositorySelection + return *p.IsCNAMEToPagesDotGithubDotCom } -// GetTokenExpired returns the TokenExpired field if it's non-nil, zero value otherwise. -func (p *PersonalAccessTokenRequest) GetTokenExpired() bool { - if p == nil || p.TokenExpired == nil { +// GetIsFastlyIP returns the IsFastlyIP field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsFastlyIP() bool { + if p == nil || p.IsFastlyIP == nil { return false } - return *p.TokenExpired + return *p.IsFastlyIP } -// GetTokenExpiresAt returns the TokenExpiresAt field if it's non-nil, zero value otherwise. -func (p *PersonalAccessTokenRequest) GetTokenExpiresAt() Timestamp { - if p == nil || p.TokenExpiresAt == nil { - return Timestamp{} +// GetIsHTTPSEligible returns the IsHTTPSEligible field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsHTTPSEligible() bool { + if p == nil || p.IsHTTPSEligible == nil { + return false } - return *p.TokenExpiresAt + return *p.IsHTTPSEligible } -// GetTokenLastUsedAt returns the TokenLastUsedAt field if it's non-nil, zero value otherwise. -func (p *PersonalAccessTokenRequest) GetTokenLastUsedAt() Timestamp { - if p == nil || p.TokenLastUsedAt == nil { - return Timestamp{} +// GetIsNonGithubPagesIPPresent returns the IsNonGithubPagesIPPresent field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsNonGithubPagesIPPresent() bool { + if p == nil || p.IsNonGithubPagesIPPresent == nil { + return false } - return *p.TokenLastUsedAt + return *p.IsNonGithubPagesIPPresent } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *PersonalAccessTokenRequestEvent) GetAction() string { - if p == nil || p.Action == nil { - return "" +// GetIsOldIPAddress returns the IsOldIPAddress field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsOldIPAddress() bool { + if p == nil || p.IsOldIPAddress == nil { + return false } - return *p.Action + return *p.IsOldIPAddress } -// GetInstallation returns the Installation field. -func (p *PersonalAccessTokenRequestEvent) GetInstallation() *Installation { - if p == nil { - return nil +// GetIsPagesDomain returns the IsPagesDomain field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsPagesDomain() bool { + if p == nil || p.IsPagesDomain == nil { + return false } - return p.Installation + return *p.IsPagesDomain } -// GetOrg returns the Org field. -func (p *PersonalAccessTokenRequestEvent) GetOrg() *Organization { - if p == nil { - return nil +// GetIsPointedToGithubPagesIP returns the IsPointedToGithubPagesIP field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsPointedToGithubPagesIP() bool { + if p == nil || p.IsPointedToGithubPagesIP == nil { + return false } - return p.Org + return *p.IsPointedToGithubPagesIP } -// GetPersonalAccessTokenRequest returns the PersonalAccessTokenRequest field. -func (p *PersonalAccessTokenRequestEvent) GetPersonalAccessTokenRequest() *PersonalAccessTokenRequest { - if p == nil { - return nil +// GetIsProxied returns the IsProxied field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsProxied() bool { + if p == nil || p.IsProxied == nil { + return false } - return p.PersonalAccessTokenRequest + return *p.IsProxied } -// GetSender returns the Sender field. -func (p *PersonalAccessTokenRequestEvent) GetSender() *User { - if p == nil { - return nil +// GetIsServedByPages returns the IsServedByPages field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsServedByPages() bool { + if p == nil || p.IsServedByPages == nil { + return false } - return p.Sender + return *p.IsServedByPages } -// GetHook returns the Hook field. -func (p *PingEvent) GetHook() *Hook { - if p == nil { - return nil +// GetIsValid returns the IsValid field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsValid() bool { + if p == nil || p.IsValid == nil { + return false } - return p.Hook + return *p.IsValid } -// GetHookID returns the HookID field if it's non-nil, zero value otherwise. -func (p *PingEvent) GetHookID() int64 { - if p == nil || p.HookID == nil { - return 0 +// GetIsValidDomain returns the IsValidDomain field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetIsValidDomain() bool { + if p == nil || p.IsValidDomain == nil { + return false } - return *p.HookID + return *p.IsValidDomain } -// GetInstallation returns the Installation field. -func (p *PingEvent) GetInstallation() *Installation { - if p == nil { - return nil +// GetNameservers returns the Nameservers field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetNameservers() string { + if p == nil || p.Nameservers == nil { + return "" } - return p.Installation + return *p.Nameservers } -// GetOrg returns the Org field. -func (p *PingEvent) GetOrg() *Organization { - if p == nil { - return nil +// GetReason returns the Reason field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetReason() string { + if p == nil || p.Reason == nil { + return "" } - return p.Org + return *p.Reason } -// GetRepo returns the Repo field. -func (p *PingEvent) GetRepo() *Repository { - if p == nil { - return nil +// GetRespondsToHTTPS returns the RespondsToHTTPS field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetRespondsToHTTPS() bool { + if p == nil || p.RespondsToHTTPS == nil { + return false } - return p.Repo + return *p.RespondsToHTTPS } -// GetSender returns the Sender field. -func (p *PingEvent) GetSender() *User { - if p == nil { - return nil +// GetShouldBeARecord returns the ShouldBeARecord field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetShouldBeARecord() bool { + if p == nil || p.ShouldBeARecord == nil { + return false } - return p.Sender + return *p.ShouldBeARecord } -// GetZen returns the Zen field if it's non-nil, zero value otherwise. -func (p *PingEvent) GetZen() string { - if p == nil || p.Zen == nil { +// GetURI returns the URI field if it's non-nil, zero value otherwise. +func (p *PagesDomain) GetURI() string { + if p == nil || p.URI == nil { return "" } - return *p.Zen + return *p.URI } -// GetCollaborators returns the Collaborators field if it's non-nil, zero value otherwise. -func (p *Plan) GetCollaborators() int { - if p == nil || p.Collaborators == nil { - return 0 +// GetMessage returns the Message field if it's non-nil, zero value otherwise. +func (p *PagesError) GetMessage() string { + if p == nil || p.Message == nil { + return "" } - return *p.Collaborators + return *p.Message } -// GetFilledSeats returns the FilledSeats field if it's non-nil, zero value otherwise. -func (p *Plan) GetFilledSeats() int { - if p == nil || p.FilledSeats == nil { - return 0 +// GetAltDomain returns the AltDomain field. +func (p *PagesHealthCheckResponse) GetAltDomain() *PagesDomain { + if p == nil { + return nil } - return *p.FilledSeats + return p.AltDomain } -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (p *Plan) GetName() string { - if p == nil || p.Name == nil { - return "" +// GetDomain returns the Domain field. +func (p *PagesHealthCheckResponse) GetDomain() *PagesDomain { + if p == nil { + return nil } - return *p.Name + return p.Domain } -// GetPrivateRepos returns the PrivateRepos field if it's non-nil, zero value otherwise. -func (p *Plan) GetPrivateRepos() int64 { - if p == nil || p.PrivateRepos == nil { - return 0 +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (p *PagesHTTPSCertificate) GetDescription() string { + if p == nil || p.Description == nil { + return "" } - return *p.PrivateRepos + return *p.Description } -// GetSeats returns the Seats field if it's non-nil, zero value otherwise. -func (p *Plan) GetSeats() int { - if p == nil || p.Seats == nil { - return 0 +// GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. +func (p *PagesHTTPSCertificate) GetExpiresAt() string { + if p == nil || p.ExpiresAt == nil { + return "" } - return *p.Seats + return *p.ExpiresAt } -// GetSpace returns the Space field if it's non-nil, zero value otherwise. -func (p *Plan) GetSpace() int { - if p == nil || p.Space == nil { - return 0 +// GetState returns the State field if it's non-nil, zero value otherwise. +func (p *PagesHTTPSCertificate) GetState() string { + if p == nil || p.State == nil { + return "" } - return *p.Space + return *p.State } -// GetConfigURL returns the ConfigURL field if it's non-nil, zero value otherwise. -func (p *PreReceiveHook) GetConfigURL() string { - if p == nil || p.ConfigURL == nil { +// GetBranch returns the Branch field if it's non-nil, zero value otherwise. +func (p *PagesSource) GetBranch() string { + if p == nil || p.Branch == nil { return "" } - return *p.ConfigURL + return *p.Branch } -// GetEnforcement returns the Enforcement field if it's non-nil, zero value otherwise. -func (p *PreReceiveHook) GetEnforcement() string { - if p == nil || p.Enforcement == nil { +// GetPath returns the Path field if it's non-nil, zero value otherwise. +func (p *PagesSource) GetPath() string { + if p == nil || p.Path == nil { return "" } - return *p.Enforcement + return *p.Path } -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (p *PreReceiveHook) GetID() int64 { - if p == nil || p.ID == nil { +// GetTotalPages returns the TotalPages field if it's non-nil, zero value otherwise. +func (p *PageStats) GetTotalPages() int { + if p == nil || p.TotalPages == nil { return 0 } - return *p.ID + return *p.TotalPages } -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (p *PreReceiveHook) GetName() string { - if p == nil || p.Name == nil { +// GetBuildType returns the BuildType field if it's non-nil, zero value otherwise. +func (p *PagesUpdate) GetBuildType() string { + if p == nil || p.BuildType == nil { return "" } - return *p.Name + return *p.BuildType } -// GetHRef returns the HRef field if it's non-nil, zero value otherwise. -func (p *PRLink) GetHRef() string { - if p == nil || p.HRef == nil { +// GetCNAME returns the CNAME field if it's non-nil, zero value otherwise. +func (p *PagesUpdate) GetCNAME() string { + if p == nil || p.CNAME == nil { return "" } - return *p.HRef + return *p.CNAME } -// GetComments returns the Comments field. -func (p *PRLinks) GetComments() *PRLink { - if p == nil { - return nil +// GetHTTPSEnforced returns the HTTPSEnforced field if it's non-nil, zero value otherwise. +func (p *PagesUpdate) GetHTTPSEnforced() bool { + if p == nil || p.HTTPSEnforced == nil { + return false } - return p.Comments + return *p.HTTPSEnforced } -// GetCommits returns the Commits field. -func (p *PRLinks) GetCommits() *PRLink { - if p == nil { - return nil +// GetPublic returns the Public field if it's non-nil, zero value otherwise. +func (p *PagesUpdate) GetPublic() bool { + if p == nil || p.Public == nil { + return false } - return p.Commits + return *p.Public } -// GetHTML returns the HTML field. -func (p *PRLinks) GetHTML() *PRLink { +// GetSource returns the Source field. +func (p *PagesUpdate) GetSource() *PagesSource { if p == nil { return nil } - return p.HTML + return p.Source } -// GetIssue returns the Issue field. -func (p *PRLinks) GetIssue() *PRLink { - if p == nil { - return nil +// GetBuildType returns the BuildType field if it's non-nil, zero value otherwise. +func (p *PagesUpdateWithoutCNAME) GetBuildType() string { + if p == nil || p.BuildType == nil { + return "" } - return p.Issue + return *p.BuildType } -// GetReviewComment returns the ReviewComment field. -func (p *PRLinks) GetReviewComment() *PRLink { - if p == nil { - return nil +// GetHTTPSEnforced returns the HTTPSEnforced field if it's non-nil, zero value otherwise. +func (p *PagesUpdateWithoutCNAME) GetHTTPSEnforced() bool { + if p == nil || p.HTTPSEnforced == nil { + return false } - return p.ReviewComment + return *p.HTTPSEnforced } -// GetReviewComments returns the ReviewComments field. -func (p *PRLinks) GetReviewComments() *PRLink { - if p == nil { - return nil +// GetPublic returns the Public field if it's non-nil, zero value otherwise. +func (p *PagesUpdateWithoutCNAME) GetPublic() bool { + if p == nil || p.Public == nil { + return false } - return p.ReviewComments + return *p.Public } -// GetSelf returns the Self field. -func (p *PRLinks) GetSelf() *PRLink { +// GetSource returns the Source field. +func (p *PagesUpdateWithoutCNAME) GetSource() *PagesSource { if p == nil { return nil } - return p.Self + return p.Source } -// GetStatuses returns the Statuses field. -func (p *PRLinks) GetStatuses() *PRLink { - if p == nil { - return nil +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *PatternRuleParameters) GetName() string { + if p == nil || p.Name == nil { + return "" } - return p.Statuses + return *p.Name } -// GetBody returns the Body field if it's non-nil, zero value otherwise. -func (p *Project) GetBody() string { - if p == nil || p.Body == nil { - return "" +// GetNegate returns the Negate field if it's non-nil, zero value otherwise. +func (p *PatternRuleParameters) GetNegate() bool { + if p == nil || p.Negate == nil { + return false + } + return *p.Negate +} + +// GetCurrentUserCanApprove returns the CurrentUserCanApprove field if it's non-nil, zero value otherwise. +func (p *PendingDeployment) GetCurrentUserCanApprove() bool { + if p == nil || p.CurrentUserCanApprove == nil { + return false } - return *p.Body + return *p.CurrentUserCanApprove } -// GetColumnsURL returns the ColumnsURL field if it's non-nil, zero value otherwise. -func (p *Project) GetColumnsURL() string { - if p == nil || p.ColumnsURL == nil { - return "" +// GetEnvironment returns the Environment field. +func (p *PendingDeployment) GetEnvironment() *PendingDeploymentEnvironment { + if p == nil { + return nil } - return *p.ColumnsURL + return p.Environment } -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (p *Project) GetCreatedAt() Timestamp { - if p == nil || p.CreatedAt == nil { - return Timestamp{} +// GetWaitTimer returns the WaitTimer field if it's non-nil, zero value otherwise. +func (p *PendingDeployment) GetWaitTimer() int64 { + if p == nil || p.WaitTimer == nil { + return 0 } - return *p.CreatedAt + return *p.WaitTimer } -// GetCreator returns the Creator field. -func (p *Project) GetCreator() *User { - if p == nil { - return nil +// GetWaitTimerStartedAt returns the WaitTimerStartedAt field if it's non-nil, zero value otherwise. +func (p *PendingDeployment) GetWaitTimerStartedAt() Timestamp { + if p == nil || p.WaitTimerStartedAt == nil { + return Timestamp{} } - return p.Creator + return *p.WaitTimerStartedAt } // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. -func (p *Project) GetHTMLURL() string { +func (p *PendingDeploymentEnvironment) GetHTMLURL() string { if p == nil || p.HTMLURL == nil { return "" } @@ -15351,7 +17503,7 @@ func (p *Project) GetHTMLURL() string { } // GetID returns the ID field if it's non-nil, zero value otherwise. -func (p *Project) GetID() int64 { +func (p *PendingDeploymentEnvironment) GetID() int64 { if p == nil || p.ID == nil { return 0 } @@ -15359,7 +17511,7 @@ func (p *Project) GetID() int64 { } // GetName returns the Name field if it's non-nil, zero value otherwise. -func (p *Project) GetName() string { +func (p *PendingDeploymentEnvironment) GetName() string { if p == nil || p.Name == nil { return "" } @@ -15367,231 +17519,287 @@ func (p *Project) GetName() string { } // GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (p *Project) GetNodeID() string { +func (p *PendingDeploymentEnvironment) GetNodeID() string { if p == nil || p.NodeID == nil { return "" } return *p.NodeID } -// GetNumber returns the Number field if it's non-nil, zero value otherwise. -func (p *Project) GetNumber() int { - if p == nil || p.Number == nil { - return 0 - } - return *p.Number -} - -// GetOrganizationPermission returns the OrganizationPermission field if it's non-nil, zero value otherwise. -func (p *Project) GetOrganizationPermission() string { - if p == nil || p.OrganizationPermission == nil { +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (p *PendingDeploymentEnvironment) GetURL() string { + if p == nil || p.URL == nil { return "" } - return *p.OrganizationPermission + return *p.URL } -// GetOwnerURL returns the OwnerURL field if it's non-nil, zero value otherwise. -func (p *Project) GetOwnerURL() string { - if p == nil || p.OwnerURL == nil { - return "" +// GetAccessGrantedAt returns the AccessGrantedAt field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetAccessGrantedAt() Timestamp { + if p == nil || p.AccessGrantedAt == nil { + return Timestamp{} } - return *p.OwnerURL + return *p.AccessGrantedAt } -// GetPrivate returns the Private field if it's non-nil, zero value otherwise. -func (p *Project) GetPrivate() bool { - if p == nil || p.Private == nil { - return false +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetID() int64 { + if p == nil || p.ID == nil { + return 0 } - return *p.Private + return *p.ID } -// GetState returns the State field if it's non-nil, zero value otherwise. -func (p *Project) GetState() string { - if p == nil || p.State == nil { - return "" +// GetOwner returns the Owner field. +func (p *PersonalAccessToken) GetOwner() *User { + if p == nil { + return nil } - return *p.State + return p.Owner } -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (p *Project) GetUpdatedAt() Timestamp { - if p == nil || p.UpdatedAt == nil { - return Timestamp{} +// GetPermissions returns the Permissions field. +func (p *PersonalAccessToken) GetPermissions() *PersonalAccessTokenPermissions { + if p == nil { + return nil } - return *p.UpdatedAt + return p.Permissions } -// GetURL returns the URL field if it's non-nil, zero value otherwise. -func (p *Project) GetURL() string { - if p == nil || p.URL == nil { +// GetRepositoriesURL returns the RepositoriesURL field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetRepositoriesURL() string { + if p == nil || p.RepositoriesURL == nil { return "" } - return *p.URL + return *p.RepositoriesURL } -// GetFrom returns the From field if it's non-nil, zero value otherwise. -func (p *ProjectBody) GetFrom() string { - if p == nil || p.From == nil { +// GetRepositorySelection returns the RepositorySelection field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetRepositorySelection() string { + if p == nil || p.RepositorySelection == nil { return "" } - return *p.From + return *p.RepositorySelection } -// GetArchived returns the Archived field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetArchived() bool { - if p == nil || p.Archived == nil { +// GetTokenExpired returns the TokenExpired field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetTokenExpired() bool { + if p == nil || p.TokenExpired == nil { return false } - return *p.Archived + return *p.TokenExpired +} + +// GetTokenExpiresAt returns the TokenExpiresAt field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetTokenExpiresAt() Timestamp { + if p == nil || p.TokenExpiresAt == nil { + return Timestamp{} + } + return *p.TokenExpiresAt } -// GetColumnID returns the ColumnID field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetColumnID() int64 { - if p == nil || p.ColumnID == nil { +// GetTokenID returns the TokenID field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetTokenID() int64 { + if p == nil || p.TokenID == nil { return 0 } - return *p.ColumnID + return *p.TokenID } -// GetColumnName returns the ColumnName field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetColumnName() string { - if p == nil || p.ColumnName == nil { - return "" +// GetTokenLastUsedAt returns the TokenLastUsedAt field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetTokenLastUsedAt() Timestamp { + if p == nil || p.TokenLastUsedAt == nil { + return Timestamp{} } - return *p.ColumnName + return *p.TokenLastUsedAt } -// GetColumnURL returns the ColumnURL field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetColumnURL() string { - if p == nil || p.ColumnURL == nil { +// GetTokenName returns the TokenName field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetTokenName() string { + if p == nil || p.TokenName == nil { return "" } - return *p.ColumnURL + return *p.TokenName } -// GetContentURL returns the ContentURL field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetContentURL() string { - if p == nil || p.ContentURL == nil { - return "" +// GetOrg returns the Org map if it's non-nil, an empty map otherwise. +func (p *PersonalAccessTokenPermissions) GetOrg() map[string]string { + if p == nil || p.Org == nil { + return map[string]string{} } - return *p.ContentURL + return p.Org +} + +// GetOther returns the Other map if it's non-nil, an empty map otherwise. +func (p *PersonalAccessTokenPermissions) GetOther() map[string]string { + if p == nil || p.Other == nil { + return map[string]string{} + } + return p.Other +} + +// GetRepo returns the Repo map if it's non-nil, an empty map otherwise. +func (p *PersonalAccessTokenPermissions) GetRepo() map[string]string { + if p == nil || p.Repo == nil { + return map[string]string{} + } + return p.Repo } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetCreatedAt() Timestamp { +func (p *PersonalAccessTokenRequest) GetCreatedAt() Timestamp { if p == nil || p.CreatedAt == nil { return Timestamp{} } return *p.CreatedAt } -// GetCreator returns the Creator field. -func (p *ProjectCard) GetCreator() *User { +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequest) GetID() int64 { + if p == nil || p.ID == nil { + return 0 + } + return *p.ID +} + +// GetOrg returns the Org field. +func (p *PersonalAccessTokenRequest) GetOrg() *Organization { if p == nil { return nil } - return p.Creator + return p.Org } -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetID() int64 { - if p == nil || p.ID == nil { - return 0 +// GetOwner returns the Owner field. +func (p *PersonalAccessTokenRequest) GetOwner() *User { + if p == nil { + return nil } - return *p.ID + return p.Owner } -// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetNodeID() string { - if p == nil || p.NodeID == nil { - return "" +// GetPermissionsAdded returns the PermissionsAdded field. +func (p *PersonalAccessTokenRequest) GetPermissionsAdded() *PersonalAccessTokenPermissions { + if p == nil { + return nil } - return *p.NodeID + return p.PermissionsAdded } -// GetNote returns the Note field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetNote() string { - if p == nil || p.Note == nil { - return "" +// GetPermissionsResult returns the PermissionsResult field. +func (p *PersonalAccessTokenRequest) GetPermissionsResult() *PersonalAccessTokenPermissions { + if p == nil { + return nil } - return *p.Note + return p.PermissionsResult } -// GetPreviousColumnName returns the PreviousColumnName field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetPreviousColumnName() string { - if p == nil || p.PreviousColumnName == nil { - return "" +// GetPermissionsUpgraded returns the PermissionsUpgraded field. +func (p *PersonalAccessTokenRequest) GetPermissionsUpgraded() *PersonalAccessTokenPermissions { + if p == nil { + return nil } - return *p.PreviousColumnName + return p.PermissionsUpgraded } -// GetProjectID returns the ProjectID field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetProjectID() int64 { - if p == nil || p.ProjectID == nil { +// GetRepositoryCount returns the RepositoryCount field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequest) GetRepositoryCount() int64 { + if p == nil || p.RepositoryCount == nil { return 0 } - return *p.ProjectID + return *p.RepositoryCount } -// GetProjectURL returns the ProjectURL field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetProjectURL() string { - if p == nil || p.ProjectURL == nil { +// GetRepositorySelection returns the RepositorySelection field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequest) GetRepositorySelection() string { + if p == nil || p.RepositorySelection == nil { return "" } - return *p.ProjectURL + return *p.RepositorySelection } -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetUpdatedAt() Timestamp { - if p == nil || p.UpdatedAt == nil { - return Timestamp{} +// GetTokenExpired returns the TokenExpired field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequest) GetTokenExpired() bool { + if p == nil || p.TokenExpired == nil { + return false } - return *p.UpdatedAt + return *p.TokenExpired } -// GetURL returns the URL field if it's non-nil, zero value otherwise. -func (p *ProjectCard) GetURL() string { - if p == nil || p.URL == nil { - return "" +// GetTokenExpiresAt returns the TokenExpiresAt field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequest) GetTokenExpiresAt() Timestamp { + if p == nil || p.TokenExpiresAt == nil { + return Timestamp{} } - return *p.URL + return *p.TokenExpiresAt } -// GetNote returns the Note field. -func (p *ProjectCardChange) GetNote() *ProjectCardNote { - if p == nil { - return nil +// GetTokenLastUsedAt returns the TokenLastUsedAt field if it's non-nil, zero value otherwise. +func (p *PersonalAccessTokenRequest) GetTokenLastUsedAt() Timestamp { + if p == nil || p.TokenLastUsedAt == nil { + return Timestamp{} } - return p.Note + return *p.TokenLastUsedAt } // GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *ProjectCardEvent) GetAction() string { +func (p *PersonalAccessTokenRequestEvent) GetAction() string { if p == nil || p.Action == nil { return "" } return *p.Action } -// GetAfterID returns the AfterID field if it's non-nil, zero value otherwise. -func (p *ProjectCardEvent) GetAfterID() int64 { - if p == nil || p.AfterID == nil { - return 0 +// GetInstallation returns the Installation field. +func (p *PersonalAccessTokenRequestEvent) GetInstallation() *Installation { + if p == nil { + return nil + } + return p.Installation +} + +// GetOrg returns the Org field. +func (p *PersonalAccessTokenRequestEvent) GetOrg() *Organization { + if p == nil { + return nil + } + return p.Org +} + +// GetPersonalAccessTokenRequest returns the PersonalAccessTokenRequest field. +func (p *PersonalAccessTokenRequestEvent) GetPersonalAccessTokenRequest() *PersonalAccessTokenRequest { + if p == nil { + return nil + } + return p.PersonalAccessTokenRequest +} + +// GetSender returns the Sender field. +func (p *PersonalAccessTokenRequestEvent) GetSender() *User { + if p == nil { + return nil } - return *p.AfterID + return p.Sender } -// GetChanges returns the Changes field. -func (p *ProjectCardEvent) GetChanges() *ProjectCardChange { +// GetHook returns the Hook field. +func (p *PingEvent) GetHook() *Hook { if p == nil { return nil } - return p.Changes + return p.Hook +} + +// GetHookID returns the HookID field if it's non-nil, zero value otherwise. +func (p *PingEvent) GetHookID() int64 { + if p == nil || p.HookID == nil { + return 0 + } + return *p.HookID } // GetInstallation returns the Installation field. -func (p *ProjectCardEvent) GetInstallation() *Installation { +func (p *PingEvent) GetInstallation() *Installation { if p == nil { return nil } @@ -15599,23 +17807,15 @@ func (p *ProjectCardEvent) GetInstallation() *Installation { } // GetOrg returns the Org field. -func (p *ProjectCardEvent) GetOrg() *Organization { +func (p *PingEvent) GetOrg() *Organization { if p == nil { return nil } return p.Org } -// GetProjectCard returns the ProjectCard field. -func (p *ProjectCardEvent) GetProjectCard() *ProjectCard { - if p == nil { - return nil - } - return p.ProjectCard -} - // GetRepo returns the Repo field. -func (p *ProjectCardEvent) GetRepo() *Repository { +func (p *PingEvent) GetRepo() *Repository { if p == nil { return nil } @@ -15623,79 +17823,87 @@ func (p *ProjectCardEvent) GetRepo() *Repository { } // GetSender returns the Sender field. -func (p *ProjectCardEvent) GetSender() *User { +func (p *PingEvent) GetSender() *User { if p == nil { return nil } return p.Sender } -// GetArchivedState returns the ArchivedState field if it's non-nil, zero value otherwise. -func (p *ProjectCardListOptions) GetArchivedState() string { - if p == nil || p.ArchivedState == nil { +// GetZen returns the Zen field if it's non-nil, zero value otherwise. +func (p *PingEvent) GetZen() string { + if p == nil || p.Zen == nil { return "" } - return *p.ArchivedState + return *p.Zen } -// GetFrom returns the From field if it's non-nil, zero value otherwise. -func (p *ProjectCardNote) GetFrom() string { - if p == nil || p.From == nil { - return "" +// GetCollaborators returns the Collaborators field if it's non-nil, zero value otherwise. +func (p *Plan) GetCollaborators() int { + if p == nil || p.Collaborators == nil { + return 0 } - return *p.From + return *p.Collaborators } -// GetArchived returns the Archived field if it's non-nil, zero value otherwise. -func (p *ProjectCardOptions) GetArchived() bool { - if p == nil || p.Archived == nil { - return false +// GetFilledSeats returns the FilledSeats field if it's non-nil, zero value otherwise. +func (p *Plan) GetFilledSeats() int { + if p == nil || p.FilledSeats == nil { + return 0 } - return *p.Archived + return *p.FilledSeats } -// GetBody returns the Body field. -func (p *ProjectChange) GetBody() *ProjectBody { - if p == nil { - return nil +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *Plan) GetName() string { + if p == nil || p.Name == nil { + return "" } - return p.Body + return *p.Name } -// GetName returns the Name field. -func (p *ProjectChange) GetName() *ProjectName { - if p == nil { - return nil +// GetPrivateRepos returns the PrivateRepos field if it's non-nil, zero value otherwise. +func (p *Plan) GetPrivateRepos() int64 { + if p == nil || p.PrivateRepos == nil { + return 0 } - return p.Name + return *p.PrivateRepos } -// GetPermission returns the Permission field if it's non-nil, zero value otherwise. -func (p *ProjectCollaboratorOptions) GetPermission() string { - if p == nil || p.Permission == nil { - return "" +// GetSeats returns the Seats field if it's non-nil, zero value otherwise. +func (p *Plan) GetSeats() int { + if p == nil || p.Seats == nil { + return 0 + } + return *p.Seats +} + +// GetSpace returns the Space field if it's non-nil, zero value otherwise. +func (p *Plan) GetSpace() int { + if p == nil || p.Space == nil { + return 0 } - return *p.Permission + return *p.Space } -// GetCardsURL returns the CardsURL field if it's non-nil, zero value otherwise. -func (p *ProjectColumn) GetCardsURL() string { - if p == nil || p.CardsURL == nil { +// GetConfigURL returns the ConfigURL field if it's non-nil, zero value otherwise. +func (p *PreReceiveHook) GetConfigURL() string { + if p == nil || p.ConfigURL == nil { return "" } - return *p.CardsURL + return *p.ConfigURL } -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (p *ProjectColumn) GetCreatedAt() Timestamp { - if p == nil || p.CreatedAt == nil { - return Timestamp{} +// GetEnforcement returns the Enforcement field if it's non-nil, zero value otherwise. +func (p *PreReceiveHook) GetEnforcement() string { + if p == nil || p.Enforcement == nil { + return "" } - return *p.CreatedAt + return *p.Enforcement } // GetID returns the ID field if it's non-nil, zero value otherwise. -func (p *ProjectColumn) GetID() int64 { +func (p *PreReceiveHook) GetID() int64 { if p == nil || p.ID == nil { return 0 } @@ -15703,179 +17911,139 @@ func (p *ProjectColumn) GetID() int64 { } // GetName returns the Name field if it's non-nil, zero value otherwise. -func (p *ProjectColumn) GetName() string { +func (p *PreReceiveHook) GetName() string { if p == nil || p.Name == nil { return "" } return *p.Name } -// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (p *ProjectColumn) GetNodeID() string { - if p == nil || p.NodeID == nil { - return "" - } - return *p.NodeID -} - -// GetProjectURL returns the ProjectURL field if it's non-nil, zero value otherwise. -func (p *ProjectColumn) GetProjectURL() string { - if p == nil || p.ProjectURL == nil { - return "" - } - return *p.ProjectURL -} - -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (p *ProjectColumn) GetUpdatedAt() Timestamp { - if p == nil || p.UpdatedAt == nil { - return Timestamp{} - } - return *p.UpdatedAt -} - -// GetURL returns the URL field if it's non-nil, zero value otherwise. -func (p *ProjectColumn) GetURL() string { - if p == nil || p.URL == nil { +// GetHRef returns the HRef field if it's non-nil, zero value otherwise. +func (p *PRLink) GetHRef() string { + if p == nil || p.HRef == nil { return "" } - return *p.URL + return *p.HRef } -// GetName returns the Name field. -func (p *ProjectColumnChange) GetName() *ProjectColumnName { +// GetComments returns the Comments field. +func (p *PRLinks) GetComments() *PRLink { if p == nil { return nil } - return p.Name -} - -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *ProjectColumnEvent) GetAction() string { - if p == nil || p.Action == nil { - return "" - } - return *p.Action + return p.Comments } -// GetAfterID returns the AfterID field if it's non-nil, zero value otherwise. -func (p *ProjectColumnEvent) GetAfterID() int64 { - if p == nil || p.AfterID == nil { - return 0 +// GetCommits returns the Commits field. +func (p *PRLinks) GetCommits() *PRLink { + if p == nil { + return nil } - return *p.AfterID + return p.Commits } -// GetChanges returns the Changes field. -func (p *ProjectColumnEvent) GetChanges() *ProjectColumnChange { +// GetHTML returns the HTML field. +func (p *PRLinks) GetHTML() *PRLink { if p == nil { return nil } - return p.Changes + return p.HTML } -// GetInstallation returns the Installation field. -func (p *ProjectColumnEvent) GetInstallation() *Installation { +// GetIssue returns the Issue field. +func (p *PRLinks) GetIssue() *PRLink { if p == nil { return nil } - return p.Installation + return p.Issue } -// GetOrg returns the Org field. -func (p *ProjectColumnEvent) GetOrg() *Organization { +// GetReviewComment returns the ReviewComment field. +func (p *PRLinks) GetReviewComment() *PRLink { if p == nil { return nil } - return p.Org + return p.ReviewComment } -// GetProjectColumn returns the ProjectColumn field. -func (p *ProjectColumnEvent) GetProjectColumn() *ProjectColumn { +// GetReviewComments returns the ReviewComments field. +func (p *PRLinks) GetReviewComments() *PRLink { if p == nil { return nil } - return p.ProjectColumn + return p.ReviewComments } -// GetRepo returns the Repo field. -func (p *ProjectColumnEvent) GetRepo() *Repository { +// GetSelf returns the Self field. +func (p *PRLinks) GetSelf() *PRLink { if p == nil { return nil } - return p.Repo + return p.Self } -// GetSender returns the Sender field. -func (p *ProjectColumnEvent) GetSender() *User { +// GetStatuses returns the Statuses field. +func (p *PRLinks) GetStatuses() *PRLink { if p == nil { return nil } - return p.Sender + return p.Statuses } // GetFrom returns the From field if it's non-nil, zero value otherwise. -func (p *ProjectColumnName) GetFrom() string { +func (p *ProjectBody) GetFrom() string { if p == nil || p.From == nil { return "" } return *p.From } -// GetAction returns the Action field if it's non-nil, zero value otherwise. -func (p *ProjectEvent) GetAction() string { - if p == nil || p.Action == nil { - return "" - } - return *p.Action -} - -// GetChanges returns the Changes field. -func (p *ProjectEvent) GetChanges() *ProjectChange { +// GetNote returns the Note field. +func (p *ProjectCardChange) GetNote() *ProjectCardNote { if p == nil { return nil } - return p.Changes + return p.Note } -// GetInstallation returns the Installation field. -func (p *ProjectEvent) GetInstallation() *Installation { - if p == nil { - return nil +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (p *ProjectCardNote) GetFrom() string { + if p == nil || p.From == nil { + return "" } - return p.Installation + return *p.From } -// GetOrg returns the Org field. -func (p *ProjectEvent) GetOrg() *Organization { +// GetBody returns the Body field. +func (p *ProjectChange) GetBody() *ProjectBody { if p == nil { return nil } - return p.Org + return p.Body } -// GetProject returns the Project field. -func (p *ProjectEvent) GetProject() *Project { +// GetName returns the Name field. +func (p *ProjectChange) GetName() *ProjectName { if p == nil { return nil } - return p.Project + return p.Name } -// GetRepo returns the Repo field. -func (p *ProjectEvent) GetRepo() *Repository { +// GetName returns the Name field. +func (p *ProjectColumnChange) GetName() *ProjectColumnName { if p == nil { return nil } - return p.Repo + return p.Name } -// GetSender returns the Sender field. -func (p *ProjectEvent) GetSender() *User { - if p == nil { - return nil +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (p *ProjectColumnName) GetFrom() string { + if p == nil || p.From == nil { + return "" } - return p.Sender + return *p.From } // GetFrom returns the From field if it's non-nil, zero value otherwise. @@ -15887,71 +18055,31 @@ func (p *ProjectName) GetFrom() string { } // GetBody returns the Body field if it's non-nil, zero value otherwise. -func (p *ProjectOptions) GetBody() string { +func (p *ProjectV2) GetBody() string { if p == nil || p.Body == nil { return "" } - return *p.Body -} - -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (p *ProjectOptions) GetName() string { - if p == nil || p.Name == nil { - return "" - } - return *p.Name -} - -// GetOrganizationPermission returns the OrganizationPermission field if it's non-nil, zero value otherwise. -func (p *ProjectOptions) GetOrganizationPermission() string { - if p == nil || p.OrganizationPermission == nil { - return "" - } - return *p.OrganizationPermission -} - -// GetPrivate returns the Private field if it's non-nil, zero value otherwise. -func (p *ProjectOptions) GetPrivate() bool { - if p == nil || p.Private == nil { - return false - } - return *p.Private -} - -// GetState returns the State field if it's non-nil, zero value otherwise. -func (p *ProjectOptions) GetState() string { - if p == nil || p.State == nil { - return "" - } - return *p.State -} - -// GetPermission returns the Permission field if it's non-nil, zero value otherwise. -func (p *ProjectPermissionLevel) GetPermission() string { - if p == nil || p.Permission == nil { - return "" - } - return *p.Permission -} - -// GetUser returns the User field. -func (p *ProjectPermissionLevel) GetUser() *User { - if p == nil { - return nil - } - return p.User + return *p.Body } // GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetClosedAt() Timestamp { +func (p *ProjectV2) GetClosedAt() Timestamp { if p == nil || p.ClosedAt == nil { return Timestamp{} } return *p.ClosedAt } +// GetColumnsURL returns the ColumnsURL field if it's non-nil, zero value otherwise. +func (p *ProjectV2) GetColumnsURL() string { + if p == nil || p.ColumnsURL == nil { + return "" + } + return *p.ColumnsURL +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetCreatedAt() Timestamp { +func (p *ProjectV2) GetCreatedAt() Timestamp { if p == nil || p.CreatedAt == nil { return Timestamp{} } @@ -15959,7 +18087,7 @@ func (p *ProjectsV2) GetCreatedAt() Timestamp { } // GetCreator returns the Creator field. -func (p *ProjectsV2) GetCreator() *User { +func (p *ProjectV2) GetCreator() *User { if p == nil { return nil } @@ -15967,7 +18095,7 @@ func (p *ProjectsV2) GetCreator() *User { } // GetDeletedAt returns the DeletedAt field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetDeletedAt() Timestamp { +func (p *ProjectV2) GetDeletedAt() Timestamp { if p == nil || p.DeletedAt == nil { return Timestamp{} } @@ -15975,7 +18103,7 @@ func (p *ProjectsV2) GetDeletedAt() Timestamp { } // GetDeletedBy returns the DeletedBy field. -func (p *ProjectsV2) GetDeletedBy() *User { +func (p *ProjectV2) GetDeletedBy() *User { if p == nil { return nil } @@ -15983,23 +18111,39 @@ func (p *ProjectsV2) GetDeletedBy() *User { } // GetDescription returns the Description field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetDescription() string { +func (p *ProjectV2) GetDescription() string { if p == nil || p.Description == nil { return "" } return *p.Description } +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (p *ProjectV2) GetHTMLURL() string { + if p == nil || p.HTMLURL == nil { + return "" + } + return *p.HTMLURL +} + // GetID returns the ID field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetID() int64 { +func (p *ProjectV2) GetID() int64 { if p == nil || p.ID == nil { return 0 } return *p.ID } +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *ProjectV2) GetName() string { + if p == nil || p.Name == nil { + return "" + } + return *p.Name +} + // GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetNodeID() string { +func (p *ProjectV2) GetNodeID() string { if p == nil || p.NodeID == nil { return "" } @@ -16007,23 +18151,47 @@ func (p *ProjectsV2) GetNodeID() string { } // GetNumber returns the Number field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetNumber() int { +func (p *ProjectV2) GetNumber() int { if p == nil || p.Number == nil { return 0 } return *p.Number } +// GetOrganizationPermission returns the OrganizationPermission field if it's non-nil, zero value otherwise. +func (p *ProjectV2) GetOrganizationPermission() string { + if p == nil || p.OrganizationPermission == nil { + return "" + } + return *p.OrganizationPermission +} + // GetOwner returns the Owner field. -func (p *ProjectsV2) GetOwner() *User { +func (p *ProjectV2) GetOwner() *User { if p == nil { return nil } return p.Owner } +// GetOwnerURL returns the OwnerURL field if it's non-nil, zero value otherwise. +func (p *ProjectV2) GetOwnerURL() string { + if p == nil || p.OwnerURL == nil { + return "" + } + return *p.OwnerURL +} + +// GetPrivate returns the Private field if it's non-nil, zero value otherwise. +func (p *ProjectV2) GetPrivate() bool { + if p == nil || p.Private == nil { + return false + } + return *p.Private +} + // GetPublic returns the Public field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetPublic() bool { +func (p *ProjectV2) GetPublic() bool { if p == nil || p.Public == nil { return false } @@ -16031,15 +18199,23 @@ func (p *ProjectsV2) GetPublic() bool { } // GetShortDescription returns the ShortDescription field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetShortDescription() string { +func (p *ProjectV2) GetShortDescription() string { if p == nil || p.ShortDescription == nil { return "" } return *p.ShortDescription } +// GetState returns the State field if it's non-nil, zero value otherwise. +func (p *ProjectV2) GetState() string { + if p == nil || p.State == nil { + return "" + } + return *p.State +} + // GetTitle returns the Title field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetTitle() string { +func (p *ProjectV2) GetTitle() string { if p == nil || p.Title == nil { return "" } @@ -16047,13 +18223,21 @@ func (p *ProjectsV2) GetTitle() string { } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (p *ProjectsV2) GetUpdatedAt() Timestamp { +func (p *ProjectV2) GetUpdatedAt() Timestamp { if p == nil || p.UpdatedAt == nil { return Timestamp{} } return *p.UpdatedAt } +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (p *ProjectV2) GetURL() string { + if p == nil || p.URL == nil { + return "" + } + return *p.URL +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (p *ProjectV2Event) GetAction() string { if p == nil || p.Action == nil { @@ -16079,7 +18263,7 @@ func (p *ProjectV2Event) GetOrg() *Organization { } // GetProjectsV2 returns the ProjectsV2 field. -func (p *ProjectV2Event) GetProjectsV2() *ProjectsV2 { +func (p *ProjectV2Event) GetProjectsV2() *ProjectV2 { if p == nil { return nil } @@ -16438,6 +18622,14 @@ func (p *ProtectionChanges) GetRequiredStatusChecksEnforcementLevel() *RequiredS return p.RequiredStatusChecksEnforcementLevel } +// GetRequireLastPushApproval returns the RequireLastPushApproval field. +func (p *ProtectionChanges) GetRequireLastPushApproval() *RequireLastPushApprovalChanges { + if p == nil { + return nil + } + return p.RequireLastPushApproval +} + // GetSignatureRequirementEnforcementLevel returns the SignatureRequirementEnforcementLevel field. func (p *ProtectionChanges) GetSignatureRequirementEnforcementLevel() *SignatureRequirementEnforcementLevelChanges { if p == nil { @@ -17838,6 +20030,14 @@ func (p *PullRequestReviewThreadEvent) GetThread() *PullRequestThread { return p.Thread } +// GetAutomaticCopilotCodeReviewEnabled returns the AutomaticCopilotCodeReviewEnabled field if it's non-nil, zero value otherwise. +func (p *PullRequestRuleParameters) GetAutomaticCopilotCodeReviewEnabled() bool { + if p == nil || p.AutomaticCopilotCodeReviewEnabled == nil { + return false + } + return *p.AutomaticCopilotCodeReviewEnabled +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (p *PullRequestTargetEvent) GetAction() string { if p == nil || p.Action == nil { @@ -17974,12 +20174,12 @@ func (p *PullRequestThread) GetNodeID() string { return *p.NodeID } -// GetMergablePulls returns the MergablePulls field if it's non-nil, zero value otherwise. -func (p *PullStats) GetMergablePulls() int { - if p == nil || p.MergablePulls == nil { +// GetMergeablePulls returns the MergeablePulls field if it's non-nil, zero value otherwise. +func (p *PullStats) GetMergeablePulls() int { + if p == nil || p.MergeablePulls == nil { return 0 } - return *p.MergablePulls + return *p.MergeablePulls } // GetMergedPulls returns the MergedPulls field if it's non-nil, zero value otherwise. @@ -17998,12 +20198,12 @@ func (p *PullStats) GetTotalPulls() int { return *p.TotalPulls } -// GetUnmergablePulls returns the UnmergablePulls field if it's non-nil, zero value otherwise. -func (p *PullStats) GetUnmergablePulls() int { - if p == nil || p.UnmergablePulls == nil { +// GetUnmergeablePulls returns the UnmergeablePulls field if it's non-nil, zero value otherwise. +func (p *PullStats) GetUnmergeablePulls() int { + if p == nil || p.UnmergeablePulls == nil { return 0 } - return *p.UnmergablePulls + return *p.UnmergeablePulls } // GetCommits returns the Commits field if it's non-nil, zero value otherwise. @@ -18238,6 +20438,14 @@ func (p *PushEventRepository) GetCreatedAt() Timestamp { return *p.CreatedAt } +// GetCustomProperties returns the CustomProperties map if it's non-nil, an empty map otherwise. +func (p *PushEventRepository) GetCustomProperties() map[string]any { + if p == nil || p.CustomProperties == nil { + return map[string]any{} + } + return p.CustomProperties +} + // GetDefaultBranch returns the DefaultBranch field if it's non-nil, zero value otherwise. func (p *PushEventRepository) GetDefaultBranch() string { if p == nil || p.DefaultBranch == nil { @@ -18590,6 +20798,14 @@ func (r *Reaction) GetContent() string { return *r.Content } +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (r *Reaction) GetCreatedAt() Timestamp { + if r == nil || r.CreatedAt == nil { + return Timestamp{} + } + return *r.CreatedAt +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (r *Reaction) GetID() int64 { if r == nil || r.ID == nil { @@ -18766,6 +20982,62 @@ func (r *RegistrationToken) GetToken() string { return *r.Token } +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (r *RegistryPackageEvent) GetAction() string { + if r == nil || r.Action == nil { + return "" + } + return *r.Action +} + +// GetEnterprise returns the Enterprise field. +func (r *RegistryPackageEvent) GetEnterprise() *Enterprise { + if r == nil { + return nil + } + return r.Enterprise +} + +// GetInstallation returns the Installation field. +func (r *RegistryPackageEvent) GetInstallation() *Installation { + if r == nil { + return nil + } + return r.Installation +} + +// GetOrganization returns the Organization field. +func (r *RegistryPackageEvent) GetOrganization() *Organization { + if r == nil { + return nil + } + return r.Organization +} + +// GetRegistryPackage returns the RegistryPackage field. +func (r *RegistryPackageEvent) GetRegistryPackage() *Package { + if r == nil { + return nil + } + return r.RegistryPackage +} + +// GetRepository returns the Repository field. +func (r *RegistryPackageEvent) GetRepository() *Repository { + if r == nil { + return nil + } + return r.Repository +} + +// GetSender returns the Sender field. +func (r *RegistryPackageEvent) GetSender() *User { + if r == nil { + return nil + } + return r.Sender +} + // GetBrowserDownloadURL returns the BrowserDownloadURL field if it's non-nil, zero value otherwise. func (r *ReleaseAsset) GetBrowserDownloadURL() string { if r == nil || r.BrowserDownloadURL == nil { @@ -18790,6 +21062,14 @@ func (r *ReleaseAsset) GetCreatedAt() Timestamp { return *r.CreatedAt } +// GetDigest returns the Digest field if it's non-nil, zero value otherwise. +func (r *ReleaseAsset) GetDigest() string { + if r == nil || r.Digest == nil { + return "" + } + return *r.Digest +} + // GetDownloadCount returns the DownloadCount field if it's non-nil, zero value otherwise. func (r *ReleaseAsset) GetDownloadCount() int { if r == nil || r.DownloadCount == nil { @@ -18918,6 +21198,38 @@ func (r *ReleaseEvent) GetSender() *User { return r.Sender } +// GetBuildDate returns the BuildDate field if it's non-nil, zero value otherwise. +func (r *ReleaseVersion) GetBuildDate() string { + if r == nil || r.BuildDate == nil { + return "" + } + return *r.BuildDate +} + +// GetBuildID returns the BuildID field if it's non-nil, zero value otherwise. +func (r *ReleaseVersion) GetBuildID() string { + if r == nil || r.BuildID == nil { + return "" + } + return *r.BuildID +} + +// GetPlatform returns the Platform field if it's non-nil, zero value otherwise. +func (r *ReleaseVersion) GetPlatform() string { + if r == nil || r.Platform == nil { + return "" + } + return *r.Platform +} + +// GetVersion returns the Version field if it's non-nil, zero value otherwise. +func (r *ReleaseVersion) GetVersion() string { + if r == nil || r.Version == nil { + return "" + } + return *r.Version +} + // GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. func (r *RemoveToken) GetExpiresAt() Timestamp { if r == nil || r.ExpiresAt == nil { @@ -19102,102 +21414,6 @@ func (r *RepoName) GetFrom() string { return *r.From } -// GetBadgeURL returns the BadgeURL field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetBadgeURL() string { - if r == nil || r.BadgeURL == nil { - return "" - } - return *r.BadgeURL -} - -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetCreatedAt() Timestamp { - if r == nil || r.CreatedAt == nil { - return Timestamp{} - } - return *r.CreatedAt -} - -// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetHTMLURL() string { - if r == nil || r.HTMLURL == nil { - return "" - } - return *r.HTMLURL -} - -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetID() int64 { - if r == nil || r.ID == nil { - return 0 - } - return *r.ID -} - -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetName() string { - if r == nil || r.Name == nil { - return "" - } - return *r.Name -} - -// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetNodeID() string { - if r == nil || r.NodeID == nil { - return "" - } - return *r.NodeID -} - -// GetPath returns the Path field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetPath() string { - if r == nil || r.Path == nil { - return "" - } - return *r.Path -} - -// GetSourceRepository returns the SourceRepository field. -func (r *RepoRequiredWorkflow) GetSourceRepository() *Repository { - if r == nil { - return nil - } - return r.SourceRepository -} - -// GetState returns the State field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetState() string { - if r == nil || r.State == nil { - return "" - } - return *r.State -} - -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetUpdatedAt() Timestamp { - if r == nil || r.UpdatedAt == nil { - return Timestamp{} - } - return *r.UpdatedAt -} - -// GetURL returns the URL field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetURL() string { - if r == nil || r.URL == nil { - return "" - } - return *r.URL -} - -// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflows) GetTotalCount() int { - if r == nil || r.TotalCount == nil { - return 0 - } - return *r.TotalCount -} - // GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise. func (r *RepositoriesSearchResult) GetIncompleteResults() bool { if r == nil || r.IncompleteResults == nil { @@ -19382,6 +21598,14 @@ func (r *Repository) GetCreatedAt() Timestamp { return *r.CreatedAt } +// GetCustomProperties returns the CustomProperties map if it's non-nil, an empty map otherwise. +func (r *Repository) GetCustomProperties() map[string]any { + if r == nil || r.CustomProperties == nil { + return map[string]any{} + } + return r.CustomProperties +} + // GetDefaultBranch returns the DefaultBranch field if it's non-nil, zero value otherwise. func (r *Repository) GetDefaultBranch() string { if r == nil || r.DefaultBranch == nil { @@ -20686,6 +22910,14 @@ func (r *RepositoryLicense) GetURL() string { return *r.URL } +// GetIncludesParents returns the IncludesParents field if it's non-nil, zero value otherwise. +func (r *RepositoryListRulesetsOptions) GetIncludesParents() bool { + if r == nil || r.IncludesParents == nil { + return false + } + return *r.IncludesParents +} + // GetBase returns the Base field if it's non-nil, zero value otherwise. func (r *RepositoryMergeRequest) GetBase() string { if r == nil || r.Base == nil { @@ -20894,12 +23126,12 @@ func (r *RepositoryRelease) GetZipballURL() string { return *r.ZipballURL } -// GetParameters returns the Parameters field if it's non-nil, zero value otherwise. -func (r *RepositoryRule) GetParameters() json.RawMessage { - if r == nil || r.Parameters == nil { - return json.RawMessage{} +// GetConditions returns the Conditions field. +func (r *RepositoryRuleset) GetConditions() *RepositoryRulesetConditions { + if r == nil { + return nil } - return *r.Parameters + return r.Conditions } // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. @@ -20910,16 +23142,24 @@ func (r *RepositoryRuleset) GetCreatedAt() Timestamp { return *r.CreatedAt } -// GetCurrentUserCanBypass returns the CurrentUserCanBypass field if it's non-nil, zero value otherwise. -func (r *RepositoryRuleset) GetCurrentUserCanBypass() string { - if r == nil || r.CurrentUserCanBypass == nil { - return "" +// GetCurrentUserCanBypass returns the CurrentUserCanBypass field. +func (r *RepositoryRuleset) GetCurrentUserCanBypass() *BypassMode { + if r == nil { + return nil + } + return r.CurrentUserCanBypass +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (r *RepositoryRuleset) GetID() int64 { + if r == nil || r.ID == nil { + return 0 } - return *r.CurrentUserCanBypass + return *r.ID } // GetLinks returns the Links field. -func (r *RepositoryRuleset) GetLinks() *RepositoryRulesetLink { +func (r *RepositoryRuleset) GetLinks() *RepositoryRulesetLinks { if r == nil { return nil } @@ -20934,20 +23174,28 @@ func (r *RepositoryRuleset) GetNodeID() string { return *r.NodeID } -// GetSourceType returns the SourceType field if it's non-nil, zero value otherwise. -func (r *RepositoryRuleset) GetSourceType() string { - if r == nil || r.SourceType == nil { - return "" +// GetRules returns the Rules field. +func (r *RepositoryRuleset) GetRules() *RepositoryRulesetRules { + if r == nil { + return nil + } + return r.Rules +} + +// GetSourceType returns the SourceType field. +func (r *RepositoryRuleset) GetSourceType() *RulesetSourceType { + if r == nil { + return nil } - return *r.SourceType + return r.SourceType } -// GetTarget returns the Target field if it's non-nil, zero value otherwise. -func (r *RepositoryRuleset) GetTarget() string { - if r == nil || r.Target == nil { - return "" +// GetTarget returns the Target field. +func (r *RepositoryRuleset) GetTarget() *RulesetTarget { + if r == nil { + return nil } - return *r.Target + return r.Target } // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. @@ -20958,16 +23206,32 @@ func (r *RepositoryRuleset) GetUpdatedAt() Timestamp { return *r.UpdatedAt } -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetCodeScanningRule) GetParameters() *RuleCodeScanningParameters { +// GetConfiguration returns the Configuration field. +func (r *RepositoryRulesetChangedRule) GetConfiguration() *RepositoryRulesetChangeSource { + if r == nil { + return nil + } + return r.Configuration +} + +// GetPattern returns the Pattern field. +func (r *RepositoryRulesetChangedRule) GetPattern() *RepositoryRulesetChangeSource { + if r == nil { + return nil + } + return r.Pattern +} + +// GetRuleType returns the RuleType field. +func (r *RepositoryRulesetChangedRule) GetRuleType() *RepositoryRulesetChangeSource { if r == nil { return nil } - return r.Parameters + return r.RuleType } // GetConditions returns the Conditions field. -func (r *RepositoryRulesetEditedChanges) GetConditions() *RepositoryRulesetEditedConditions { +func (r *RepositoryRulesetChanges) GetConditions() *RepositoryRulesetChangedConditions { if r == nil { return nil } @@ -20975,7 +23239,7 @@ func (r *RepositoryRulesetEditedChanges) GetConditions() *RepositoryRulesetEdite } // GetEnforcement returns the Enforcement field. -func (r *RepositoryRulesetEditedChanges) GetEnforcement() *RepositoryRulesetEditedSource { +func (r *RepositoryRulesetChanges) GetEnforcement() *RepositoryRulesetChangeSource { if r == nil { return nil } @@ -20983,7 +23247,7 @@ func (r *RepositoryRulesetEditedChanges) GetEnforcement() *RepositoryRulesetEdit } // GetName returns the Name field. -func (r *RepositoryRulesetEditedChanges) GetName() *RepositoryRulesetEditedSource { +func (r *RepositoryRulesetChanges) GetName() *RepositoryRulesetChangeSource { if r == nil { return nil } @@ -20991,59 +23255,67 @@ func (r *RepositoryRulesetEditedChanges) GetName() *RepositoryRulesetEditedSourc } // GetRules returns the Rules field. -func (r *RepositoryRulesetEditedChanges) GetRules() *RepositoryRulesetEditedRules { +func (r *RepositoryRulesetChanges) GetRules() *RepositoryRulesetChangedRules { if r == nil { return nil } return r.Rules } -// GetConfiguration returns the Configuration field. -func (r *RepositoryRulesetEditedRuleChanges) GetConfiguration() *RepositoryRulesetEditedSources { +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (r *RepositoryRulesetChangeSource) GetFrom() string { + if r == nil || r.From == nil { + return "" + } + return *r.From +} + +// GetOrganizationID returns the OrganizationID field. +func (r *RepositoryRulesetConditions) GetOrganizationID() *RepositoryRulesetOrganizationIDsConditionParameters { if r == nil { return nil } - return r.Configuration + return r.OrganizationID } -// GetPattern returns the Pattern field. -func (r *RepositoryRulesetEditedRuleChanges) GetPattern() *RepositoryRulesetEditedSources { +// GetOrganizationName returns the OrganizationName field. +func (r *RepositoryRulesetConditions) GetOrganizationName() *RepositoryRulesetOrganizationNamesConditionParameters { if r == nil { return nil } - return r.Pattern + return r.OrganizationName } -// GetRuleType returns the RuleType field. -func (r *RepositoryRulesetEditedRuleChanges) GetRuleType() *RepositoryRulesetEditedSources { +// GetRefName returns the RefName field. +func (r *RepositoryRulesetConditions) GetRefName() *RepositoryRulesetRefConditionParameters { if r == nil { return nil } - return r.RuleType + return r.RefName } -// GetFrom returns the From field if it's non-nil, zero value otherwise. -func (r *RepositoryRulesetEditedSource) GetFrom() string { - if r == nil || r.From == nil { - return "" +// GetRepositoryID returns the RepositoryID field. +func (r *RepositoryRulesetConditions) GetRepositoryID() *RepositoryRulesetRepositoryIDsConditionParameters { + if r == nil { + return nil } - return *r.From + return r.RepositoryID } -// GetChanges returns the Changes field. -func (r *RepositoryRulesetEditedUpdatedConditions) GetChanges() *RepositoryRulesetUpdatedConditionsEdited { +// GetRepositoryName returns the RepositoryName field. +func (r *RepositoryRulesetConditions) GetRepositoryName() *RepositoryRulesetRepositoryNamesConditionParameters { if r == nil { return nil } - return r.Changes + return r.RepositoryName } -// GetCondition returns the Condition field. -func (r *RepositoryRulesetEditedUpdatedConditions) GetCondition() *RepositoryRulesetRefCondition { +// GetRepositoryProperty returns the RepositoryProperty field. +func (r *RepositoryRulesetConditions) GetRepositoryProperty() *RepositoryRulesetRepositoryPropertyConditionParameters { if r == nil { return nil } - return r.Condition + return r.RepositoryProperty } // GetAction returns the Action field if it's non-nil, zero value otherwise. @@ -21055,7 +23327,7 @@ func (r *RepositoryRulesetEvent) GetAction() string { } // GetChanges returns the Changes field. -func (r *RepositoryRulesetEvent) GetChanges() *RepositoryRulesetEditedChanges { +func (r *RepositoryRulesetEvent) GetChanges() *RepositoryRulesetChanges { if r == nil { return nil } @@ -21110,24 +23382,16 @@ func (r *RepositoryRulesetEvent) GetSender() *User { return r.Sender } -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetFileExtensionRestrictionRule) GetParameters() *RuleFileExtensionRestrictionParameters { - if r == nil { - return nil - } - return r.Parameters -} - -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetFilePathRestrictionRule) GetParameters() *RuleFileParameters { - if r == nil { - return nil +// GetHRef returns the HRef field if it's non-nil, zero value otherwise. +func (r *RepositoryRulesetLink) GetHRef() string { + if r == nil || r.HRef == nil { + return "" } - return r.Parameters + return *r.HRef } // GetHTML returns the HTML field. -func (r *RepositoryRulesetLink) GetHTML() *RulesetLink { +func (r *RepositoryRulesetLinks) GetHTML() *RepositoryRulesetLink { if r == nil { return nil } @@ -21135,79 +23399,31 @@ func (r *RepositoryRulesetLink) GetHTML() *RulesetLink { } // GetSelf returns the Self field. -func (r *RepositoryRulesetLink) GetSelf() *RulesetLink { +func (r *RepositoryRulesetLinks) GetSelf() *RepositoryRulesetLink { if r == nil { return nil } return r.Self } -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetMaxFilePathLengthRule) GetParameters() *RuleMaxFilePathLengthParameters { - if r == nil { - return nil - } - return r.Parameters -} - -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetMaxFileSizeRule) GetParameters() *RuleMaxFileSizeParameters { - if r == nil { - return nil - } - return r.Parameters -} - -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetMergeQueueRule) GetParameters() *MergeQueueRuleParameters { - if r == nil { - return nil - } - return r.Parameters -} - -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetPatternRule) GetParameters() *RulePatternParameters { - if r == nil { - return nil - } - return r.Parameters -} - -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetPullRequestRule) GetParameters() *PullRequestRuleParameters { - if r == nil { - return nil - } - return r.Parameters -} - -// GetRefName returns the RefName field. -func (r *RepositoryRulesetRefCondition) GetRefName() *RulesetRefConditionParameters { - if r == nil { - return nil - } - return r.RefName -} - -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetRequiredDeploymentsRule) GetParameters() *RequiredDeploymentEnvironmentsRuleParameters { - if r == nil { - return nil +// GetProtected returns the Protected field if it's non-nil, zero value otherwise. +func (r *RepositoryRulesetRepositoryNamesConditionParameters) GetProtected() bool { + if r == nil || r.Protected == nil { + return false } - return r.Parameters + return *r.Protected } -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetRequiredStatusChecksRule) GetParameters() *RequiredStatusChecksRuleParameters { - if r == nil { - return nil +// GetSource returns the Source field if it's non-nil, zero value otherwise. +func (r *RepositoryRulesetRepositoryPropertyTargetParameters) GetSource() string { + if r == nil || r.Source == nil { + return "" } - return r.Parameters + return *r.Source } // GetBranchNamePattern returns the BranchNamePattern field. -func (r *RepositoryRulesetRule) GetBranchNamePattern() *RepositoryRulesetPatternRule { +func (r *RepositoryRulesetRules) GetBranchNamePattern() *PatternRuleParameters { if r == nil { return nil } @@ -21215,7 +23431,7 @@ func (r *RepositoryRulesetRule) GetBranchNamePattern() *RepositoryRulesetPattern } // GetCodeScanning returns the CodeScanning field. -func (r *RepositoryRulesetRule) GetCodeScanning() *RepositoryRulesetCodeScanningRule { +func (r *RepositoryRulesetRules) GetCodeScanning() *CodeScanningRuleParameters { if r == nil { return nil } @@ -21223,7 +23439,7 @@ func (r *RepositoryRulesetRule) GetCodeScanning() *RepositoryRulesetCodeScanning } // GetCommitAuthorEmailPattern returns the CommitAuthorEmailPattern field. -func (r *RepositoryRulesetRule) GetCommitAuthorEmailPattern() *RepositoryRulesetPatternRule { +func (r *RepositoryRulesetRules) GetCommitAuthorEmailPattern() *PatternRuleParameters { if r == nil { return nil } @@ -21231,7 +23447,7 @@ func (r *RepositoryRulesetRule) GetCommitAuthorEmailPattern() *RepositoryRuleset } // GetCommitMessagePattern returns the CommitMessagePattern field. -func (r *RepositoryRulesetRule) GetCommitMessagePattern() *RepositoryRulesetPatternRule { +func (r *RepositoryRulesetRules) GetCommitMessagePattern() *PatternRuleParameters { if r == nil { return nil } @@ -21239,7 +23455,7 @@ func (r *RepositoryRulesetRule) GetCommitMessagePattern() *RepositoryRulesetPatt } // GetCommitterEmailPattern returns the CommitterEmailPattern field. -func (r *RepositoryRulesetRule) GetCommitterEmailPattern() *RepositoryRulesetPatternRule { +func (r *RepositoryRulesetRules) GetCommitterEmailPattern() *PatternRuleParameters { if r == nil { return nil } @@ -21247,7 +23463,7 @@ func (r *RepositoryRulesetRule) GetCommitterEmailPattern() *RepositoryRulesetPat } // GetCreation returns the Creation field. -func (r *RepositoryRulesetRule) GetCreation() *RepositoryRulesetRuleType { +func (r *RepositoryRulesetRules) GetCreation() *EmptyRuleParameters { if r == nil { return nil } @@ -21255,7 +23471,7 @@ func (r *RepositoryRulesetRule) GetCreation() *RepositoryRulesetRuleType { } // GetDeletion returns the Deletion field. -func (r *RepositoryRulesetRule) GetDeletion() *RepositoryRulesetRuleType { +func (r *RepositoryRulesetRules) GetDeletion() *EmptyRuleParameters { if r == nil { return nil } @@ -21263,7 +23479,7 @@ func (r *RepositoryRulesetRule) GetDeletion() *RepositoryRulesetRuleType { } // GetFileExtensionRestriction returns the FileExtensionRestriction field. -func (r *RepositoryRulesetRule) GetFileExtensionRestriction() *RepositoryRulesetFileExtensionRestrictionRule { +func (r *RepositoryRulesetRules) GetFileExtensionRestriction() *FileExtensionRestrictionRuleParameters { if r == nil { return nil } @@ -21271,7 +23487,7 @@ func (r *RepositoryRulesetRule) GetFileExtensionRestriction() *RepositoryRuleset } // GetFilePathRestriction returns the FilePathRestriction field. -func (r *RepositoryRulesetRule) GetFilePathRestriction() *RepositoryRulesetFilePathRestrictionRule { +func (r *RepositoryRulesetRules) GetFilePathRestriction() *FilePathRestrictionRuleParameters { if r == nil { return nil } @@ -21279,7 +23495,7 @@ func (r *RepositoryRulesetRule) GetFilePathRestriction() *RepositoryRulesetFileP } // GetMaxFilePathLength returns the MaxFilePathLength field. -func (r *RepositoryRulesetRule) GetMaxFilePathLength() *RepositoryRulesetMaxFilePathLengthRule { +func (r *RepositoryRulesetRules) GetMaxFilePathLength() *MaxFilePathLengthRuleParameters { if r == nil { return nil } @@ -21287,7 +23503,7 @@ func (r *RepositoryRulesetRule) GetMaxFilePathLength() *RepositoryRulesetMaxFile } // GetMaxFileSize returns the MaxFileSize field. -func (r *RepositoryRulesetRule) GetMaxFileSize() *RepositoryRulesetMaxFileSizeRule { +func (r *RepositoryRulesetRules) GetMaxFileSize() *MaxFileSizeRuleParameters { if r == nil { return nil } @@ -21295,7 +23511,7 @@ func (r *RepositoryRulesetRule) GetMaxFileSize() *RepositoryRulesetMaxFileSizeRu } // GetMergeQueue returns the MergeQueue field. -func (r *RepositoryRulesetRule) GetMergeQueue() *RepositoryRulesetMergeQueueRule { +func (r *RepositoryRulesetRules) GetMergeQueue() *MergeQueueRuleParameters { if r == nil { return nil } @@ -21303,7 +23519,7 @@ func (r *RepositoryRulesetRule) GetMergeQueue() *RepositoryRulesetMergeQueueRule } // GetNonFastForward returns the NonFastForward field. -func (r *RepositoryRulesetRule) GetNonFastForward() *RepositoryRulesetRuleType { +func (r *RepositoryRulesetRules) GetNonFastForward() *EmptyRuleParameters { if r == nil { return nil } @@ -21311,7 +23527,7 @@ func (r *RepositoryRulesetRule) GetNonFastForward() *RepositoryRulesetRuleType { } // GetPullRequest returns the PullRequest field. -func (r *RepositoryRulesetRule) GetPullRequest() *RepositoryRulesetPullRequestRule { +func (r *RepositoryRulesetRules) GetPullRequest() *PullRequestRuleParameters { if r == nil { return nil } @@ -21319,7 +23535,7 @@ func (r *RepositoryRulesetRule) GetPullRequest() *RepositoryRulesetPullRequestRu } // GetRequiredDeployments returns the RequiredDeployments field. -func (r *RepositoryRulesetRule) GetRequiredDeployments() *RepositoryRulesetRequiredDeploymentsRule { +func (r *RepositoryRulesetRules) GetRequiredDeployments() *RequiredDeploymentsRuleParameters { if r == nil { return nil } @@ -21327,7 +23543,7 @@ func (r *RepositoryRulesetRule) GetRequiredDeployments() *RepositoryRulesetRequi } // GetRequiredLinearHistory returns the RequiredLinearHistory field. -func (r *RepositoryRulesetRule) GetRequiredLinearHistory() *RepositoryRulesetRuleType { +func (r *RepositoryRulesetRules) GetRequiredLinearHistory() *EmptyRuleParameters { if r == nil { return nil } @@ -21335,7 +23551,7 @@ func (r *RepositoryRulesetRule) GetRequiredLinearHistory() *RepositoryRulesetRul } // GetRequiredSignatures returns the RequiredSignatures field. -func (r *RepositoryRulesetRule) GetRequiredSignatures() *RepositoryRulesetRuleType { +func (r *RepositoryRulesetRules) GetRequiredSignatures() *EmptyRuleParameters { if r == nil { return nil } @@ -21343,7 +23559,7 @@ func (r *RepositoryRulesetRule) GetRequiredSignatures() *RepositoryRulesetRuleTy } // GetRequiredStatusChecks returns the RequiredStatusChecks field. -func (r *RepositoryRulesetRule) GetRequiredStatusChecks() *RepositoryRulesetRequiredStatusChecksRule { +func (r *RepositoryRulesetRules) GetRequiredStatusChecks() *RequiredStatusChecksRuleParameters { if r == nil { return nil } @@ -21351,7 +23567,7 @@ func (r *RepositoryRulesetRule) GetRequiredStatusChecks() *RepositoryRulesetRequ } // GetTagNamePattern returns the TagNamePattern field. -func (r *RepositoryRulesetRule) GetTagNamePattern() *RepositoryRulesetPatternRule { +func (r *RepositoryRulesetRules) GetTagNamePattern() *PatternRuleParameters { if r == nil { return nil } @@ -21359,7 +23575,7 @@ func (r *RepositoryRulesetRule) GetTagNamePattern() *RepositoryRulesetPatternRul } // GetUpdate returns the Update field. -func (r *RepositoryRulesetRule) GetUpdate() *RepositoryRulesetUpdateRule { +func (r *RepositoryRulesetRules) GetUpdate() *UpdateRuleParameters { if r == nil { return nil } @@ -21367,7 +23583,7 @@ func (r *RepositoryRulesetRule) GetUpdate() *RepositoryRulesetUpdateRule { } // GetWorkflows returns the Workflows field. -func (r *RepositoryRulesetRule) GetWorkflows() *RepositoryRulesetWorkflowsRule { +func (r *RepositoryRulesetRules) GetWorkflows() *WorkflowsRuleParameters { if r == nil { return nil } @@ -21375,7 +23591,7 @@ func (r *RepositoryRulesetRule) GetWorkflows() *RepositoryRulesetWorkflowsRule { } // GetConditionType returns the ConditionType field. -func (r *RepositoryRulesetUpdatedConditionsEdited) GetConditionType() *RepositoryRulesetEditedSource { +func (r *RepositoryRulesetUpdatedCondition) GetConditionType() *RepositoryRulesetChangeSource { if r == nil { return nil } @@ -21383,7 +23599,7 @@ func (r *RepositoryRulesetUpdatedConditionsEdited) GetConditionType() *Repositor } // GetExclude returns the Exclude field. -func (r *RepositoryRulesetUpdatedConditionsEdited) GetExclude() *RepositoryRulesetEditedSources { +func (r *RepositoryRulesetUpdatedCondition) GetExclude() *RepositoryRulesetChangeSources { if r == nil { return nil } @@ -21391,7 +23607,7 @@ func (r *RepositoryRulesetUpdatedConditionsEdited) GetExclude() *RepositoryRules } // GetInclude returns the Include field. -func (r *RepositoryRulesetUpdatedConditionsEdited) GetInclude() *RepositoryRulesetEditedSources { +func (r *RepositoryRulesetUpdatedCondition) GetInclude() *RepositoryRulesetChangeSources { if r == nil { return nil } @@ -21399,7 +23615,7 @@ func (r *RepositoryRulesetUpdatedConditionsEdited) GetInclude() *RepositoryRules } // GetTarget returns the Target field. -func (r *RepositoryRulesetUpdatedConditionsEdited) GetTarget() *RepositoryRulesetEditedSource { +func (r *RepositoryRulesetUpdatedCondition) GetTarget() *RepositoryRulesetChangeSource { if r == nil { return nil } @@ -21407,35 +23623,35 @@ func (r *RepositoryRulesetUpdatedConditionsEdited) GetTarget() *RepositoryRulese } // GetChanges returns the Changes field. -func (r *RepositoryRulesetUpdatedRules) GetChanges() *RepositoryRulesetEditedRuleChanges { +func (r *RepositoryRulesetUpdatedConditions) GetChanges() *RepositoryRulesetUpdatedCondition { if r == nil { return nil } return r.Changes } -// GetRule returns the Rule field. -func (r *RepositoryRulesetUpdatedRules) GetRule() *RepositoryRulesetRule { +// GetCondition returns the Condition field. +func (r *RepositoryRulesetUpdatedConditions) GetCondition() *RepositoryRulesetConditions { if r == nil { return nil } - return r.Rule + return r.Condition } -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetUpdateRule) GetParameters() *UpdateAllowsFetchAndMergeRuleParameters { +// GetChanges returns the Changes field. +func (r *RepositoryRulesetUpdatedRules) GetChanges() *RepositoryRulesetChangedRule { if r == nil { return nil } - return r.Parameters + return r.Changes } -// GetParameters returns the Parameters field. -func (r *RepositoryRulesetWorkflowsRule) GetParameters() *RequiredWorkflowsRuleParameters { +// GetRule returns the Rule field. +func (r *RepositoryRulesetUpdatedRules) GetRule() *RepositoryRule { if r == nil { return nil } - return r.Parameters + return r.Rule } // GetCommit returns the Commit field. @@ -21846,12 +24062,12 @@ func (r *RequiredStatusChecksRuleParameters) GetDoNotEnforceOnCreate() bool { return *r.DoNotEnforceOnCreate } -// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. -func (r *RequiredWorkflowSelectedRepos) GetTotalCount() int { - if r == nil || r.TotalCount == nil { - return 0 +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (r *RequireLastPushApprovalChanges) GetFrom() bool { + if r == nil || r.From == nil { + return false } - return *r.TotalCount + return *r.From } // GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. @@ -21926,32 +24142,8 @@ func (r *Rule) GetSeverity() string { return *r.Severity } -// GetRestrictedFilePaths returns the RestrictedFilePaths field if it's non-nil, zero value otherwise. -func (r *RuleFileParameters) GetRestrictedFilePaths() []string { - if r == nil || r.RestrictedFilePaths == nil { - return nil - } - return *r.RestrictedFilePaths -} - -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (r *RulePatternParameters) GetName() string { - if r == nil || r.Name == nil { - return "" - } - return *r.Name -} - -// GetNegate returns the Negate field if it's non-nil, zero value otherwise. -func (r *RulePatternParameters) GetNegate() bool { - if r == nil || r.Negate == nil { - return false - } - return *r.Negate -} - // GetIntegrationID returns the IntegrationID field if it's non-nil, zero value otherwise. -func (r *RuleRequiredStatusChecks) GetIntegrationID() int64 { +func (r *RuleStatusCheck) GetIntegrationID() int64 { if r == nil || r.IntegrationID == nil { return 0 } @@ -21959,7 +24151,7 @@ func (r *RuleRequiredStatusChecks) GetIntegrationID() int64 { } // GetRef returns the Ref field if it's non-nil, zero value otherwise. -func (r *RuleRequiredWorkflow) GetRef() string { +func (r *RuleWorkflow) GetRef() string { if r == nil || r.Ref == nil { return "" } @@ -21967,147 +24159,19 @@ func (r *RuleRequiredWorkflow) GetRef() string { } // GetRepositoryID returns the RepositoryID field if it's non-nil, zero value otherwise. -func (r *RuleRequiredWorkflow) GetRepositoryID() int64 { +func (r *RuleWorkflow) GetRepositoryID() int64 { if r == nil || r.RepositoryID == nil { return 0 } return *r.RepositoryID } -// GetSha returns the Sha field if it's non-nil, zero value otherwise. -func (r *RuleRequiredWorkflow) GetSha() string { - if r == nil || r.Sha == nil { - return "" - } - return *r.Sha -} - -// GetConditions returns the Conditions field. -func (r *Ruleset) GetConditions() *RulesetConditions { - if r == nil { - return nil - } - return r.Conditions -} - -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (r *Ruleset) GetCreatedAt() Timestamp { - if r == nil || r.CreatedAt == nil { - return Timestamp{} - } - return *r.CreatedAt -} - -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (r *Ruleset) GetID() int64 { - if r == nil || r.ID == nil { - return 0 - } - return *r.ID -} - -// GetLinks returns the Links field. -func (r *Ruleset) GetLinks() *RulesetLinks { - if r == nil { - return nil - } - return r.Links -} - -// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (r *Ruleset) GetNodeID() string { - if r == nil || r.NodeID == nil { - return "" - } - return *r.NodeID -} - -// GetSourceType returns the SourceType field if it's non-nil, zero value otherwise. -func (r *Ruleset) GetSourceType() string { - if r == nil || r.SourceType == nil { - return "" - } - return *r.SourceType -} - -// GetTarget returns the Target field if it's non-nil, zero value otherwise. -func (r *Ruleset) GetTarget() string { - if r == nil || r.Target == nil { - return "" - } - return *r.Target -} - -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (r *Ruleset) GetUpdatedAt() Timestamp { - if r == nil || r.UpdatedAt == nil { - return Timestamp{} - } - return *r.UpdatedAt -} - -// GetRefName returns the RefName field. -func (r *RulesetConditions) GetRefName() *RulesetRefConditionParameters { - if r == nil { - return nil - } - return r.RefName -} - -// GetRepositoryID returns the RepositoryID field. -func (r *RulesetConditions) GetRepositoryID() *RulesetRepositoryIDsConditionParameters { - if r == nil { - return nil - } - return r.RepositoryID -} - -// GetRepositoryName returns the RepositoryName field. -func (r *RulesetConditions) GetRepositoryName() *RulesetRepositoryNamesConditionParameters { - if r == nil { - return nil - } - return r.RepositoryName -} - -// GetRepositoryProperty returns the RepositoryProperty field. -func (r *RulesetConditions) GetRepositoryProperty() *RulesetRepositoryPropertyConditionParameters { - if r == nil { - return nil - } - return r.RepositoryProperty -} - -// GetHRef returns the HRef field if it's non-nil, zero value otherwise. -func (r *RulesetLink) GetHRef() string { - if r == nil || r.HRef == nil { - return "" - } - return *r.HRef -} - -// GetSelf returns the Self field. -func (r *RulesetLinks) GetSelf() *RulesetLink { - if r == nil { - return nil - } - return r.Self -} - -// GetProtected returns the Protected field if it's non-nil, zero value otherwise. -func (r *RulesetRepositoryNamesConditionParameters) GetProtected() bool { - if r == nil || r.Protected == nil { - return false - } - return *r.Protected -} - -// GetSource returns the Source field if it's non-nil, zero value otherwise. -func (r *RulesetRepositoryPropertyTargetParameters) GetSource() string { - if r == nil || r.Source == nil { +// GetSHA returns the SHA field if it's non-nil, zero value otherwise. +func (r *RuleWorkflow) GetSHA() string { + if r == nil || r.SHA == nil { return "" } - return *r.Source + return *r.SHA } // GetBusy returns the Busy field if it's non-nil, zero value otherwise. @@ -22558,6 +24622,46 @@ func (s *ScanningAnalysis) GetWarning() string { return *s.Warning } +// GetDisplay returns the Display field if it's non-nil, zero value otherwise. +func (s *SCIMDisplayReference) GetDisplay() string { + if s == nil || s.Display == nil { + return "" + } + return *s.Display +} + +// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. +func (s *SCIMGroupAttributes) GetDisplayName() string { + if s == nil || s.DisplayName == nil { + return "" + } + return *s.DisplayName +} + +// GetExternalID returns the ExternalID field if it's non-nil, zero value otherwise. +func (s *SCIMGroupAttributes) GetExternalID() string { + if s == nil || s.ExternalID == nil { + return "" + } + return *s.ExternalID +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (s *SCIMGroupAttributes) GetID() string { + if s == nil || s.ID == nil { + return "" + } + return *s.ID +} + +// GetMeta returns the Meta field. +func (s *SCIMGroupAttributes) GetMeta() *SCIMMeta { + if s == nil { + return nil + } + return s.Meta +} + // GetCreated returns the Created field if it's non-nil, zero value otherwise. func (s *SCIMMeta) GetCreated() Timestamp { if s == nil || s.Created == nil { @@ -22590,6 +24694,30 @@ func (s *SCIMMeta) GetResourceType() string { return *s.ResourceType } +// GetItemsPerPage returns the ItemsPerPage field if it's non-nil, zero value otherwise. +func (s *SCIMProvisionedGroups) GetItemsPerPage() int { + if s == nil || s.ItemsPerPage == nil { + return 0 + } + return *s.ItemsPerPage +} + +// GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise. +func (s *SCIMProvisionedGroups) GetStartIndex() int { + if s == nil || s.StartIndex == nil { + return 0 + } + return *s.StartIndex +} + +// GetTotalResults returns the TotalResults field if it's non-nil, zero value otherwise. +func (s *SCIMProvisionedGroups) GetTotalResults() int { + if s == nil || s.TotalResults == nil { + return 0 + } + return *s.TotalResults +} + // GetItemsPerPage returns the ItemsPerPage field if it's non-nil, zero value otherwise. func (s *SCIMProvisionedIdentities) GetItemsPerPage() int { if s == nil || s.ItemsPerPage == nil { @@ -22702,6 +24830,14 @@ func (s *SecretScanningAlert) GetHTMLURL() string { return *s.HTMLURL } +// GetIsBase64Encoded returns the IsBase64Encoded field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetIsBase64Encoded() bool { + if s == nil || s.IsBase64Encoded == nil { + return false + } + return *s.IsBase64Encoded +} + // GetLocationsURL returns the LocationsURL field if it's non-nil, zero value otherwise. func (s *SecretScanningAlert) GetLocationsURL() string { if s == nil || s.LocationsURL == nil { @@ -22710,6 +24846,14 @@ func (s *SecretScanningAlert) GetLocationsURL() string { return *s.LocationsURL } +// GetMultiRepo returns the MultiRepo field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetMultiRepo() bool { + if s == nil || s.MultiRepo == nil { + return false + } + return *s.MultiRepo +} + // GetNumber returns the Number field if it's non-nil, zero value otherwise. func (s *SecretScanningAlert) GetNumber() int { if s == nil || s.Number == nil { @@ -22718,6 +24862,14 @@ func (s *SecretScanningAlert) GetNumber() int { return *s.Number } +// GetPubliclyLeaked returns the PubliclyLeaked field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetPubliclyLeaked() bool { + if s == nil || s.PubliclyLeaked == nil { + return false + } + return *s.PubliclyLeaked +} + // GetPushProtectionBypassed returns the PushProtectionBypassed field if it's non-nil, zero value otherwise. func (s *SecretScanningAlert) GetPushProtectionBypassed() bool { if s == nil || s.PushProtectionBypassed == nil { @@ -22742,6 +24894,38 @@ func (s *SecretScanningAlert) GetPushProtectionBypassedBy() *User { return s.PushProtectionBypassedBy } +// GetPushProtectionBypassRequestComment returns the PushProtectionBypassRequestComment field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetPushProtectionBypassRequestComment() string { + if s == nil || s.PushProtectionBypassRequestComment == nil { + return "" + } + return *s.PushProtectionBypassRequestComment +} + +// GetPushProtectionBypassRequestHTMLURL returns the PushProtectionBypassRequestHTMLURL field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetPushProtectionBypassRequestHTMLURL() string { + if s == nil || s.PushProtectionBypassRequestHTMLURL == nil { + return "" + } + return *s.PushProtectionBypassRequestHTMLURL +} + +// GetPushProtectionBypassRequestReviewer returns the PushProtectionBypassRequestReviewer field. +func (s *SecretScanningAlert) GetPushProtectionBypassRequestReviewer() *User { + if s == nil { + return nil + } + return s.PushProtectionBypassRequestReviewer +} + +// GetPushProtectionBypassRequestReviewerComment returns the PushProtectionBypassRequestReviewerComment field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetPushProtectionBypassRequestReviewerComment() string { + if s == nil || s.PushProtectionBypassRequestReviewerComment == nil { + return "" + } + return *s.PushProtectionBypassRequestReviewerComment +} + // GetRepository returns the Repository field. func (s *SecretScanningAlert) GetRepository() *Repository { if s == nil { @@ -22830,6 +25014,14 @@ func (s *SecretScanningAlert) GetURL() string { return *s.URL } +// GetValidity returns the Validity field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetValidity() string { + if s == nil || s.Validity == nil { + return "" + } + return *s.Validity +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (s *SecretScanningAlertEvent) GetAction() string { if s == nil || s.Action == nil { @@ -22958,6 +25150,14 @@ func (s *SecretScanningAlertLocationDetails) GetPath() string { return *s.Path } +// GetPullRequestCommentURL returns the PullRequestCommentURL field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlertLocationDetails) GetPullRequestCommentURL() string { + if s == nil || s.PullRequestCommentURL == nil { + return "" + } + return *s.PullRequestCommentURL +} + // GetStartColumn returns the StartColumn field if it's non-nil, zero value otherwise. func (s *SecretScanningAlertLocationDetails) GetStartColumn() int { if s == nil || s.StartColumn == nil { @@ -23038,6 +25238,14 @@ func (s *SecretScanningAlertUpdateOptions) GetResolution() string { return *s.Resolution } +// GetResolutionComment returns the ResolutionComment field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlertUpdateOptions) GetResolutionComment() string { + if s == nil || s.ResolutionComment == nil { + return "" + } + return *s.ResolutionComment +} + // GetStatus returns the Status field if it's non-nil, zero value otherwise. func (s *SecretScanningPushProtection) GetStatus() string { if s == nil || s.Status == nil { @@ -23606,6 +25814,38 @@ func (s *SponsorshipTier) GetFrom() string { return *s.From } +// GetHostname returns the Hostname field if it's non-nil, zero value otherwise. +func (s *SSHKeyStatus) GetHostname() string { + if s == nil || s.Hostname == nil { + return "" + } + return *s.Hostname +} + +// GetMessage returns the Message field if it's non-nil, zero value otherwise. +func (s *SSHKeyStatus) GetMessage() string { + if s == nil || s.Message == nil { + return "" + } + return *s.Message +} + +// GetModified returns the Modified field if it's non-nil, zero value otherwise. +func (s *SSHKeyStatus) GetModified() bool { + if s == nil || s.Modified == nil { + return false + } + return *s.Modified +} + +// GetUUID returns the UUID field if it's non-nil, zero value otherwise. +func (s *SSHKeyStatus) GetUUID() string { + if s == nil || s.UUID == nil { + return "" + } + return *s.UUID +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (s *SSHSigningKey) GetCreatedAt() Timestamp { if s == nil || s.CreatedAt == nil { @@ -23830,6 +26070,30 @@ func (s *StatusEvent) GetUpdatedAt() Timestamp { return *s.UpdatedAt } +// GetAfterID returns the AfterID field if it's non-nil, zero value otherwise. +func (s *SubIssueRequest) GetAfterID() int64 { + if s == nil || s.AfterID == nil { + return 0 + } + return *s.AfterID +} + +// GetBeforeID returns the BeforeID field if it's non-nil, zero value otherwise. +func (s *SubIssueRequest) GetBeforeID() int64 { + if s == nil || s.BeforeID == nil { + return 0 + } + return *s.BeforeID +} + +// GetReplaceParent returns the ReplaceParent field if it's non-nil, zero value otherwise. +func (s *SubIssueRequest) GetReplaceParent() bool { + if s == nil || s.ReplaceParent == nil { + return false + } + return *s.ReplaceParent +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (s *Subscription) GetCreatedAt() Timestamp { if s == nil || s.CreatedAt == nil { @@ -23886,6 +26150,46 @@ func (s *Subscription) GetURL() string { return *s.URL } +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (s *SystemRequirements) GetStatus() string { + if s == nil || s.Status == nil { + return "" + } + return *s.Status +} + +// GetHostname returns the Hostname field if it's non-nil, zero value otherwise. +func (s *SystemRequirementsNode) GetHostname() string { + if s == nil || s.Hostname == nil { + return "" + } + return *s.Hostname +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (s *SystemRequirementsNode) GetStatus() string { + if s == nil || s.Status == nil { + return "" + } + return *s.Status +} + +// GetRole returns the Role field if it's non-nil, zero value otherwise. +func (s *SystemRequirementsNodeRoleStatus) GetRole() string { + if s == nil || s.Role == nil { + return "" + } + return *s.Role +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (s *SystemRequirementsNodeRoleStatus) GetStatus() string { + if s == nil || s.Status == nil { + return "" + } + return *s.Status +} + // GetMessage returns the Message field if it's non-nil, zero value otherwise. func (t *Tag) GetMessage() string { if t == nil || t.Message == nil { @@ -24014,6 +26318,14 @@ func (t *TaskStep) GetStatus() string { return *t.Status } +// GetAssignment returns the Assignment field if it's non-nil, zero value otherwise. +func (t *Team) GetAssignment() string { + if t == nil || t.Assignment == nil { + return "" + } + return *t.Assignment +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (t *Team) GetDescription() string { if t == nil || t.Description == nil { @@ -24078,6 +26390,14 @@ func (t *Team) GetNodeID() string { return *t.NodeID } +// GetNotificationSetting returns the NotificationSetting field if it's non-nil, zero value otherwise. +func (t *Team) GetNotificationSetting() string { + if t == nil || t.NotificationSetting == nil { + return "" + } + return *t.NotificationSetting +} + // GetOrganization returns the Organization field. func (t *Team) GetOrganization() *Organization { if t == nil { @@ -24766,14 +27086,6 @@ func (t *Timeline) GetPerformedViaGithubApp() *App { return t.PerformedViaGithubApp } -// GetProjectCard returns the ProjectCard field. -func (t *Timeline) GetProjectCard() *ProjectCard { - if t == nil { - return nil - } - return t.ProjectCard -} - // GetRename returns the Rename field. func (t *Timeline) GetRename() *Rename { if t == nil { @@ -25310,6 +27622,134 @@ func (u *UpdateRunnerGroupRequest) GetVisibility() string { return *u.Visibility } +// GetDate returns the Date field if it's non-nil, zero value otherwise. +func (u *UsageItem) GetDate() string { + if u == nil || u.Date == nil { + return "" + } + return *u.Date +} + +// GetDiscountAmount returns the DiscountAmount field. +func (u *UsageItem) GetDiscountAmount() *float64 { + if u == nil { + return nil + } + return u.DiscountAmount +} + +// GetGrossAmount returns the GrossAmount field. +func (u *UsageItem) GetGrossAmount() *float64 { + if u == nil { + return nil + } + return u.GrossAmount +} + +// GetNetAmount returns the NetAmount field. +func (u *UsageItem) GetNetAmount() *float64 { + if u == nil { + return nil + } + return u.NetAmount +} + +// GetOrganizationName returns the OrganizationName field if it's non-nil, zero value otherwise. +func (u *UsageItem) GetOrganizationName() string { + if u == nil || u.OrganizationName == nil { + return "" + } + return *u.OrganizationName +} + +// GetPricePerUnit returns the PricePerUnit field. +func (u *UsageItem) GetPricePerUnit() *float64 { + if u == nil { + return nil + } + return u.PricePerUnit +} + +// GetProduct returns the Product field if it's non-nil, zero value otherwise. +func (u *UsageItem) GetProduct() string { + if u == nil || u.Product == nil { + return "" + } + return *u.Product +} + +// GetQuantity returns the Quantity field. +func (u *UsageItem) GetQuantity() *float64 { + if u == nil { + return nil + } + return u.Quantity +} + +// GetRepositoryName returns the RepositoryName field if it's non-nil, zero value otherwise. +func (u *UsageItem) GetRepositoryName() string { + if u == nil || u.RepositoryName == nil { + return "" + } + return *u.RepositoryName +} + +// GetSKU returns the SKU field if it's non-nil, zero value otherwise. +func (u *UsageItem) GetSKU() string { + if u == nil || u.SKU == nil { + return "" + } + return *u.SKU +} + +// GetUnitType returns the UnitType field if it's non-nil, zero value otherwise. +func (u *UsageItem) GetUnitType() string { + if u == nil || u.UnitType == nil { + return "" + } + return *u.UnitType +} + +// GetDay returns the Day field if it's non-nil, zero value otherwise. +func (u *UsageReportOptions) GetDay() int { + if u == nil || u.Day == nil { + return 0 + } + return *u.Day +} + +// GetHour returns the Hour field if it's non-nil, zero value otherwise. +func (u *UsageReportOptions) GetHour() int { + if u == nil || u.Hour == nil { + return 0 + } + return *u.Hour +} + +// GetMonth returns the Month field if it's non-nil, zero value otherwise. +func (u *UsageReportOptions) GetMonth() int { + if u == nil || u.Month == nil { + return 0 + } + return *u.Month +} + +// GetYear returns the Year field if it's non-nil, zero value otherwise. +func (u *UsageReportOptions) GetYear() int { + if u == nil || u.Year == nil { + return 0 + } + return *u.Year +} + +// GetAssignment returns the Assignment field if it's non-nil, zero value otherwise. +func (u *User) GetAssignment() string { + if u == nil || u.Assignment == nil { + return "" + } + return *u.Assignment +} + // GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise. func (u *User) GetAvatarURL() string { if u == nil || u.AvatarURL == nil { @@ -26494,6 +28934,14 @@ func (w *WorkflowJobEvent) GetAction() string { return *w.Action } +// GetDeployment returns the Deployment field. +func (w *WorkflowJobEvent) GetDeployment() *Deployment { + if w == nil { + return nil + } + return w.Deployment +} + // GetInstallation returns the Installation field. func (w *WorkflowJobEvent) GetInstallation() *Installation { if w == nil { @@ -26990,6 +29438,14 @@ func (w *Workflows) GetTotalCount() int { return *w.TotalCount } +// GetDoNotEnforceOnCreate returns the DoNotEnforceOnCreate field if it's non-nil, zero value otherwise. +func (w *WorkflowsRuleParameters) GetDoNotEnforceOnCreate() bool { + if w == nil || w.DoNotEnforceOnCreate == nil { + return false + } + return *w.DoNotEnforceOnCreate +} + // GetBillable returns the Billable field. func (w *WorkflowUsage) GetBillable() *WorkflowBillMap { if w == nil { diff --git a/vendor/github.com/google/go-github/v66/github/github.go b/vendor/github.com/google/go-github/v74/github/github.go similarity index 82% rename from vendor/github.com/google/go-github/v66/github/github.go rename to vendor/github.com/google/go-github/v74/github/github.go index 042a0b52e7..bb81b00c10 100644 --- a/vendor/github.com/google/go-github/v66/github/github.go +++ b/vendor/github.com/google/go-github/v74/github/github.go @@ -19,6 +19,7 @@ import ( "net/http" "net/url" "reflect" + "regexp" "strconv" "strings" "sync" @@ -28,21 +29,23 @@ import ( ) const ( - Version = "v66.0.0" + Version = "v74.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" defaultUserAgent = "go-github" + "/" + Version uploadBaseURL = "https://uploads.github.com/" - headerAPIVersion = "X-GitHub-Api-Version" - headerRateLimit = "X-RateLimit-Limit" - headerRateRemaining = "X-RateLimit-Remaining" - headerRateReset = "X-RateLimit-Reset" - headerOTP = "X-GitHub-OTP" + headerAPIVersion = "X-Github-Api-Version" + headerRateLimit = "X-Ratelimit-Limit" + headerRateRemaining = "X-Ratelimit-Remaining" + headerRateUsed = "X-Ratelimit-Used" + headerRateReset = "X-Ratelimit-Reset" + headerRateResource = "X-Ratelimit-Resource" + headerOTP = "X-Github-Otp" headerRetryAfter = "Retry-After" - headerTokenExpiration = "GitHub-Authentication-Token-Expiration" + headerTokenExpiration = "Github-Authentication-Token-Expiration" mediaTypeV3 = "application/vnd.github.v3+json" defaultMediaType = "application/octet-stream" @@ -51,6 +54,7 @@ const ( mediaTypeV3Patch = "application/vnd.github.v3.patch" mediaTypeOrgPermissionRepo = "application/vnd.github.v3.repository+json" mediaTypeIssueImportAPI = "application/vnd.github.golden-comet-preview+json" + mediaTypeStarring = "application/vnd.github.star+json" // Media Type values to access preview APIs // These media types will be added to the API request as headers @@ -69,9 +73,6 @@ const ( // // See https://github.com/google/go-github/pull/2125 for full context. - // https://developer.github.com/changes/2014-12-09-new-attributes-for-stars-api/ - mediaTypeStarringPreview = "application/vnd.github.v3.star+json" - // https://help.github.com/enterprise/2.4/admin/guides/migrations/exporting-the-github-com-organization-s-repositories/ mediaTypeMigrationsPreview = "application/vnd.github.wyandotte-preview+json" @@ -155,8 +156,9 @@ var errNonNilContext = errors.New("context must be non-nil") // A Client manages communication with the GitHub API. type Client struct { - clientMu sync.Mutex // clientMu protects the client during calls that modify the CheckRedirect func. - client *http.Client // HTTP client used to communicate with the API. + clientMu sync.Mutex // clientMu protects the client during calls that modify the CheckRedirect func. + client *http.Client // HTTP client used to communicate with the API. + clientIgnoreRedirects *http.Client // HTTP client used to communicate with the API on endpoints where we don't want to follow redirects. // Base URL for API requests. Defaults to the public GitHub API, but can be // set to a domain endpoint to use with GitHub Enterprise. BaseURL should @@ -169,10 +171,22 @@ type Client struct { // User agent used when communicating with the GitHub API. UserAgent string + // DisableRateLimitCheck stops the client checking for rate limits or tracking + // them. This is different to setting BypassRateLimitCheck in the context, + // as that still tracks the rate limits. + DisableRateLimitCheck bool + rateMu sync.Mutex rateLimits [Categories]Rate // Rate limits for the client as determined by the most recent API calls. secondaryRateLimitReset time.Time // Secondary rate limit reset for the client as determined by the most recent API calls. + // If specified, Client will block requests for at most this duration in case of reaching a secondary + // rate limit + MaxSecondaryRateLimitRetryAfterDuration time.Duration + + // Whether to respect rate limit headers on endpoints that return 302 redirections to artifacts + RateLimitRedirectionalEndpoints bool + common service // Reuse a single struct instead of allocating one for each service on the heap. // Services used for talking to different parts of the GitHub API. @@ -203,7 +217,6 @@ type Client struct { Meta *MetaService Migrations *MigrationService Organizations *OrganizationsService - Projects *ProjectsService PullRequests *PullRequestsService RateLimit *RateLimitService Reactions *ReactionsService @@ -212,6 +225,7 @@ type Client struct { Search *SearchService SecretScanning *SecretScanningService SecurityAdvisories *SecurityAdvisoriesService + SubIssue *SubIssueService Teams *TeamsService Users *UsersService } @@ -292,7 +306,7 @@ type RawOptions struct { // addOptions adds the parameters in opts as URL query parameters to s. opts // must be a struct whose fields may contain "url" tags. -func addOptions(s string, opts interface{}) (string, error) { +func addOptions(s string, opts any) (string, error) { v := reflect.ValueOf(opts) if v.Kind() == reflect.Ptr && v.IsNil() { return s, nil @@ -395,6 +409,14 @@ func (c *Client) initialize() { if c.client == nil { c.client = &http.Client{} } + // Copy the main http client into the IgnoreRedirects one, overriding the `CheckRedirect` func + c.clientIgnoreRedirects = &http.Client{} + c.clientIgnoreRedirects.Transport = c.client.Transport + c.clientIgnoreRedirects.Timeout = c.client.Timeout + c.clientIgnoreRedirects.Jar = c.client.Jar + c.clientIgnoreRedirects.CheckRedirect = func(*http.Request, []*http.Request) error { + return http.ErrUseLastResponse + } if c.BaseURL == nil { c.BaseURL, _ = url.Parse(defaultBaseURL) } @@ -432,7 +454,6 @@ func (c *Client) initialize() { c.Meta = (*MetaService)(&c.common) c.Migrations = (*MigrationService)(&c.common) c.Organizations = (*OrganizationsService)(&c.common) - c.Projects = (*ProjectsService)(&c.common) c.PullRequests = (*PullRequestsService)(&c.common) c.RateLimit = (*RateLimitService)(&c.common) c.Reactions = (*ReactionsService)(&c.common) @@ -441,6 +462,7 @@ func (c *Client) initialize() { c.Search = (*SearchService)(&c.common) c.SecretScanning = (*SecretScanningService)(&c.common) c.SecurityAdvisories = (*SecurityAdvisoriesService)(&c.common) + c.SubIssue = (*SubIssueService)(&c.common) c.Teams = (*TeamsService)(&c.common) c.Users = (*UsersService)(&c.common) } @@ -450,11 +472,12 @@ func (c *Client) copy() *Client { c.clientMu.Lock() // can't use *c here because that would copy mutexes by value. clone := Client{ - client: &http.Client{}, - UserAgent: c.UserAgent, - BaseURL: c.BaseURL, - UploadURL: c.UploadURL, - secondaryRateLimitReset: c.secondaryRateLimitReset, + client: &http.Client{}, + UserAgent: c.UserAgent, + BaseURL: c.BaseURL, + UploadURL: c.UploadURL, + RateLimitRedirectionalEndpoints: c.RateLimitRedirectionalEndpoints, + secondaryRateLimitReset: c.secondaryRateLimitReset, } c.clientMu.Unlock() if c.client != nil { @@ -506,9 +529,9 @@ func WithVersion(version string) RequestOption { // Relative URLs should always be specified without a preceding slash. If // specified, the value pointed to by body is JSON encoded and included as the // request body. -func (c *Client) NewRequest(method, urlStr string, body interface{}, opts ...RequestOption) (*http.Request, error) { +func (c *Client) NewRequest(method, urlStr string, body any, opts ...RequestOption) (*http.Request, error) { if !strings.HasSuffix(c.BaseURL.Path, "/") { - return nil, fmt.Errorf("BaseURL must have a trailing slash, but %q does not", c.BaseURL) + return nil, fmt.Errorf("baseURL must have a trailing slash, but %q does not", c.BaseURL) } u, err := c.BaseURL.Parse(urlStr) @@ -554,7 +577,7 @@ func (c *Client) NewRequest(method, urlStr string, body interface{}, opts ...Req // Body is sent with Content-Type: application/x-www-form-urlencoded. func (c *Client) NewFormRequest(urlStr string, body io.Reader, opts ...RequestOption) (*http.Request, error) { if !strings.HasSuffix(c.BaseURL.Path, "/") { - return nil, fmt.Errorf("BaseURL must have a trailing slash, but %q does not", c.BaseURL) + return nil, fmt.Errorf("baseURL must have a trailing slash, but %q does not", c.BaseURL) } u, err := c.BaseURL.Parse(urlStr) @@ -586,7 +609,7 @@ func (c *Client) NewFormRequest(urlStr string, body io.Reader, opts ...RequestOp // Relative URLs should always be specified without a preceding slash. func (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, mediaType string, opts ...RequestOption) (*http.Request, error) { if !strings.HasSuffix(c.UploadURL.Path, "/") { - return nil, fmt.Errorf("UploadURL must have a trailing slash, but %q does not", c.UploadURL) + return nil, fmt.Errorf("uploadURL must have a trailing slash, but %q does not", c.UploadURL) } u, err := c.UploadURL.Parse(urlStr) if err != nil { @@ -752,11 +775,17 @@ func parseRate(r *http.Response) Rate { if remaining := r.Header.Get(headerRateRemaining); remaining != "" { rate.Remaining, _ = strconv.Atoi(remaining) } + if used := r.Header.Get(headerRateUsed); used != "" { + rate.Used, _ = strconv.Atoi(used) + } if reset := r.Header.Get(headerRateReset); reset != "" { if v, _ := strconv.ParseInt(reset, 10, 64); v != 0 { rate.Reset = Timestamp{time.Unix(v, 0)} } } + if resource := r.Header.Get(headerRateResource); resource != "" { + rate.Resource = resource + } return rate } @@ -803,50 +832,64 @@ func parseTokenExpiration(r *http.Response) Timestamp { type requestContext uint8 const ( - bypassRateLimitCheck requestContext = iota + // BypassRateLimitCheck prevents a pre-emptive check for exceeded primary rate limits + // Specify this by providing a context with this key, e.g. + // context.WithValue(context.Background(), github.BypassRateLimitCheck, true) + BypassRateLimitCheck requestContext = iota + SleepUntilPrimaryRateLimitResetWhenRateLimited ) -// BareDo sends an API request and lets you handle the api response. If an error -// or API Error occurs, the error will contain more information. Otherwise you -// are supposed to read and close the response's Body. If rate limit is exceeded -// and reset time is in the future, BareDo returns *RateLimitError immediately -// without making a network API call. +// bareDo sends an API request using `caller` http.Client passed in the parameters +// and lets you handle the api response. If an error or API Error occurs, the error +// will contain more information. Otherwise you are supposed to read and close the +// response's Body. If rate limit is exceeded and reset time is in the future, +// bareDo returns *RateLimitError immediately without making a network API call. // // The provided ctx must be non-nil, if it is nil an error is returned. If it is // canceled or times out, ctx.Err() will be returned. -func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, error) { +func (c *Client) bareDo(ctx context.Context, caller *http.Client, req *http.Request) (*Response, error) { if ctx == nil { return nil, errNonNilContext } req = withContext(ctx, req) - rateLimitCategory := GetRateLimitCategory(req.Method, req.URL.Path) + rateLimitCategory := CoreCategory - if bypass := ctx.Value(bypassRateLimitCheck); bypass == nil { - // If we've hit rate limit, don't make further requests before Reset time. - if err := c.checkRateLimitBeforeDo(req, rateLimitCategory); err != nil { - return &Response{ - Response: err.Response, - Rate: err.Rate, - }, err - } - // If we've hit a secondary rate limit, don't make further requests before Retry After. - if err := c.checkSecondaryRateLimitBeforeDo(req); err != nil { - return &Response{ - Response: err.Response, - }, err + if !c.DisableRateLimitCheck { + rateLimitCategory = GetRateLimitCategory(req.Method, req.URL.Path) + + if bypass := ctx.Value(BypassRateLimitCheck); bypass == nil { + // If we've hit rate limit, don't make further requests before Reset time. + if err := c.checkRateLimitBeforeDo(req, rateLimitCategory); err != nil { + return &Response{ + Response: err.Response, + Rate: err.Rate, + }, err + } + + // If we've hit a secondary rate limit, don't make further requests before Retry After. + if err := c.checkSecondaryRateLimitBeforeDo(req); err != nil { + return &Response{ + Response: err.Response, + }, err + } } } - resp, err := c.client.Do(req) + resp, err := caller.Do(req) + var response *Response + if resp != nil { + response = newResponse(resp) + } + if err != nil { // If we got an error, and the context has been canceled, // the context's error is probably more useful. select { case <-ctx.Done(): - return nil, ctx.Err() + return response, ctx.Err() default: } @@ -854,18 +897,17 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro if e, ok := err.(*url.Error); ok { if url, err := url.Parse(e.URL); err == nil { e.URL = sanitizeURL(url).String() - return nil, e + return response, e } } - return nil, err + return response, err } - response := newResponse(resp) - - // Don't update the rate limits if this was a cached response. - // X-From-Cache is set by https://github.com/gregjones/httpcache - if response.Header.Get("X-From-Cache") == "" { + // Don't update the rate limits if the client has rate limits disabled or if + // this was a cached response. The X-From-Cache is set by + // https://github.com/bartventer/httpcache if it's enabled. + if !c.DisableRateLimitCheck && response.Header.Get("X-From-Cache") == "" { c.rateMu.Lock() c.rateLimits[rateLimitCategory] = response.Rate c.rateMu.Unlock() @@ -896,12 +938,16 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro return response, err } // retry the request once when the rate limit has reset - return c.BareDo(context.WithValue(req.Context(), SleepUntilPrimaryRateLimitResetWhenRateLimited, nil), req) + return c.bareDo(context.WithValue(req.Context(), SleepUntilPrimaryRateLimitResetWhenRateLimited, nil), caller, req) } // Update the secondary rate limit if we hit it. rerr, ok := err.(*AbuseRateLimitError) if ok && rerr.RetryAfter != nil { + // if a max duration is specified, make sure that we are waiting at most this duration + if c.MaxSecondaryRateLimitRetryAfterDuration > 0 && rerr.GetRetryAfter() > c.MaxSecondaryRateLimitRetryAfterDuration { + rerr.RetryAfter = &c.MaxSecondaryRateLimitRetryAfterDuration + } c.rateMu.Lock() c.secondaryRateLimitReset = time.Now().Add(*rerr.RetryAfter) c.rateMu.Unlock() @@ -910,6 +956,72 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro return response, err } +// BareDo sends an API request and lets you handle the api response. If an error +// or API Error occurs, the error will contain more information. Otherwise you +// are supposed to read and close the response's Body. If rate limit is exceeded +// and reset time is in the future, BareDo returns *RateLimitError immediately +// without making a network API call. +// +// The provided ctx must be non-nil, if it is nil an error is returned. If it is +// canceled or times out, ctx.Err() will be returned. +func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, error) { + return c.bareDo(ctx, c.client, req) +} + +// bareDoIgnoreRedirects has the exact same behavior as BareDo but stops at the first +// redirection code returned by the API. If a redirection is returned by the api, bareDoIgnoreRedirects +// returns a *RedirectionError. +// +// The provided ctx must be non-nil, if it is nil an error is returned. If it is +// canceled or times out, ctx.Err() will be returned. +func (c *Client) bareDoIgnoreRedirects(ctx context.Context, req *http.Request) (*Response, error) { + return c.bareDo(ctx, c.clientIgnoreRedirects, req) +} + +var errInvalidLocation = errors.New("invalid or empty Location header in redirection response") + +// bareDoUntilFound has the exact same behavior as BareDo but only follows 301s, up to maxRedirects times. If it receives +// a 302, it will parse the Location header into a *url.URL and return that. +// This is useful for endpoints that return a 302 in successful cases but still might return 301s for +// permanent redirections. +// +// The provided ctx must be non-nil, if it is nil an error is returned. If it is +// canceled or times out, ctx.Err() will be returned. +func (c *Client) bareDoUntilFound(ctx context.Context, req *http.Request, maxRedirects int) (*url.URL, *Response, error) { + response, err := c.bareDoIgnoreRedirects(ctx, req) + if err != nil { + rerr, ok := err.(*RedirectionError) + if ok { + // If we receive a 302, transform potential relative locations into absolute and return it. + if rerr.StatusCode == http.StatusFound { + if rerr.Location == nil { + return nil, nil, errInvalidLocation + } + newURL := c.BaseURL.ResolveReference(rerr.Location) + return newURL, response, nil + } + // If permanent redirect response is returned, follow it + if maxRedirects > 0 && rerr.StatusCode == http.StatusMovedPermanently { + if rerr.Location == nil { + return nil, nil, errInvalidLocation + } + newURL := c.BaseURL.ResolveReference(rerr.Location) + newRequest := req.Clone(ctx) + newRequest.URL = newURL + return c.bareDoUntilFound(ctx, newRequest, maxRedirects-1) + } + // If we reached the maximum amount of redirections, return an error + if maxRedirects <= 0 && rerr.StatusCode == http.StatusMovedPermanently { + return nil, response, fmt.Errorf("reached the maximum amount of redirections: %w", err) + } + return nil, response, fmt.Errorf("unexpected redirection response: %w", err) + } + } + + // If we don't receive a redirection, forward the response and potential error + return nil, response, err +} + // Do sends an API request and returns the API response. The API response is // JSON decoded and stored in the value pointed to by v, or returned as an // error if an API error has occurred. If v implements the io.Writer interface, @@ -920,7 +1032,7 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro // // The provided ctx must be non-nil, if it is nil an error is returned. If it // is canceled or times out, ctx.Err() will be returned. -func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Response, error) { +func (c *Client) Do(ctx context.Context, req *http.Request, v any) (*Response, error) { resp, err := c.BareDo(ctx, req) if err != nil { return resp, err @@ -1033,7 +1145,8 @@ GitHub API docs: https://docs.github.com/rest/#client-errors type ErrorResponse struct { Response *http.Response `json:"-"` // HTTP response that caused this error Message string `json:"message"` // error message - Errors []Error `json:"errors"` // more detail on individual errors + //nolint:sliceofpointers + Errors []Error `json:"errors"` // more detail on individual errors // Block is only populated on certain types of errors such as code 451. Block *ErrorBlock `json:"block,omitempty"` // Most errors will also include a documentation_url field pointing @@ -1195,6 +1308,40 @@ func (r *AbuseRateLimitError) Is(target error) bool { compareHTTPResponse(r.Response, v.Response) } +// RedirectionError represents a response that returned a redirect status code: +// +// 301 (Moved Permanently) +// 302 (Found) +// 303 (See Other) +// 307 (Temporary Redirect) +// 308 (Permanent Redirect) +// +// If there was a valid Location header included, it will be parsed to a URL. You should use +// `BaseURL.ResolveReference()` to enrich it with the correct hostname where needed. +type RedirectionError struct { + Response *http.Response // HTTP response that caused this error + StatusCode int + Location *url.URL // location header of the redirection if present +} + +func (r *RedirectionError) Error() string { + return fmt.Sprintf("%v %v: %d location %v", + r.Response.Request.Method, sanitizeURL(r.Response.Request.URL), + r.StatusCode, sanitizeURL(r.Location)) +} + +// Is returns whether the provided error equals this error. +func (r *RedirectionError) Is(target error) bool { + v, ok := target.(*RedirectionError) + if !ok { + return false + } + + return r.StatusCode == v.StatusCode && + (r.Location == v.Location || // either both locations are nil or exactly the same pointer + r.Location != nil && v.Location != nil && r.Location.String() == v.Location.String()) // or they are both not nil and marshaled identically +} + // sanitizeURL redacts the client_secret parameter from the URL which may be // exposed to the user. func sanitizeURL(uri *url.URL) *url.URL { @@ -1255,11 +1402,12 @@ func (e *Error) UnmarshalJSON(data []byte) error { // present. A response is considered an error if it has a status code outside // the 200 range or equal to 202 Accepted. // API error responses are expected to have response -// body, and a JSON response body that maps to ErrorResponse. +// body, and a JSON response body that maps to [ErrorResponse]. // -// The error type will be *RateLimitError for rate limit exceeded errors, -// *AcceptedError for 202 Accepted status codes, -// and *TwoFactorAuthError for two-factor authentication errors. +// The error type will be *[RateLimitError] for rate limit exceeded errors, +// *[AcceptedError] for 202 Accepted status codes, +// *[TwoFactorAuthError] for two-factor authentication errors, +// and *[RedirectionError] for redirect status codes (only happens when ignoring redirections). func CheckResponse(r *http.Response) error { if r.StatusCode == http.StatusAccepted { return &AcceptedError{} @@ -1301,6 +1449,25 @@ func CheckResponse(r *http.Response) error { abuseRateLimitError.RetryAfter = retryAfter } return abuseRateLimitError + // Check that the status code is a redirection and return a sentinel error that can be used to handle special cases + // where 302 is considered a successful result. + // This should never happen with the default `CheckRedirect`, because it would return a `url.Error` that should be handled upstream. + case r.StatusCode == http.StatusMovedPermanently || + r.StatusCode == http.StatusFound || + r.StatusCode == http.StatusSeeOther || + r.StatusCode == http.StatusTemporaryRedirect || + r.StatusCode == http.StatusPermanentRedirect: + + locationStr := r.Header.Get("Location") + var location *url.URL + if locationStr != "" { + location, _ = url.Parse(locationStr) + } + return &RedirectionError{ + Response: errorResponse.Response, + StatusCode: r.StatusCode, + Location: location, + } default: return errorResponse } @@ -1430,8 +1597,8 @@ that need to use a higher rate limit associated with your OAuth application. This will add the client id and secret as a base64-encoded string in the format ClientID:ClientSecret and apply it as an "Authorization": "Basic" header. -See https://docs.github.com/rest/#unauthenticated-rate-limited-requests for -more information. +See https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api#primary-rate-limit-for-oauth-apps +for more information. */ type UnauthenticatedRateLimitedTransport struct { // ClientID is the GitHub OAuth client ID of the current application, which @@ -1579,20 +1746,34 @@ func (c *Client) roundTripWithOptionalFollowRedirect(ctx context.Context, u stri return resp, err } +// Ptr is a helper routine that allocates a new T value +// to store v and returns a pointer to it. +func Ptr[T any](v T) *T { + return &v +} + // Bool is a helper routine that allocates a new bool value // to store v and returns a pointer to it. +// +// Deprecated: use Ptr instead. func Bool(v bool) *bool { return &v } // Int is a helper routine that allocates a new int value // to store v and returns a pointer to it. +// +// Deprecated: use Ptr instead. func Int(v int) *int { return &v } // Int64 is a helper routine that allocates a new int64 value // to store v and returns a pointer to it. +// +// Deprecated: use Ptr instead. func Int64(v int64) *int64 { return &v } // String is a helper routine that allocates a new string value // to store v and returns a pointer to it. +// +// Deprecated: use Ptr instead. func String(v string) *string { return &v } // roundTripperFunc creates a RoundTripper (transport). @@ -1601,3 +1782,18 @@ type roundTripperFunc func(*http.Request) (*http.Response, error) func (fn roundTripperFunc) RoundTrip(r *http.Request) (*http.Response, error) { return fn(r) } + +var runIDFromURLRE = regexp.MustCompile(`repos/.*/actions/runs/(\d+)/deployment_protection_rule$`) + +// GetRunID is a Helper Function used to extract the workflow RunID from the *DeploymentProtectionRuleEvent.DeploymentCallBackURL. +func (e *DeploymentProtectionRuleEvent) GetRunID() (int64, error) { + match := runIDFromURLRE.FindStringSubmatch(*e.DeploymentCallbackURL) + if len(match) != 2 { + return -1, errors.New("no match") + } + runID, err := strconv.ParseInt(match[1], 10, 64) + if err != nil { + return -1, err + } + return runID, nil +} diff --git a/vendor/github.com/google/go-github/v66/github/gitignore.go b/vendor/github.com/google/go-github/v74/github/gitignore.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/gitignore.go rename to vendor/github.com/google/go-github/v74/github/gitignore.go diff --git a/vendor/github.com/google/go-github/v66/github/interactions.go b/vendor/github.com/google/go-github/v74/github/interactions.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/interactions.go rename to vendor/github.com/google/go-github/v74/github/interactions.go diff --git a/vendor/github.com/google/go-github/v66/github/interactions_orgs.go b/vendor/github.com/google/go-github/v74/github/interactions_orgs.go similarity index 97% rename from vendor/github.com/google/go-github/v66/github/interactions_orgs.go rename to vendor/github.com/google/go-github/v74/github/interactions_orgs.go index f0ba0b15f0..47998c4eef 100644 --- a/vendor/github.com/google/go-github/v66/github/interactions_orgs.go +++ b/vendor/github.com/google/go-github/v74/github/interactions_orgs.go @@ -47,7 +47,7 @@ func (s *InteractionsService) GetRestrictionsForOrg(ctx context.Context, organiz func (s *InteractionsService) UpdateRestrictionsForOrg(ctx context.Context, organization, limit string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("orgs/%v/interaction-limits", organization) - interaction := &InteractionRestriction{Limit: String(limit)} + interaction := &InteractionRestriction{Limit: Ptr(limit)} req, err := s.client.NewRequest("PUT", u, interaction) if err != nil { diff --git a/vendor/github.com/google/go-github/v66/github/interactions_repos.go b/vendor/github.com/google/go-github/v74/github/interactions_repos.go similarity index 97% rename from vendor/github.com/google/go-github/v66/github/interactions_repos.go rename to vendor/github.com/google/go-github/v74/github/interactions_repos.go index 9c044badd1..58fd4f04f3 100644 --- a/vendor/github.com/google/go-github/v66/github/interactions_repos.go +++ b/vendor/github.com/google/go-github/v74/github/interactions_repos.go @@ -47,7 +47,7 @@ func (s *InteractionsService) GetRestrictionsForRepo(ctx context.Context, owner, func (s *InteractionsService) UpdateRestrictionsForRepo(ctx context.Context, owner, repo, limit string) (*InteractionRestriction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/interaction-limits", owner, repo) - interaction := &InteractionRestriction{Limit: String(limit)} + interaction := &InteractionRestriction{Limit: Ptr(limit)} req, err := s.client.NewRequest("PUT", u, interaction) if err != nil { diff --git a/vendor/github.com/google/go-github/v66/github/issue_import.go b/vendor/github.com/google/go-github/v74/github/issue_import.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/issue_import.go rename to vendor/github.com/google/go-github/v74/github/issue_import.go diff --git a/vendor/github.com/google/go-github/v66/github/issues.go b/vendor/github.com/google/go-github/v74/github/issues.go similarity index 93% rename from vendor/github.com/google/go-github/v66/github/issues.go rename to vendor/github.com/google/go-github/v74/github/issues.go index a2652b3497..2704339adc 100644 --- a/vendor/github.com/google/go-github/v66/github/issues.go +++ b/vendor/github.com/google/go-github/v74/github/issues.go @@ -55,6 +55,7 @@ type Issue struct { Assignees []*User `json:"assignees,omitempty"` NodeID *string `json:"node_id,omitempty"` Draft *bool `json:"draft,omitempty"` + Type *IssueType `json:"type,omitempty"` // TextMatches is only populated from search results that request text matches // See: search.go and https://docs.github.com/rest/search/#text-match-metadata @@ -89,6 +90,7 @@ type IssueRequest struct { StateReason *string `json:"state_reason,omitempty"` Milestone *int `json:"milestone,omitempty"` Assignees *[]string `json:"assignees,omitempty"` + Type *string `json:"type,omitempty"` } // IssueListOptions specifies the optional parameters to the IssuesService.List @@ -116,6 +118,10 @@ type IssueListOptions struct { // Since filters issues by time. Since time.Time `url:"since,omitempty"` + ListCursorOptions + + // Add ListOptions so offset pagination with integer type "page" query parameter is accepted + // since ListCursorOptions accepts "page" as string only. ListOptions } @@ -129,6 +135,18 @@ type PullRequestLinks struct { MergedAt *Timestamp `json:"merged_at,omitempty"` } +// IssueType represents the type of issue. +// For now it shows up when receiving an Issue event. +type IssueType struct { + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + Color *string `json:"color,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` +} + // List the issues for the authenticated user. If all is true, list issues // across all the user's visible repositories including owned, member, and // organization repositories; if false, list only owned and member @@ -220,6 +238,10 @@ type IssueListByRepoOptions struct { // Since filters issues by time. Since time.Time `url:"since,omitempty"` + ListCursorOptions + + // Add ListOptions so offset pagination with integer type "page" query parameter is accepted + // since ListCursorOptions accepts "page" as string only. ListOptions } diff --git a/vendor/github.com/google/go-github/v66/github/issues_assignees.go b/vendor/github.com/google/go-github/v74/github/issues_assignees.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/issues_assignees.go rename to vendor/github.com/google/go-github/v74/github/issues_assignees.go diff --git a/vendor/github.com/google/go-github/v66/github/issues_comments.go b/vendor/github.com/google/go-github/v74/github/issues_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/issues_comments.go rename to vendor/github.com/google/go-github/v74/github/issues_comments.go diff --git a/vendor/github.com/google/go-github/v66/github/issues_events.go b/vendor/github.com/google/go-github/v74/github/issues_events.go similarity index 98% rename from vendor/github.com/google/go-github/v66/github/issues_events.go rename to vendor/github.com/google/go-github/v74/github/issues_events.go index bba3b18031..8e234d7e02 100644 --- a/vendor/github.com/google/go-github/v66/github/issues_events.go +++ b/vendor/github.com/google/go-github/v74/github/issues_events.go @@ -85,7 +85,6 @@ type IssueEvent struct { Label *Label `json:"label,omitempty"` Rename *Rename `json:"rename,omitempty"` LockReason *string `json:"lock_reason,omitempty"` - ProjectCard *ProjectCard `json:"project_card,omitempty"` DismissedReview *DismissedReview `json:"dismissed_review,omitempty"` RequestedReviewer *User `json:"requested_reviewer,omitempty"` RequestedTeam *Team `json:"requested_team,omitempty"` diff --git a/vendor/github.com/google/go-github/v66/github/issues_labels.go b/vendor/github.com/google/go-github/v74/github/issues_labels.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/issues_labels.go rename to vendor/github.com/google/go-github/v74/github/issues_labels.go diff --git a/vendor/github.com/google/go-github/v66/github/issues_milestones.go b/vendor/github.com/google/go-github/v74/github/issues_milestones.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/issues_milestones.go rename to vendor/github.com/google/go-github/v74/github/issues_milestones.go diff --git a/vendor/github.com/google/go-github/v66/github/issues_timeline.go b/vendor/github.com/google/go-github/v74/github/issues_timeline.go similarity index 94% rename from vendor/github.com/google/go-github/v66/github/issues_timeline.go rename to vendor/github.com/google/go-github/v74/github/issues_timeline.go index 0aa589afe4..903f5b89c3 100644 --- a/vendor/github.com/google/go-github/v66/github/issues_timeline.go +++ b/vendor/github.com/google/go-github/v74/github/issues_timeline.go @@ -97,6 +97,14 @@ type Timeline struct { // reviewed // The pull request was reviewed. // + // review_requested + // The actor requested a review from a user or team. + // Reviewer and Requester/RequestedTeam will be populated. + // + // review_request_removed + // The actor removed a review request from a user or team. + // Reviewer and Requester/RequestedTeam will be populated. + // // subscribed // The actor subscribed to receive notifications for an issue. // @@ -134,8 +142,7 @@ type Timeline struct { Source *Source `json:"source,omitempty"` // An object containing rename details including 'from' and 'to' attributes. // Only provided for 'renamed' events. - Rename *Rename `json:"rename,omitempty"` - ProjectCard *ProjectCard `json:"project_card,omitempty"` + Rename *Rename `json:"rename,omitempty"` // The state of a submitted review. Can be one of: 'commented', // 'changes_requested' or 'approved'. // Only provided for 'reviewed' events. diff --git a/vendor/github.com/google/go-github/v66/github/licenses.go b/vendor/github.com/google/go-github/v74/github/licenses.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/licenses.go rename to vendor/github.com/google/go-github/v74/github/licenses.go diff --git a/vendor/github.com/google/go-github/v66/github/markdown.go b/vendor/github.com/google/go-github/v74/github/markdown.go similarity index 93% rename from vendor/github.com/google/go-github/v66/github/markdown.go rename to vendor/github.com/google/go-github/v74/github/markdown.go index fe3b31128d..0fd896c6c8 100644 --- a/vendor/github.com/google/go-github/v66/github/markdown.go +++ b/vendor/github.com/google/go-github/v74/github/markdown.go @@ -44,13 +44,13 @@ type markdownRenderRequest struct { // //meta:operation POST /markdown func (s *MarkdownService) Render(ctx context.Context, text string, opts *MarkdownOptions) (string, *Response, error) { - request := &markdownRenderRequest{Text: String(text)} + request := &markdownRenderRequest{Text: Ptr(text)} if opts != nil { if opts.Mode != "" { - request.Mode = String(opts.Mode) + request.Mode = Ptr(opts.Mode) } if opts.Context != "" { - request.Context = String(opts.Context) + request.Context = Ptr(opts.Context) } } diff --git a/vendor/github.com/google/go-github/v66/github/messages.go b/vendor/github.com/google/go-github/v74/github/messages.go similarity index 91% rename from vendor/github.com/google/go-github/v66/github/messages.go rename to vendor/github.com/google/go-github/v74/github/messages.go index 608c557cb0..21eb7c70c3 100644 --- a/vendor/github.com/google/go-github/v66/github/messages.go +++ b/vendor/github.com/google/go-github/v74/github/messages.go @@ -45,7 +45,7 @@ const ( var ( // eventTypeMapping maps webhooks types to their corresponding go-github struct types. - eventTypeMapping = map[string]interface{}{ + eventTypeMapping = map[string]any{ "branch_protection_configuration": &BranchProtectionConfigurationEvent{}, "branch_protection_rule": &BranchProtectionRuleEvent{}, "check_run": &CheckRunEvent{}, @@ -54,6 +54,8 @@ var ( "commit_comment": &CommitCommentEvent{}, "content_reference": &ContentReferenceEvent{}, "create": &CreateEvent{}, + "custom_property": &CustomPropertyEvent{}, + "custom_property_values": &CustomPropertyValuesEvent{}, "delete": &DeleteEvent{}, "dependabot_alert": &DependabotAlertEvent{}, "deploy_key": &DeployKeyEvent{}, @@ -84,9 +86,6 @@ var ( "page_build": &PageBuildEvent{}, "personal_access_token_request": &PersonalAccessTokenRequestEvent{}, "ping": &PingEvent{}, - "project": &ProjectEvent{}, - "project_card": &ProjectCardEvent{}, - "project_column": &ProjectColumnEvent{}, "projects_v2": &ProjectV2Event{}, "projects_v2_item": &ProjectV2ItemEvent{}, "public": &PublicEvent{}, @@ -96,6 +95,7 @@ var ( "pull_request_review_thread": &PullRequestReviewThreadEvent{}, "pull_request_target": &PullRequestTargetEvent{}, "push": &PushEvent{}, + "registry_package": &RegistryPackageEvent{}, "repository": &RepositoryEvent{}, "repository_dispatch": &RepositoryDispatchEvent{}, "repository_import": &RepositoryImportEvent{}, @@ -186,11 +186,11 @@ func messageMAC(signature string) ([]byte, func() hash.Hash, error) { // Example usage: // // func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { -// // read signature from request -// signature := "" -// payload, err := github.ValidatePayloadFromBody(r.Header.Get("Content-Type"), r.Body, signature, s.webhookSecretKey) -// if err != nil { ... } -// // Process payload... +// // read signature from request +// signature := "" +// payload, err := github.ValidatePayloadFromBody(r.Header.Get("Content-Type"), r.Body, signature, s.webhookSecretKey) +// if err != nil { ... } +// // Process payload... // } func ValidatePayloadFromBody(contentType string, readable io.Reader, signature string, secretToken []byte) (payload []byte, err error) { var body []byte // Raw body that GitHub uses to calculate the signature. @@ -249,9 +249,9 @@ func ValidatePayloadFromBody(contentType string, readable io.Reader, signature s // Example usage: // // func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { -// payload, err := github.ValidatePayload(r, s.webhookSecretKey) -// if err != nil { ... } -// // Process payload... +// payload, err := github.ValidatePayload(r, s.webhookSecretKey) +// if err != nil { ... } +// // Process payload... // } func ValidatePayload(r *http.Request, secretToken []byte) (payload []byte, err error) { signature := r.Header.Get(SHA256SignatureHeader) @@ -300,25 +300,25 @@ func DeliveryID(r *http.Request) string { // ParseWebHook parses the event payload. For recognized event types, a // value of the corresponding struct type will be returned (as returned -// by Event.ParsePayload()). An error will be returned for unrecognized event +// by [Event.ParsePayload]). An error will be returned for unrecognized event // types. // // Example usage: // // func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { -// payload, err := github.ValidatePayload(r, s.webhookSecretKey) -// if err != nil { ... } -// event, err := github.ParseWebHook(github.WebHookType(r), payload) -// if err != nil { ... } -// switch event := event.(type) { -// case *github.CommitCommentEvent: -// processCommitCommentEvent(event) -// case *github.CreateEvent: -// processCreateEvent(event) -// ... -// } +// payload, err := github.ValidatePayload(r, s.webhookSecretKey) +// if err != nil { ... } +// event, err := github.ParseWebHook(github.WebHookType(r), payload) +// if err != nil { ... } +// switch event := event.(type) { +// case *github.CommitCommentEvent: +// processCommitCommentEvent(event) +// case *github.CreateEvent: +// processCreateEvent(event) +// ... +// } // } -func ParseWebHook(messageType string, payload []byte) (interface{}, error) { +func ParseWebHook(messageType string, payload []byte) (any, error) { eventType, ok := messageToTypeName[messageType] if !ok { return nil, fmt.Errorf("unknown X-Github-Event in message: %v", messageType) @@ -344,7 +344,7 @@ func MessageTypes() []string { // EventForType returns an empty struct matching the specified GitHub event type. // If messageType does not match any known event types, it returns nil. -func EventForType(messageType string) interface{} { +func EventForType(messageType string) any { prototype := eventTypeMapping[messageType] if prototype == nil { return nil diff --git a/vendor/github.com/google/go-github/v66/github/meta.go b/vendor/github.com/google/go-github/v74/github/meta.go similarity index 97% rename from vendor/github.com/google/go-github/v66/github/meta.go rename to vendor/github.com/google/go-github/v74/github/meta.go index cc90b618b1..6923535692 100644 --- a/vendor/github.com/google/go-github/v66/github/meta.go +++ b/vendor/github.com/google/go-github/v74/github/meta.go @@ -52,6 +52,10 @@ type APIMeta struct { // GitHub Actions will originate from. Actions []string `json:"actions,omitempty"` + // An array of IP addresses in CIDR format specifying the IP addresses + // GitHub Action macOS runner will originate from. + ActionsMacos []string `json:"actions_macos,omitempty"` + // An array of IP addresses in CIDR format specifying the IP addresses // Dependabot will originate from. Dependabot []string `json:"dependabot,omitempty"` diff --git a/vendor/github.com/google/go-github/v66/github/migrations.go b/vendor/github.com/google/go-github/v74/github/migrations.go similarity index 88% rename from vendor/github.com/google/go-github/v66/github/migrations.go rename to vendor/github.com/google/go-github/v74/github/migrations.go index 5af8817050..b33be5edd2 100644 --- a/vendor/github.com/google/go-github/v66/github/migrations.go +++ b/vendor/github.com/google/go-github/v74/github/migrations.go @@ -55,6 +55,14 @@ type MigrationOptions struct { // ExcludeAttachments indicates whether attachments should be excluded from // the migration (to reduce migration archive file size). ExcludeAttachments bool + + // ExcludeReleases indicates whether releases should be excluded from + // the migration (to reduce migration archive file size). + ExcludeReleases bool + + // Exclude is a slice of related items to exclude from the response in order + // to improve performance of the request. Supported values are: "repositories" + Exclude []string } // startMigration represents the body of a StartMigration request. @@ -69,6 +77,14 @@ type startMigration struct { // ExcludeAttachments indicates whether attachments should be excluded from // the migration (to reduce migration archive file size). ExcludeAttachments *bool `json:"exclude_attachments,omitempty"` + + // ExcludeReleases indicates whether releases should be excluded from + // the migration (to reduce migration archive file size). + ExcludeReleases *bool `json:"exclude_releases,omitempty"` + + // Exclude is a slice of related items to exclude from the response in order + // to improve performance of the request. Supported values are: "repositories" + Exclude []string `json:"exclude,omitempty"` } // StartMigration starts the generation of a migration archive. @@ -82,8 +98,10 @@ func (s *MigrationService) StartMigration(ctx context.Context, org string, repos body := &startMigration{Repositories: repos} if opts != nil { - body.LockRepositories = Bool(opts.LockRepositories) - body.ExcludeAttachments = Bool(opts.ExcludeAttachments) + body.LockRepositories = Ptr(opts.LockRepositories) + body.ExcludeAttachments = Ptr(opts.ExcludeAttachments) + body.ExcludeReleases = Ptr(opts.ExcludeReleases) + body.Exclude = append(body.Exclude, opts.Exclude...) } req, err := s.client.NewRequest("POST", u, body) @@ -181,7 +199,7 @@ func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, // Disable the redirect mechanism because AWS fails if the GitHub auth token is provided. var loc string saveRedirect := s.client.client.CheckRedirect - s.client.client.CheckRedirect = func(req *http.Request, via []*http.Request) error { + s.client.client.CheckRedirect = func(req *http.Request, _ []*http.Request) error { loc = req.URL.String() return errors.New("disable redirect") } diff --git a/vendor/github.com/google/go-github/v66/github/migrations_source_import.go b/vendor/github.com/google/go-github/v74/github/migrations_source_import.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/migrations_source_import.go rename to vendor/github.com/google/go-github/v74/github/migrations_source_import.go diff --git a/vendor/github.com/google/go-github/v66/github/migrations_user.go b/vendor/github.com/google/go-github/v74/github/migrations_user.go similarity index 97% rename from vendor/github.com/google/go-github/v66/github/migrations_user.go rename to vendor/github.com/google/go-github/v74/github/migrations_user.go index 1f907cd4ec..58e780ea7b 100644 --- a/vendor/github.com/google/go-github/v66/github/migrations_user.go +++ b/vendor/github.com/google/go-github/v74/github/migrations_user.go @@ -75,8 +75,8 @@ func (s *MigrationService) StartUserMigration(ctx context.Context, repos []strin body := &startUserMigration{Repositories: repos} if opts != nil { - body.LockRepositories = Bool(opts.LockRepositories) - body.ExcludeAttachments = Bool(opts.ExcludeAttachments) + body.LockRepositories = Ptr(opts.LockRepositories) + body.ExcludeAttachments = Ptr(opts.ExcludeAttachments) } req, err := s.client.NewRequest("POST", u, body) @@ -172,7 +172,7 @@ func (s *MigrationService) UserMigrationArchiveURL(ctx context.Context, id int64 var loc string originalRedirect := s.client.client.CheckRedirect - s.client.client.CheckRedirect = func(req *http.Request, via []*http.Request) error { + s.client.client.CheckRedirect = func(req *http.Request, _ []*http.Request) error { loc = req.URL.String() return http.ErrUseLastResponse } diff --git a/vendor/github.com/google/go-github/v66/github/orgs.go b/vendor/github.com/google/go-github/v74/github/orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/orgs.go rename to vendor/github.com/google/go-github/v74/github/orgs.go diff --git a/vendor/github.com/google/go-github/v66/github/orgs_actions_allowed.go b/vendor/github.com/google/go-github/v74/github/orgs_actions_allowed.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/orgs_actions_allowed.go rename to vendor/github.com/google/go-github/v74/github/orgs_actions_allowed.go diff --git a/vendor/github.com/google/go-github/v66/github/orgs_actions_permissions.go b/vendor/github.com/google/go-github/v74/github/orgs_actions_permissions.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/orgs_actions_permissions.go rename to vendor/github.com/google/go-github/v74/github/orgs_actions_permissions.go diff --git a/vendor/github.com/google/go-github/v66/github/orgs_attestations.go b/vendor/github.com/google/go-github/v74/github/orgs_attestations.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/orgs_attestations.go rename to vendor/github.com/google/go-github/v74/github/orgs_attestations.go diff --git a/vendor/github.com/google/go-github/v66/github/orgs_audit_log.go b/vendor/github.com/google/go-github/v74/github/orgs_audit_log.go similarity index 96% rename from vendor/github.com/google/go-github/v66/github/orgs_audit_log.go rename to vendor/github.com/google/go-github/v74/github/orgs_audit_log.go index 025c5d0232..409faebbca 100644 --- a/vendor/github.com/google/go-github/v66/github/orgs_audit_log.go +++ b/vendor/github.com/google/go-github/v74/github/orgs_audit_log.go @@ -50,10 +50,10 @@ type AuditEntry struct { UserID *int64 `json:"user_id,omitempty"` // Some events types have a data field that contains additional information about the event. - Data map[string]interface{} `json:"data,omitempty"` + Data map[string]any `json:"data,omitempty"` // All fields that are not explicitly defined in the struct are captured here. - AdditionalFields map[string]interface{} `json:"-"` + AdditionalFields map[string]any `json:"-"` } func (a *AuditEntry) UnmarshalJSON(data []byte) error { @@ -67,7 +67,7 @@ func (a *AuditEntry) UnmarshalJSON(data []byte) error { if err != nil { return err } - definedFields := map[string]interface{}{} + definedFields := map[string]any{} if err := json.Unmarshal(rawDefinedFields, &definedFields); err != nil { return err } @@ -99,7 +99,7 @@ func (a *AuditEntry) MarshalJSON() ([]byte, error) { if len(a.AdditionalFields) == 0 { return defBytes, err } - resMap := map[string]interface{}{} + resMap := map[string]any{} if err := json.Unmarshal(defBytes, &resMap); err != nil { return nil, err } diff --git a/vendor/github.com/google/go-github/v66/github/orgs_codesecurity_configurations.go b/vendor/github.com/google/go-github/v74/github/orgs_codesecurity_configurations.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/orgs_codesecurity_configurations.go rename to vendor/github.com/google/go-github/v74/github/orgs_codesecurity_configurations.go diff --git a/vendor/github.com/google/go-github/v66/github/orgs_credential_authorizations.go b/vendor/github.com/google/go-github/v74/github/orgs_credential_authorizations.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/orgs_credential_authorizations.go rename to vendor/github.com/google/go-github/v74/github/orgs_credential_authorizations.go diff --git a/vendor/github.com/google/go-github/v66/github/orgs_custom_repository_roles.go b/vendor/github.com/google/go-github/v74/github/orgs_custom_repository_roles.go similarity index 85% rename from vendor/github.com/google/go-github/v66/github/orgs_custom_repository_roles.go rename to vendor/github.com/google/go-github/v74/github/orgs_custom_repository_roles.go index 2295e1b8a7..44408db141 100644 --- a/vendor/github.com/google/go-github/v66/github/orgs_custom_repository_roles.go +++ b/vendor/github.com/google/go-github/v74/github/orgs_custom_repository_roles.go @@ -61,6 +61,29 @@ func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org stri return customRepoRoles, resp, nil } +// GetCustomRepoRole gets a custom repository roles available in this organization. +// In order to see custom repository roles in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#get-a-custom-repository-role +// +//meta:operation GET /orgs/{org}/custom-repository-roles/{role_id} +func (s *OrganizationsService) GetCustomRepoRole(ctx context.Context, org string, roleID int64) (*CustomRepoRoles, *Response, error) { + u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + resultingRole := new(CustomRepoRoles) + resp, err := s.client.Do(ctx, req, resultingRole) + if err != nil { + return nil, resp, err + } + + return resultingRole, resp, nil +} + // CreateCustomRepoRole creates a custom repository role in this organization. // In order to create custom repository roles in an organization, the authenticated user must be an organization owner. // diff --git a/vendor/github.com/google/go-github/v66/github/orgs_hooks.go b/vendor/github.com/google/go-github/v74/github/orgs_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/orgs_hooks.go rename to vendor/github.com/google/go-github/v74/github/orgs_hooks.go diff --git a/vendor/github.com/google/go-github/v66/github/orgs_hooks_configuration.go b/vendor/github.com/google/go-github/v74/github/orgs_hooks_configuration.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/orgs_hooks_configuration.go rename to vendor/github.com/google/go-github/v74/github/orgs_hooks_configuration.go diff --git a/vendor/github.com/google/go-github/v66/github/orgs_hooks_deliveries.go b/vendor/github.com/google/go-github/v74/github/orgs_hooks_deliveries.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/orgs_hooks_deliveries.go rename to vendor/github.com/google/go-github/v74/github/orgs_hooks_deliveries.go diff --git a/vendor/github.com/google/go-github/v74/github/orgs_issue_types.go b/vendor/github.com/google/go-github/v74/github/orgs_issue_types.go new file mode 100644 index 0000000000..73e6f8d639 --- /dev/null +++ b/vendor/github.com/google/go-github/v74/github/orgs_issue_types.go @@ -0,0 +1,99 @@ +// Copyright 2025 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// CreateOrUpdateIssueTypesOptions represents the parameters for creating or updating an issue type. +type CreateOrUpdateIssueTypesOptions struct { + Name string `json:"name"` // Name of the issue type. (Required.) + IsEnabled bool `json:"is_enabled"` // Whether or not the issue type is enabled at the organization level. (Required.) + IsPrivate *bool `json:"is_private,omitempty"` // Whether or not the issue type is restricted to issues in private repositories. (Optional.) + Description *string `json:"description,omitempty"` // Description of the issue type. (Optional.) + Color *string `json:"color,omitempty"` // Color for the issue type. Can be one of "gray", "blue", green "orange", "red", "pink", "purple", "null". (Optional.) +} + +// ListIssueTypes lists all issue types for an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#list-issue-types-for-an-organization +// +//meta:operation GET /orgs/{org}/issue-types +func (s *OrganizationsService) ListIssueTypes(ctx context.Context, org string) ([]*IssueType, *Response, error) { + u := fmt.Sprintf("orgs/%v/issue-types", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var issueTypes []*IssueType + resp, err := s.client.Do(ctx, req, &issueTypes) + if err != nil { + return nil, resp, err + } + + return issueTypes, resp, nil +} + +// CreateIssueType creates a new issue type for an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#create-issue-type-for-an-organization +// +//meta:operation POST /orgs/{org}/issue-types +func (s *OrganizationsService) CreateIssueType(ctx context.Context, org string, opt *CreateOrUpdateIssueTypesOptions) (*IssueType, *Response, error) { + u := fmt.Sprintf("orgs/%v/issue-types", org) + req, err := s.client.NewRequest("POST", u, opt) + if err != nil { + return nil, nil, err + } + + issueType := new(IssueType) + resp, err := s.client.Do(ctx, req, issueType) + if err != nil { + return nil, resp, err + } + + return issueType, resp, nil +} + +// UpdateIssueType updates GitHub Pages for the named repo. +// +// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#update-issue-type-for-an-organization +// +//meta:operation PUT /orgs/{org}/issue-types/{issue_type_id} +func (s *OrganizationsService) UpdateIssueType(ctx context.Context, org string, issueTypeID int64, opt *CreateOrUpdateIssueTypesOptions) (*IssueType, *Response, error) { + u := fmt.Sprintf("orgs/%v/issue-types/%v", org, issueTypeID) + req, err := s.client.NewRequest("PUT", u, opt) + if err != nil { + return nil, nil, err + } + + issueType := new(IssueType) + resp, err := s.client.Do(ctx, req, issueType) + if err != nil { + return nil, resp, err + } + + return issueType, resp, nil +} + +// DeleteIssueType deletes an issue type for an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#delete-issue-type-for-an-organization +// +//meta:operation DELETE /orgs/{org}/issue-types/{issue_type_id} +func (s *OrganizationsService) DeleteIssueType(ctx context.Context, org string, issueTypeID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/issue-types/%d", org, issueTypeID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v66/github/orgs_members.go b/vendor/github.com/google/go-github/v74/github/orgs_members.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/orgs_members.go rename to vendor/github.com/google/go-github/v74/github/orgs_members.go diff --git a/vendor/github.com/google/go-github/v74/github/orgs_network_configurations.go b/vendor/github.com/google/go-github/v74/github/orgs_network_configurations.go new file mode 100644 index 0000000000..82a819c204 --- /dev/null +++ b/vendor/github.com/google/go-github/v74/github/orgs_network_configurations.go @@ -0,0 +1,236 @@ +// Copyright 2025 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "errors" + "fmt" + "regexp" +) + +// ComputeService represents a hosted compute service the network configuration supports. +type ComputeService string + +const ( + ComputeServiceNone ComputeService = "none" + ComputeServiceActions ComputeService = "actions" + ComputeServiceCodespaces ComputeService = "codespaces" +) + +// NetworkConfigurations represents a hosted compute network configuration. This type is identical +// for enterprise and organization endpoints. +type NetworkConfigurations struct { + TotalCount *int64 `json:"total_count,omitempty"` + NetworkConfigurations []*NetworkConfiguration `json:"network_configurations,omitempty"` +} + +// NetworkConfiguration represents a hosted compute network configurations. This type is identical +// for enterprise and organization endpoints. +type NetworkConfiguration struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ComputeService *ComputeService `json:"compute_service,omitempty"` + NetworkSettingsIDs []string `json:"network_settings_ids,omitempty"` + CreatedOn *Timestamp `json:"created_on"` +} + +// NetworkSettingsResource represents a hosted compute network settings resource. This type is identical +// for enterprise and organization endpoints. +type NetworkSettingsResource struct { + ID *string `json:"id,omitempty"` + NetworkConfigurationID *string `json:"network_configuration_id,omitempty"` + Name *string `json:"name,omitempty"` + SubnetID *string `json:"subnet_id,omitempty"` + Region *string `json:"region,omitempty"` +} + +func validateComputeService(compute *ComputeService) error { + if compute == nil { + return nil + } + if *compute != ComputeServiceNone && *compute != ComputeServiceActions { + return errors.New("compute service can only be one of: none, actions") + } + return nil +} + +var validNetworkNameRE = regexp.MustCompile(`^[a-zA-Z0-9._-]+$`) + +func validateNetworkName(name string) error { + if len(name) < 1 || len(name) > 100 { + return errors.New("must be between 1 and 100 characters") + } + if !validNetworkNameRE.MatchString(name) { + return errors.New("may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'") + } + return nil +} + +func validateNetworkSettingsID(settingsID []string) error { + if len(settingsID) != 1 { + return errors.New("exactly one network settings id must be specified") + } + return nil +} + +func validateNetworkConfigurationRequest(req NetworkConfigurationRequest) error { + networkName := req.GetName() + if err := validateNetworkName(networkName); err != nil { + return err + } + + computeService := req.GetComputeService() + if err := validateComputeService(computeService); err != nil { + return err + } + + networkIDs := req.NetworkSettingsIDs + if err := validateNetworkSettingsID(networkIDs); err != nil { + return err + } + return nil +} + +// NetworkConfigurationRequest represents a request to create or update a network configuration for an organization. +type NetworkConfigurationRequest struct { + Name *string `json:"name,omitempty"` + ComputeService *ComputeService `json:"compute_service,omitempty"` + NetworkSettingsIDs []string `json:"network_settings_ids,omitempty"` +} + +// ListNetworkConfigurations lists all hosted compute network configurations configured in an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#list-hosted-compute-network-configurations-for-an-organization +// +//meta:operation GET /orgs/{org}/settings/network-configurations +func (s *OrganizationsService) ListNetworkConfigurations(ctx context.Context, org string, opts *ListOptions) (*NetworkConfigurations, *Response, error) { + u := fmt.Sprintf("orgs/%v/settings/network-configurations", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + configurations := &NetworkConfigurations{} + resp, err := s.client.Do(ctx, req, configurations) + if err != nil { + return nil, resp, err + } + return configurations, resp, nil +} + +// CreateNetworkConfiguration creates a hosted compute network configuration for an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#create-a-hosted-compute-network-configuration-for-an-organization +// +//meta:operation POST /orgs/{org}/settings/network-configurations +func (s *OrganizationsService) CreateNetworkConfiguration(ctx context.Context, org string, createReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) { + if err := validateNetworkConfigurationRequest(createReq); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("orgs/%v/settings/network-configurations", org) + req, err := s.client.NewRequest("POST", u, createReq) + if err != nil { + return nil, nil, err + } + + configuration := &NetworkConfiguration{} + resp, err := s.client.Do(ctx, req, configuration) + if err != nil { + return nil, resp, err + } + return configuration, resp, nil +} + +// GetNetworkConfiguration gets a hosted compute network configuration configured in an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#get-a-hosted-compute-network-configuration-for-an-organization +// +//meta:operation GET /orgs/{org}/settings/network-configurations/{network_configuration_id} +func (s *OrganizationsService) GetNetworkConfiguration(ctx context.Context, org, networkID string) (*NetworkConfiguration, *Response, error) { + u := fmt.Sprintf("orgs/%v/settings/network-configurations/%v", org, networkID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + configuration := &NetworkConfiguration{} + resp, err := s.client.Do(ctx, req, configuration) + if err != nil { + return nil, resp, err + } + return configuration, resp, nil +} + +// UpdateNetworkConfiguration updates a hosted compute network configuration for an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#update-a-hosted-compute-network-configuration-for-an-organization +// +//meta:operation PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id} +func (s *OrganizationsService) UpdateNetworkConfiguration(ctx context.Context, org, networkID string, updateReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) { + if err := validateNetworkConfigurationRequest(updateReq); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("orgs/%v/settings/network-configurations/%v", org, networkID) + req, err := s.client.NewRequest("PATCH", u, updateReq) + if err != nil { + return nil, nil, err + } + + configuration := &NetworkConfiguration{} + resp, err := s.client.Do(ctx, req, configuration) + if err != nil { + return nil, resp, err + } + return configuration, resp, nil +} + +// DeleteNetworkConfigurations deletes a hosted compute network configuration from an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#delete-a-hosted-compute-network-configuration-from-an-organization +// +//meta:operation DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id} +func (s *OrganizationsService) DeleteNetworkConfigurations(ctx context.Context, org, networkID string) (*Response, error) { + u := fmt.Sprintf("orgs/%v/settings/network-configurations/%v", org, networkID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + configuration := &NetworkConfiguration{} + resp, err := s.client.Do(ctx, req, configuration) + if err != nil { + return resp, err + } + return resp, nil +} + +// GetNetworkConfigurationResource gets a hosted compute network settings resource configured for an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#get-a-hosted-compute-network-settings-resource-for-an-organization +// +//meta:operation GET /orgs/{org}/settings/network-settings/{network_settings_id} +func (s *OrganizationsService) GetNetworkConfigurationResource(ctx context.Context, org, networkID string) (*NetworkSettingsResource, *Response, error) { + u := fmt.Sprintf("orgs/%v/settings/network-settings/%v", org, networkID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + resource := &NetworkSettingsResource{} + resp, err := s.client.Do(ctx, req, resource) + if err != nil { + return nil, resp, err + } + return resource, resp, nil +} diff --git a/vendor/github.com/google/go-github/v66/github/orgs_organization_roles.go b/vendor/github.com/google/go-github/v74/github/orgs_organization_roles.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/orgs_organization_roles.go rename to vendor/github.com/google/go-github/v74/github/orgs_organization_roles.go diff --git a/vendor/github.com/google/go-github/v66/github/orgs_outside_collaborators.go b/vendor/github.com/google/go-github/v74/github/orgs_outside_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/orgs_outside_collaborators.go rename to vendor/github.com/google/go-github/v74/github/orgs_outside_collaborators.go diff --git a/vendor/github.com/google/go-github/v66/github/orgs_packages.go b/vendor/github.com/google/go-github/v74/github/orgs_packages.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/orgs_packages.go rename to vendor/github.com/google/go-github/v74/github/orgs_packages.go diff --git a/vendor/github.com/google/go-github/v66/github/orgs_personal_access_tokens.go b/vendor/github.com/google/go-github/v74/github/orgs_personal_access_tokens.go similarity index 98% rename from vendor/github.com/google/go-github/v66/github/orgs_personal_access_tokens.go rename to vendor/github.com/google/go-github/v74/github/orgs_personal_access_tokens.go index af083744e8..276fbbb494 100644 --- a/vendor/github.com/google/go-github/v66/github/orgs_personal_access_tokens.go +++ b/vendor/github.com/google/go-github/v74/github/orgs_personal_access_tokens.go @@ -44,6 +44,12 @@ type PersonalAccessToken struct { // Date and time when the associated fine-grained personal access token expires. TokenExpiresAt *Timestamp `json:"token_expires_at"` + // TokenID + TokenID *int64 `json:"token_id"` + + // TokenName + TokenName *string `json:"token_name"` + // Date and time when the associated fine-grained personal access token was last used for authentication. TokenLastUsedAt *Timestamp `json:"token_last_used_at"` } diff --git a/vendor/github.com/google/go-github/v66/github/orgs_properties.go b/vendor/github.com/google/go-github/v74/github/orgs_properties.go similarity index 91% rename from vendor/github.com/google/go-github/v66/github/orgs_properties.go rename to vendor/github.com/google/go-github/v74/github/orgs_properties.go index d8db48fc94..257e765993 100644 --- a/vendor/github.com/google/go-github/v66/github/orgs_properties.go +++ b/vendor/github.com/google/go-github/v74/github/orgs_properties.go @@ -17,7 +17,9 @@ type CustomProperty struct { // PropertyName is required for most endpoints except when calling CreateOrUpdateCustomProperty; // where this is sent in the path and thus can be omitted. PropertyName *string `json:"property_name,omitempty"` - // The type of the value for the property. Can be one of: string, single_select. + // SourceType is the source type of the property where it has been created. Can be one of: organization, enterprise. + SourceType *string `json:"source_type,omitempty"` + // The type of the value for the property. Can be one of: string, single_select, multi_select, true_false. ValueType string `json:"value_type"` // Whether the property is required. Required *bool `json:"required,omitempty"` @@ -42,8 +44,15 @@ type RepoCustomPropertyValue struct { // CustomPropertyValue represents a custom property value. type CustomPropertyValue struct { - PropertyName string `json:"property_name"` - Value interface{} `json:"value"` + PropertyName string `json:"property_name"` + Value any `json:"value"` +} + +// ListCustomPropertyValuesOptions specifies the optional parameters to the +// OrganizationsService.ListCustomPropertyValues method. +type ListCustomPropertyValuesOptions struct { + RepositoryQuery string `url:"repository_query,omitempty"` + ListOptions } // UnmarshalJSON implements the json.Unmarshaler interface. @@ -64,14 +73,14 @@ func (cpv *CustomPropertyValue) UnmarshalJSON(data []byte) error { cpv.Value = nil case string: cpv.Value = v - case []interface{}: + case []any: strSlice := make([]string, len(v)) for i, item := range v { - if str, ok := item.(string); ok { - strSlice[i] = str - } else { + str, ok := item.(string) + if !ok { return errors.New("non-string value in string array") } + strSlice[i] = str } cpv.Value = strSlice default: @@ -195,7 +204,7 @@ func (s *OrganizationsService) RemoveCustomProperty(ctx context.Context, org, cu // GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#list-custom-property-values-for-organization-repositories // //meta:operation GET /orgs/{org}/properties/values -func (s *OrganizationsService) ListCustomPropertyValues(ctx context.Context, org string, opts *ListOptions) ([]*RepoCustomPropertyValue, *Response, error) { +func (s *OrganizationsService) ListCustomPropertyValues(ctx context.Context, org string, opts *ListCustomPropertyValuesOptions) ([]*RepoCustomPropertyValue, *Response, error) { u := fmt.Sprintf("orgs/%v/properties/values", org) u, err := addOptions(u, opts) if err != nil { diff --git a/vendor/github.com/google/go-github/v74/github/orgs_rules.go b/vendor/github.com/google/go-github/v74/github/orgs_rules.go new file mode 100644 index 0000000000..357eb8ce7c --- /dev/null +++ b/vendor/github.com/google/go-github/v74/github/orgs_rules.go @@ -0,0 +1,145 @@ +// Copyright 2023 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// GetAllRepositoryRulesets gets all the repository rulesets for the specified organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets +// +//meta:operation GET /orgs/{org}/rulesets +func (s *OrganizationsService) GetAllRepositoryRulesets(ctx context.Context, org string, opts *ListOptions) ([]*RepositoryRuleset, *Response, error) { + u := fmt.Sprintf("orgs/%v/rulesets", org) + + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var rulesets []*RepositoryRuleset + resp, err := s.client.Do(ctx, req, &rulesets) + if err != nil { + return nil, resp, err + } + + return rulesets, resp, nil +} + +// CreateRepositoryRuleset creates a repository ruleset for the specified organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset +// +//meta:operation POST /orgs/{org}/rulesets +func (s *OrganizationsService) CreateRepositoryRuleset(ctx context.Context, org string, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { + u := fmt.Sprintf("orgs/%v/rulesets", org) + + req, err := s.client.NewRequest("POST", u, ruleset) + if err != nil { + return nil, nil, err + } + + var rs *RepositoryRuleset + resp, err := s.client.Do(ctx, req, &rs) + if err != nil { + return nil, resp, err + } + + return rs, resp, nil +} + +// GetRepositoryRuleset gets a repository ruleset for the specified organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset +// +//meta:operation GET /orgs/{org}/rulesets/{ruleset_id} +func (s *OrganizationsService) GetRepositoryRuleset(ctx context.Context, org string, rulesetID int64) (*RepositoryRuleset, *Response, error) { + u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var ruleset *RepositoryRuleset + resp, err := s.client.Do(ctx, req, &ruleset) + if err != nil { + return nil, resp, err + } + + return ruleset, resp, nil +} + +// UpdateRepositoryRuleset updates a repository ruleset for the specified organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset +// +//meta:operation PUT /orgs/{org}/rulesets/{ruleset_id} +func (s *OrganizationsService) UpdateRepositoryRuleset(ctx context.Context, org string, rulesetID int64, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { + u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) + + req, err := s.client.NewRequest("PUT", u, ruleset) + if err != nil { + return nil, nil, err + } + + var rs *RepositoryRuleset + resp, err := s.client.Do(ctx, req, &rs) + if err != nil { + return nil, resp, err + } + + return rs, resp, nil +} + +// UpdateRepositoryRulesetClearBypassActor clears the bypass actors for a repository ruleset for the specified organization. +// +// This function is necessary as the UpdateRepositoryRuleset function does not marshal ByPassActor if passed as an empty array. +// +// GitHub API docs: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset +// +//meta:operation PUT /orgs/{org}/rulesets/{ruleset_id} +func (s *OrganizationsService) UpdateRepositoryRulesetClearBypassActor(ctx context.Context, org string, rulesetID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) + + rsClearBypassActor := rulesetClearBypassActors{} + + req, err := s.client.NewRequest("PUT", u, rsClearBypassActor) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// DeleteRepositoryRuleset deletes a repository ruleset from the specified organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset +// +//meta:operation DELETE /orgs/{org}/rulesets/{ruleset_id} +func (s *OrganizationsService) DeleteRepositoryRuleset(ctx context.Context, org string, rulesetID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/rulesets/%v", org, rulesetID) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v66/github/orgs_security_managers.go b/vendor/github.com/google/go-github/v74/github/orgs_security_managers.go similarity index 88% rename from vendor/github.com/google/go-github/v66/github/orgs_security_managers.go rename to vendor/github.com/google/go-github/v74/github/orgs_security_managers.go index 0803772732..b8562a2fd7 100644 --- a/vendor/github.com/google/go-github/v66/github/orgs_security_managers.go +++ b/vendor/github.com/google/go-github/v74/github/orgs_security_managers.go @@ -12,6 +12,8 @@ import ( // ListSecurityManagerTeams lists all security manager teams for an organization. // +// Deprecated: Please use `client.Organizations.ListTeamsAssignedToOrgRole` instead. +// // GitHub API docs: https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams // //meta:operation GET /orgs/{org}/security-managers @@ -34,6 +36,8 @@ func (s *OrganizationsService) ListSecurityManagerTeams(ctx context.Context, org // AddSecurityManagerTeam adds a team to the list of security managers for an organization. // +// Deprecated: Please use `client.Organizations.AssignOrgRoleToTeam` instead. +// // GitHub API docs: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team // //meta:operation PUT /orgs/{org}/security-managers/teams/{team_slug} @@ -49,6 +53,8 @@ func (s *OrganizationsService) AddSecurityManagerTeam(ctx context.Context, org, // RemoveSecurityManagerTeam removes a team from the list of security managers for an organization. // +// Deprecated: Please use `client.Organizations.RemoveOrgRoleFromTeam` instead. +// // GitHub API docs: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team // //meta:operation DELETE /orgs/{org}/security-managers/teams/{team_slug} diff --git a/vendor/github.com/google/go-github/v66/github/orgs_users_blocking.go b/vendor/github.com/google/go-github/v74/github/orgs_users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/orgs_users_blocking.go rename to vendor/github.com/google/go-github/v74/github/orgs_users_blocking.go diff --git a/vendor/github.com/google/go-github/v74/github/packages.go b/vendor/github.com/google/go-github/v74/github/packages.go new file mode 100644 index 0000000000..cc04a044d7 --- /dev/null +++ b/vendor/github.com/google/go-github/v74/github/packages.go @@ -0,0 +1,319 @@ +// Copyright 2020 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "encoding/json" +) + +// Package represents a GitHub package. +type Package struct { + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + PackageType *string `json:"package_type,omitempty"` // One of "npm", "maven", "rubygems", "docker", "nuget", "container". For webhook events "container" is "CONTAINER" + HTMLURL *string `json:"html_url,omitempty"` + Visibility *string `json:"visibility,omitempty"` + Owner *User `json:"owner,omitempty"` + Repository *Repository `json:"repository,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + + // The following are only populated for webhook events + Namespace *string `json:"namespace,omitempty"` + Description *string `json:"description,omitempty"` + Ecosystem *string `json:"ecosystem,omitempty"` + PackageVersion *PackageVersion `json:"package_version,omitempty"` + Registry *PackageRegistry `json:"registry,omitempty"` + + // The following are NOT populated for webhook events + URL *string `json:"url,omitempty"` + VersionCount *int64 `json:"version_count,omitempty"` +} + +func (p Package) String() string { + return Stringify(p) +} + +// PackageVersion represents a GitHub package version. +type PackageVersion struct { + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + URL *string `json:"url,omitempty"` + PackageHTMLURL *string `json:"package_html_url,omitempty"` + License *string `json:"license,omitempty"` + Description *string `json:"description,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + Metadata json.RawMessage `json:"metadata,omitempty"` // For webhook events this will be []interface, else it will be of type PackageMetadata + + // The following are only populated for webhook events + Version *string `json:"version,omitempty"` + Summary *string `json:"summary,omitempty"` + Body json.RawMessage `json:"body,omitempty"` // Can either be a string or of type PackageVersionBody + BodyHTML *string `json:"body_html,omitempty"` + Release *PackageRelease `json:"release,omitempty"` + Manifest *string `json:"manifest,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + TagName *string `json:"tag_name,omitempty"` + TargetCommitish *string `json:"target_commitish,omitempty"` + TargetOID *string `json:"target_oid,omitempty"` + Draft *bool `json:"draft,omitempty"` + Prerelease *bool `json:"prerelease,omitempty"` + ContainerMetadata *PackageEventContainerMetadata `json:"container_metadata,omitempty"` + DockerMetadata []any `json:"docker_metadata,omitempty"` + NPMMetadata *PackageNPMMetadata `json:"npm_metadata,omitempty"` + NugetMetadata []*PackageNugetMetadata `json:"nuget_metadata,omitempty"` + RubyMetadata map[string]any `json:"ruby_metadata,omitempty"` + PackageFiles []*PackageFile `json:"package_files,omitempty"` + PackageURL *string `json:"package_url,omitempty"` + Author *User `json:"author,omitempty"` + SourceURL *string `json:"source_url,omitempty"` + InstallationCommand *string `json:"installation_command,omitempty"` + + // The following are NOT populated for webhook events + DeletedAt *Timestamp `json:"deleted_at,omitempty"` +} + +// GetBody returns the body field as a string if it's valid. +func (pv *PackageVersion) GetBody() (body string, ok bool) { + if pv == nil || pv.Body == nil { + return "", false + } + + if err := json.Unmarshal(pv.Body, &body); err != nil { + return "", false + } + + return body, true +} + +// GetBodyAsPackageVersionBody returns the body field as a PackageVersionBody if it's valid. +func (pv *PackageVersion) GetBodyAsPackageVersionBody() (body *PackageVersionBody, ok bool) { + if pv == nil || pv.Body == nil { + return nil, false + } + + if err := json.Unmarshal(pv.Body, &body); err != nil { + return nil, false + } + + return body, true +} + +// GetMetadata returns the metadata field as PackageMetadata if it's valid. +func (pv *PackageVersion) GetMetadata() (metadata *PackageMetadata, ok bool) { + if pv == nil || pv.Metadata == nil { + return nil, false + } + + if err := json.Unmarshal(pv.Metadata, &metadata); err != nil { + return nil, false + } + + return metadata, true +} + +// GetRawMetadata returns the metadata field as a json.RawMessage. +func (pv *PackageVersion) GetRawMetadata() json.RawMessage { + if pv == nil || pv.Metadata == nil { + return json.RawMessage{} + } + + return pv.Metadata +} + +func (pv PackageVersion) String() string { + return Stringify(pv) +} + +// PackageRelease represents a GitHub package version release. +type PackageRelease struct { + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + ID *int64 `json:"id,omitempty"` + TagName *string `json:"tag_name,omitempty"` + TargetCommitish *string `json:"target_commitish,omitempty"` + Name *string `json:"name,omitempty"` + Draft *bool `json:"draft,omitempty"` + Author *User `json:"author,omitempty"` + Prerelease *bool `json:"prerelease,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + PublishedAt *Timestamp `json:"published_at,omitempty"` +} + +func (r PackageRelease) String() string { + return Stringify(r) +} + +// PackageFile represents a GitHub package version release file. +type PackageFile struct { + DownloadURL *string `json:"download_url,omitempty"` + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SHA256 *string `json:"sha256,omitempty"` + SHA1 *string `json:"sha1,omitempty"` + MD5 *string `json:"md5,omitempty"` + ContentType *string `json:"content_type,omitempty"` + State *string `json:"state,omitempty"` + Author *User `json:"author,omitempty"` + Size *int64 `json:"size,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` +} + +func (pf PackageFile) String() string { + return Stringify(pf) +} + +// PackageRegistry represents a GitHub package registry. +type PackageRegistry struct { + AboutURL *string `json:"about_url,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + URL *string `json:"url,omitempty"` + Vendor *string `json:"vendor,omitempty"` +} + +func (r PackageRegistry) String() string { + return Stringify(r) +} + +// PackageListOptions represents the optional list options for a package. +type PackageListOptions struct { + // Visibility of packages "public", "internal" or "private". + Visibility *string `url:"visibility,omitempty"` + + // PackageType represents the type of package. + // It can be one of "npm", "maven", "rubygems", "nuget", "docker", or "container". + PackageType *string `url:"package_type,omitempty"` + + // State of package either "active" or "deleted". + State *string `url:"state,omitempty"` + + ListOptions +} + +// PackageMetadata represents metadata from a package. +type PackageMetadata struct { + PackageType *string `json:"package_type,omitempty"` + Container *PackageContainerMetadata `json:"container,omitempty"` +} + +func (r PackageMetadata) String() string { + return Stringify(r) +} + +// PackageContainerMetadata represents container metadata for docker container packages. +type PackageContainerMetadata struct { + Tags []string `json:"tags,omitempty"` +} + +func (r PackageContainerMetadata) String() string { + return Stringify(r) +} + +// PackageVersionBody represents the body field of a package version. +type PackageVersionBody struct { + Repo *Repository `json:"repository,omitempty"` + Info *PackageVersionBodyInfo `json:"info,omitempty"` +} + +func (b PackageVersionBody) String() string { + return Stringify(b) +} + +// PackageVersionBodyInfo represents the info field of a PackageVersionBody. +type PackageVersionBodyInfo struct { + Type *string `json:"type,omitempty"` + OID *string `json:"oid,omitempty"` + Mode *int64 `json:"mode,omitempty"` + Name *string `json:"name,omitempty"` + Path *string `json:"path,omitempty"` + Size *int64 `json:"size,omitempty"` + Collection *bool `json:"collection,omitempty"` +} + +func (bi PackageVersionBodyInfo) String() string { + return Stringify(bi) +} + +// PackageEventContainerMetadata represents metadata for container packages as part of a webhook event. +// See also PackageContainerMetadata. +type PackageEventContainerMetadata struct { + Labels map[string]any `json:"labels,omitempty"` + Manifest map[string]any `json:"manifest,omitempty"` + Tag *PackageEventContainerMetadataTag `json:"tag,omitempty"` +} + +func (m PackageEventContainerMetadata) String() string { + return Stringify(m) +} + +// PackageEventContainerMetadataTag represents a tag of a GitHub container package. +type PackageEventContainerMetadataTag struct { + Name *string `json:"name,omitempty"` + Digest *string `json:"digest,omitempty"` +} + +func (mt PackageEventContainerMetadataTag) String() string { + return Stringify(mt) +} + +// PackageNugetMetadata represents nuget metadata for a GitHub package. +type PackageNugetMetadata struct { + ID json.RawMessage `json:"id,omitempty"` // Can either be a int64 or string + Name *string `json:"name,omitempty"` + Value json.RawMessage `json:"value,omitempty"` // Can either be a bool, string, integer or object +} + +func (nm PackageNugetMetadata) String() string { + return Stringify(nm) +} + +// PackageNPMMetadata represents NPM metadata for a GitHub package. +type PackageNPMMetadata struct { + Name *string `json:"name,omitempty"` + Version *string `json:"version,omitempty"` + NPMUser *string `json:"npm_user,omitempty"` + Author map[string]string `json:"author,omitempty"` + Bugs map[string]string `json:"bugs,omitempty"` + Dependencies map[string]string `json:"dependencies,omitempty"` + DevDependencies map[string]string `json:"dev_dependencies,omitempty"` + PeerDependencies map[string]string `json:"peer_dependencies,omitempty"` + OptionalDependencies map[string]string `json:"optional_dependencies,omitempty"` + Description *string `json:"description,omitempty"` + Dist map[string]string `json:"dist,omitempty"` + GitHead *string `json:"git_head,omitempty"` + Homepage *string `json:"homepage,omitempty"` + License *string `json:"license,omitempty"` + Main *string `json:"main,omitempty"` + Repository map[string]string `json:"repository,omitempty"` + Scripts map[string]any `json:"scripts,omitempty"` + ID *string `json:"id,omitempty"` + NodeVersion *string `json:"node_version,omitempty"` + NPMVersion *string `json:"npm_version,omitempty"` + HasShrinkwrap *bool `json:"has_shrinkwrap,omitempty"` + Maintainers []any `json:"maintainers,omitempty"` + Contributors []any `json:"contributors,omitempty"` + Engines map[string]string `json:"engines,omitempty"` + Keywords []string `json:"keywords,omitempty"` + Files []string `json:"files,omitempty"` + Bin map[string]any `json:"bin,omitempty"` + Man map[string]any `json:"man,omitempty"` + Directories map[string]string `json:"directories,omitempty"` + OS []string `json:"os,omitempty"` + CPU []string `json:"cpu,omitempty"` + Readme *string `json:"readme,omitempty"` + InstallationCommand *string `json:"installation_command,omitempty"` + ReleaseID *int64 `json:"release_id,omitempty"` + CommitOID *string `json:"commit_oid,omitempty"` + PublishedViaActions *bool `json:"published_via_actions,omitempty"` + DeletedByID *int64 `json:"deleted_by_id,omitempty"` +} + +func (nm PackageNPMMetadata) String() string { + return Stringify(nm) +} diff --git a/vendor/github.com/google/go-github/v66/github/pulls.go b/vendor/github.com/google/go-github/v74/github/pulls.go similarity index 83% rename from vendor/github.com/google/go-github/v66/github/pulls.go rename to vendor/github.com/google/go-github/v74/github/pulls.go index 35ceda4467..f3c6e929c1 100644 --- a/vendor/github.com/google/go-github/v66/github/pulls.go +++ b/vendor/github.com/google/go-github/v74/github/pulls.go @@ -28,49 +28,51 @@ type PullRequestAutoMerge struct { // PullRequest represents a GitHub pull request on a repository. type PullRequest struct { - ID *int64 `json:"id,omitempty"` - Number *int `json:"number,omitempty"` - State *string `json:"state,omitempty"` - Locked *bool `json:"locked,omitempty"` - Title *string `json:"title,omitempty"` - Body *string `json:"body,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - ClosedAt *Timestamp `json:"closed_at,omitempty"` - MergedAt *Timestamp `json:"merged_at,omitempty"` - Labels []*Label `json:"labels,omitempty"` - User *User `json:"user,omitempty"` - Draft *bool `json:"draft,omitempty"` - Merged *bool `json:"merged,omitempty"` - Mergeable *bool `json:"mergeable,omitempty"` - MergeableState *string `json:"mergeable_state,omitempty"` - MergedBy *User `json:"merged_by,omitempty"` - MergeCommitSHA *string `json:"merge_commit_sha,omitempty"` - Rebaseable *bool `json:"rebaseable,omitempty"` - Comments *int `json:"comments,omitempty"` - Commits *int `json:"commits,omitempty"` - Additions *int `json:"additions,omitempty"` - Deletions *int `json:"deletions,omitempty"` - ChangedFiles *int `json:"changed_files,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - IssueURL *string `json:"issue_url,omitempty"` - StatusesURL *string `json:"statuses_url,omitempty"` - DiffURL *string `json:"diff_url,omitempty"` - PatchURL *string `json:"patch_url,omitempty"` - CommitsURL *string `json:"commits_url,omitempty"` - CommentsURL *string `json:"comments_url,omitempty"` - ReviewCommentsURL *string `json:"review_comments_url,omitempty"` - ReviewCommentURL *string `json:"review_comment_url,omitempty"` - ReviewComments *int `json:"review_comments,omitempty"` - Assignee *User `json:"assignee,omitempty"` - Assignees []*User `json:"assignees,omitempty"` - Milestone *Milestone `json:"milestone,omitempty"` - MaintainerCanModify *bool `json:"maintainer_can_modify,omitempty"` - AuthorAssociation *string `json:"author_association,omitempty"` - NodeID *string `json:"node_id,omitempty"` - RequestedReviewers []*User `json:"requested_reviewers,omitempty"` - AutoMerge *PullRequestAutoMerge `json:"auto_merge,omitempty"` + ID *int64 `json:"id,omitempty"` + Number *int `json:"number,omitempty"` + State *string `json:"state,omitempty"` + Locked *bool `json:"locked,omitempty"` + Title *string `json:"title,omitempty"` + Body *string `json:"body,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + ClosedAt *Timestamp `json:"closed_at,omitempty"` + MergedAt *Timestamp `json:"merged_at,omitempty"` + Labels []*Label `json:"labels,omitempty"` + User *User `json:"user,omitempty"` + Draft *bool `json:"draft,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + IssueURL *string `json:"issue_url,omitempty"` + StatusesURL *string `json:"statuses_url,omitempty"` + DiffURL *string `json:"diff_url,omitempty"` + PatchURL *string `json:"patch_url,omitempty"` + CommitsURL *string `json:"commits_url,omitempty"` + CommentsURL *string `json:"comments_url,omitempty"` + ReviewCommentsURL *string `json:"review_comments_url,omitempty"` + ReviewCommentURL *string `json:"review_comment_url,omitempty"` + Assignee *User `json:"assignee,omitempty"` + Assignees []*User `json:"assignees,omitempty"` + Milestone *Milestone `json:"milestone,omitempty"` + AuthorAssociation *string `json:"author_association,omitempty"` + NodeID *string `json:"node_id,omitempty"` + RequestedReviewers []*User `json:"requested_reviewers,omitempty"` + AutoMerge *PullRequestAutoMerge `json:"auto_merge,omitempty"` + + // These fields are not populated by the List operation. + Merged *bool `json:"merged,omitempty"` + Mergeable *bool `json:"mergeable,omitempty"` + MergeableState *string `json:"mergeable_state,omitempty"` + Rebaseable *bool `json:"rebaseable,omitempty"` + MergedBy *User `json:"merged_by,omitempty"` + MergeCommitSHA *string `json:"merge_commit_sha,omitempty"` + Comments *int `json:"comments,omitempty"` + Commits *int `json:"commits,omitempty"` + Additions *int `json:"additions,omitempty"` + Deletions *int `json:"deletions,omitempty"` + ChangedFiles *int `json:"changed_files,omitempty"` + MaintainerCanModify *bool `json:"maintainer_can_modify,omitempty"` + ReviewComments *int `json:"review_comments,omitempty"` // RequestedTeams is populated as part of the PullRequestEvent. // See, https://docs.github.com/developers/webhooks-and-events/github-event-types#pullrequestevent for an example. @@ -167,10 +169,12 @@ func (s *PullRequestsService) List(ctx context.Context, owner string, repo strin return pulls, resp, nil } -// ListPullRequestsWithCommit returns pull requests associated with a commit SHA. +// ListPullRequestsWithCommit returns pull requests associated with a commit SHA +// or branch name. // -// The results may include open and closed pull requests. -// By default, the PullRequestListOptions State filters for "open". +// The results may include open and closed pull requests. If the commit SHA is +// not present in the repository's default branch, the result will only include +// open pull requests. // // GitHub API docs: https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit // diff --git a/vendor/github.com/google/go-github/v66/github/pulls_comments.go b/vendor/github.com/google/go-github/v74/github/pulls_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/pulls_comments.go rename to vendor/github.com/google/go-github/v74/github/pulls_comments.go diff --git a/vendor/github.com/google/go-github/v66/github/pulls_reviewers.go b/vendor/github.com/google/go-github/v74/github/pulls_reviewers.go similarity index 95% rename from vendor/github.com/google/go-github/v66/github/pulls_reviewers.go rename to vendor/github.com/google/go-github/v74/github/pulls_reviewers.go index 9dd60ae688..526047937e 100644 --- a/vendor/github.com/google/go-github/v66/github/pulls_reviewers.go +++ b/vendor/github.com/google/go-github/v74/github/pulls_reviewers.go @@ -85,11 +85,8 @@ func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo str func (s *PullRequestsService) RemoveReviewers(ctx context.Context, owner, repo string, number int, reviewers ReviewersRequest) (*Response, error) { // reviewers.Reviewers may be empty if the caller wants to remove teams, but not users. Unlike AddReviewers, // "reviewers" is a required param here. Reference: https://github.com/google/go-github/issues/3336 - removeRequest := removeReviewersRequest{ - NodeID: reviewers.NodeID, - Reviewers: reviewers.Reviewers, - TeamReviewers: reviewers.TeamReviewers, - } + // The type `removeReviewersRequest` is required because the struct tags are different from `ReviewersRequest`. + removeRequest := removeReviewersRequest(reviewers) if removeRequest.Reviewers == nil { // GitHub accepts the empty list, but rejects null. Removing `omitempty` is not enough - we also have to promote nil to []. diff --git a/vendor/github.com/google/go-github/v66/github/pulls_reviews.go b/vendor/github.com/google/go-github/v74/github/pulls_reviews.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/pulls_reviews.go rename to vendor/github.com/google/go-github/v74/github/pulls_reviews.go diff --git a/vendor/github.com/google/go-github/v66/github/pulls_threads.go b/vendor/github.com/google/go-github/v74/github/pulls_threads.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/pulls_threads.go rename to vendor/github.com/google/go-github/v74/github/pulls_threads.go diff --git a/vendor/github.com/google/go-github/v66/github/rate_limit.go b/vendor/github.com/google/go-github/v74/github/rate_limit.go similarity index 85% rename from vendor/github.com/google/go-github/v66/github/rate_limit.go rename to vendor/github.com/google/go-github/v74/github/rate_limit.go index 5b01b573d8..6236eba8fb 100644 --- a/vendor/github.com/google/go-github/v66/github/rate_limit.go +++ b/vendor/github.com/google/go-github/v74/github/rate_limit.go @@ -12,14 +12,22 @@ type RateLimitService service // Rate represents the rate limit for the current client. type Rate struct { - // The number of requests per hour the client is currently limited to. + // The maximum number of requests that you can make per hour. Limit int `json:"limit"` - // The number of remaining requests the client can make this hour. + // The number of requests remaining in the current rate limit window. Remaining int `json:"remaining"` - // The time at which the current rate limit will reset. + // The number of requests you have made in the current rate limit window. + Used int `json:"used"` + + // The time at which the current rate limit window resets, in UTC epoch seconds. Reset Timestamp `json:"reset"` + + // The rate limit resource that the request counted against. + // For more information about the different resources, see REST API endpoints for rate limits. + // GitHub API docs: https://docs.github.com/en/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user + Resource string `json:"resource,omitempty"` } func (r Rate) String() string { @@ -77,7 +85,7 @@ func (s *RateLimitService) Get(ctx context.Context) (*RateLimits, *Response, err }) // This resource is not subject to rate limits. - ctx = context.WithValue(ctx, bypassRateLimitCheck, true) + ctx = context.WithValue(ctx, BypassRateLimitCheck, true) resp, err := s.client.Do(ctx, req, response) if err != nil { return nil, resp, err diff --git a/vendor/github.com/google/go-github/v66/github/reactions.go b/vendor/github.com/google/go-github/v74/github/reactions.go similarity index 87% rename from vendor/github.com/google/go-github/v66/github/reactions.go rename to vendor/github.com/google/go-github/v74/github/reactions.go index 1aa7ac38f2..5233f78d3d 100644 --- a/vendor/github.com/google/go-github/v66/github/reactions.go +++ b/vendor/github.com/google/go-github/v74/github/reactions.go @@ -26,7 +26,8 @@ type Reaction struct { // Content is the type of reaction. // Possible values are: // "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". - Content *string `json:"content,omitempty"` + Content *string `json:"content,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` } // Reactions represents a summary of GitHub reactions. @@ -47,9 +48,8 @@ func (r Reaction) String() string { return Stringify(r) } -// ListCommentReactionOptions specifies the optional parameters to the -// ReactionsService.ListCommentReactions method. -type ListCommentReactionOptions struct { +// ListReactionOptions specifies the optional parameters to the list reactions endpoints. +type ListReactionOptions struct { // Content restricts the returned comment reactions to only those with the given type. // Omit this parameter to list all reactions to a commit comment. // Possible values are: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". @@ -63,7 +63,7 @@ type ListCommentReactionOptions struct { // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment // //meta:operation GET /repos/{owner}/{repo}/comments/{comment_id}/reactions -func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListCommentReactionOptions) ([]*Reaction, *Response, error) { +func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) if err != nil { @@ -98,7 +98,7 @@ func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) - body := &Reaction{Content: String(content)} + body := &Reaction{Content: Ptr(content)} req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err @@ -143,7 +143,7 @@ func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue // //meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/reactions -func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Reaction, *Response, error) { +func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) u, err := addOptions(u, opts) if err != nil { @@ -178,7 +178,7 @@ func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo s func (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) - body := &Reaction{Content: String(content)} + body := &Reaction{Content: Ptr(content)} req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err @@ -223,7 +223,7 @@ func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment // //meta:operation GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions -func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { +func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) if err != nil { @@ -258,7 +258,7 @@ func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, func (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) - body := &Reaction{Content: String(content)} + body := &Reaction{Content: Ptr(content)} req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err @@ -303,7 +303,7 @@ func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, r // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment // //meta:operation GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions -func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { +func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) if err != nil { @@ -338,7 +338,7 @@ func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, func (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) - body := &Reaction{Content: String(content)} + body := &Reaction{Content: Ptr(content)} req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err @@ -383,7 +383,7 @@ func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Cont // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy // //meta:operation GET /teams/{team_id}/discussions/{discussion_number}/reactions -func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { +func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) u, err := addOptions(u, opts) if err != nil { @@ -415,7 +415,7 @@ func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, team func (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) - body := &Reaction{Content: String(content)} + body := &Reaction{Content: Ptr(content)} req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err @@ -459,7 +459,7 @@ func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx cont // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy // //meta:operation GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions -func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { +func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) u, err := addOptions(u, opts) if err != nil { @@ -490,7 +490,7 @@ func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Contex func (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) - body := &Reaction{Content: String(content)} + body := &Reaction{Content: Ptr(content)} req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err @@ -552,7 +552,7 @@ func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Res func (s *ReactionsService) CreateReleaseReaction(ctx context.Context, owner, repo string, releaseID int64, content string) (*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/releases/%v/reactions", owner, repo, releaseID) - body := &Reaction{Content: String(content)} + body := &Reaction{Content: Ptr(content)} req, err := s.client.NewRequest("POST", u, body) if err != nil { return nil, nil, err @@ -568,3 +568,54 @@ func (s *ReactionsService) CreateReleaseReaction(ctx context.Context, owner, rep return m, resp, nil } + +// ListReleaseReactions lists the reactions for a release. +// +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-release +// +//meta:operation GET /repos/{owner}/{repo}/releases/{release_id}/reactions +func (s *ReactionsService) ListReleaseReactions(ctx context.Context, owner, repo string, releaseID int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/releases/%v/reactions", owner, repo, releaseID) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + // TODO: remove custom Accept headers when APIs fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) + + var m []*Reaction + resp, err := s.client.Do(ctx, req, &m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// DeleteReleaseReaction deletes the reaction for a release. +// +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id} +func (s *ReactionsService) DeleteReleaseReaction(ctx context.Context, owner, repo string, releaseID, reactionID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/releases/%v/reactions/%v", owner, repo, releaseID, reactionID) + + return s.deleteReaction(ctx, u) +} + +// DeleteReleaseReactionByID deletes the reaction for a release by repository ID. +// +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id} +func (s *ReactionsService) DeleteReleaseReactionByID(ctx context.Context, repoID, releaseID, reactionID int64) (*Response, error) { + u := fmt.Sprintf("repositories/%v/releases/%v/reactions/%v", repoID, releaseID, reactionID) + + return s.deleteReaction(ctx, u) +} diff --git a/vendor/github.com/google/go-github/v66/github/repos.go b/vendor/github.com/google/go-github/v74/github/repos.go similarity index 95% rename from vendor/github.com/google/go-github/v66/github/repos.go rename to vendor/github.com/google/go-github/v74/github/repos.go index 9faed401f8..2ce1df0596 100644 --- a/vendor/github.com/google/go-github/v66/github/repos.go +++ b/vendor/github.com/google/go-github/v74/github/repos.go @@ -27,59 +27,59 @@ type RepositoriesService service // Repository represents a GitHub repository. type Repository struct { - ID *int64 `json:"id,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Owner *User `json:"owner,omitempty"` - Name *string `json:"name,omitempty"` - FullName *string `json:"full_name,omitempty"` - Description *string `json:"description,omitempty"` - Homepage *string `json:"homepage,omitempty"` - CodeOfConduct *CodeOfConduct `json:"code_of_conduct,omitempty"` - DefaultBranch *string `json:"default_branch,omitempty"` - MasterBranch *string `json:"master_branch,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - PushedAt *Timestamp `json:"pushed_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - CloneURL *string `json:"clone_url,omitempty"` - GitURL *string `json:"git_url,omitempty"` - MirrorURL *string `json:"mirror_url,omitempty"` - SSHURL *string `json:"ssh_url,omitempty"` - SVNURL *string `json:"svn_url,omitempty"` - Language *string `json:"language,omitempty"` - Fork *bool `json:"fork,omitempty"` - ForksCount *int `json:"forks_count,omitempty"` - NetworkCount *int `json:"network_count,omitempty"` - OpenIssuesCount *int `json:"open_issues_count,omitempty"` - OpenIssues *int `json:"open_issues,omitempty"` // Deprecated: Replaced by OpenIssuesCount. For backward compatibility OpenIssues is still populated. - StargazersCount *int `json:"stargazers_count,omitempty"` - SubscribersCount *int `json:"subscribers_count,omitempty"` - WatchersCount *int `json:"watchers_count,omitempty"` // Deprecated: Replaced by StargazersCount. For backward compatibility WatchersCount is still populated. - Watchers *int `json:"watchers,omitempty"` // Deprecated: Replaced by StargazersCount. For backward compatibility Watchers is still populated. - Size *int `json:"size,omitempty"` - AutoInit *bool `json:"auto_init,omitempty"` - Parent *Repository `json:"parent,omitempty"` - Source *Repository `json:"source,omitempty"` - TemplateRepository *Repository `json:"template_repository,omitempty"` - Organization *Organization `json:"organization,omitempty"` - Permissions map[string]bool `json:"permissions,omitempty"` - AllowRebaseMerge *bool `json:"allow_rebase_merge,omitempty"` - AllowUpdateBranch *bool `json:"allow_update_branch,omitempty"` - AllowSquashMerge *bool `json:"allow_squash_merge,omitempty"` - AllowMergeCommit *bool `json:"allow_merge_commit,omitempty"` - AllowAutoMerge *bool `json:"allow_auto_merge,omitempty"` - AllowForking *bool `json:"allow_forking,omitempty"` - WebCommitSignoffRequired *bool `json:"web_commit_signoff_required,omitempty"` - DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"` - UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"` - SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "COMMIT_OR_PR_TITLE" - SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "COMMIT_MESSAGES", "BLANK" - MergeCommitTitle *string `json:"merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "MERGE_MESSAGE" - MergeCommitMessage *string `json:"merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "PR_TITLE", "BLANK" - Topics []string `json:"topics,omitempty"` - CustomProperties map[string]interface{} `json:"custom_properties,omitempty"` - Archived *bool `json:"archived,omitempty"` - Disabled *bool `json:"disabled,omitempty"` + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Owner *User `json:"owner,omitempty"` + Name *string `json:"name,omitempty"` + FullName *string `json:"full_name,omitempty"` + Description *string `json:"description,omitempty"` + Homepage *string `json:"homepage,omitempty"` + CodeOfConduct *CodeOfConduct `json:"code_of_conduct,omitempty"` + DefaultBranch *string `json:"default_branch,omitempty"` + MasterBranch *string `json:"master_branch,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + PushedAt *Timestamp `json:"pushed_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + CloneURL *string `json:"clone_url,omitempty"` + GitURL *string `json:"git_url,omitempty"` + MirrorURL *string `json:"mirror_url,omitempty"` + SSHURL *string `json:"ssh_url,omitempty"` + SVNURL *string `json:"svn_url,omitempty"` + Language *string `json:"language,omitempty"` + Fork *bool `json:"fork,omitempty"` + ForksCount *int `json:"forks_count,omitempty"` + NetworkCount *int `json:"network_count,omitempty"` + OpenIssuesCount *int `json:"open_issues_count,omitempty"` + OpenIssues *int `json:"open_issues,omitempty"` // Deprecated: Replaced by OpenIssuesCount. For backward compatibility OpenIssues is still populated. + StargazersCount *int `json:"stargazers_count,omitempty"` + SubscribersCount *int `json:"subscribers_count,omitempty"` + WatchersCount *int `json:"watchers_count,omitempty"` // Deprecated: Replaced by StargazersCount. For backward compatibility WatchersCount is still populated. + Watchers *int `json:"watchers,omitempty"` // Deprecated: Replaced by StargazersCount. For backward compatibility Watchers is still populated. + Size *int `json:"size,omitempty"` + AutoInit *bool `json:"auto_init,omitempty"` + Parent *Repository `json:"parent,omitempty"` + Source *Repository `json:"source,omitempty"` + TemplateRepository *Repository `json:"template_repository,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Permissions map[string]bool `json:"permissions,omitempty"` + AllowRebaseMerge *bool `json:"allow_rebase_merge,omitempty"` + AllowUpdateBranch *bool `json:"allow_update_branch,omitempty"` + AllowSquashMerge *bool `json:"allow_squash_merge,omitempty"` + AllowMergeCommit *bool `json:"allow_merge_commit,omitempty"` + AllowAutoMerge *bool `json:"allow_auto_merge,omitempty"` + AllowForking *bool `json:"allow_forking,omitempty"` + WebCommitSignoffRequired *bool `json:"web_commit_signoff_required,omitempty"` + DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"` + UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"` + SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "COMMIT_OR_PR_TITLE" + SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "COMMIT_MESSAGES", "BLANK" + MergeCommitTitle *string `json:"merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "MERGE_MESSAGE" + MergeCommitMessage *string `json:"merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "PR_TITLE", "BLANK" + Topics []string `json:"topics,omitempty"` + CustomProperties map[string]any `json:"custom_properties,omitempty"` + Archived *bool `json:"archived,omitempty"` + Disabled *bool `json:"disabled,omitempty"` // Only provided when using RepositoriesService.Get while in preview License *License `json:"license,omitempty"` @@ -833,7 +833,7 @@ func (s *RepositoriesService) DisableVulnerabilityAlerts(ctx context.Context, ow // GetAutomatedSecurityFixes checks if the automated security fixes for a repository are enabled. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-automated-security-fixes-are-enabled-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-dependabot-security-updates-are-enabled-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/automated-security-fixes func (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*AutomatedSecurityFixes, *Response, error) { @@ -854,7 +854,7 @@ func (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, own // EnableAutomatedSecurityFixes enables the automated security fixes for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-automated-security-fixes +// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-dependabot-security-updates // //meta:operation PUT /repos/{owner}/{repo}/automated-security-fixes func (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) { @@ -870,7 +870,7 @@ func (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, // DisableAutomatedSecurityFixes disables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-automated-security-fixes +// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-dependabot-security-updates // //meta:operation DELETE /repos/{owner}/{repo}/automated-security-fixes func (s *RepositoriesService) DisableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) { @@ -1010,7 +1010,8 @@ type Branch struct { // such as 'List branches'. In such cases, if branch protection is // enabled, Protected will be `true` but this will be nil, and // additional protection details can be obtained by calling GetBranch(). - Protection *Protection `json:"protection,omitempty"` + Protection *Protection `json:"protection,omitempty"` + ProtectionURL *string `json:"protection_url,omitempty"` } // Protection represents a repository branch's protection. @@ -1073,6 +1074,7 @@ type BranchProtectionRule struct { RequiredConversationResolutionLevel *string `json:"required_conversation_resolution_level,omitempty"` AuthorizedActorsOnly *bool `json:"authorized_actors_only,omitempty"` AuthorizedActorNames []string `json:"authorized_actor_names,omitempty"` + RequireLastPushApproval *bool `json:"require_last_push_approval,omitempty"` } // ProtectionChanges represents the changes to the rule if the BranchProtection was edited. @@ -1092,6 +1094,7 @@ type ProtectionChanges struct { RequiredStatusChecks *RequiredStatusChecksChanges `json:"required_status_checks,omitempty"` RequiredStatusChecksEnforcementLevel *RequiredStatusChecksEnforcementLevelChanges `json:"required_status_checks_enforcement_level,omitempty"` SignatureRequirementEnforcementLevel *SignatureRequirementEnforcementLevelChanges `json:"signature_requirement_enforcement_level,omitempty"` + RequireLastPushApproval *RequireLastPushApprovalChanges `json:"require_last_push_approval,omitempty"` } // AdminEnforcedChanges represents the changes made to the AdminEnforced policy. @@ -1169,6 +1172,11 @@ type SignatureRequirementEnforcementLevelChanges struct { From *string `json:"from,omitempty"` } +// RequireLastPushApprovalChanges represents the changes made to the RequireLastPushApproval policy. +type RequireLastPushApprovalChanges struct { + From *bool `json:"from,omitempty"` +} + // ProtectionRequest represents a request to create/edit a branch's protection. type ProtectionRequest struct { RequiredStatusChecks *RequiredStatusChecks `json:"required_status_checks"` diff --git a/vendor/github.com/google/go-github/v66/github/repos_actions_access.go b/vendor/github.com/google/go-github/v74/github/repos_actions_access.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/repos_actions_access.go rename to vendor/github.com/google/go-github/v74/github/repos_actions_access.go diff --git a/vendor/github.com/google/go-github/v66/github/repos_actions_allowed.go b/vendor/github.com/google/go-github/v74/github/repos_actions_allowed.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/repos_actions_allowed.go rename to vendor/github.com/google/go-github/v74/github/repos_actions_allowed.go diff --git a/vendor/github.com/google/go-github/v66/github/repos_actions_permissions.go b/vendor/github.com/google/go-github/v74/github/repos_actions_permissions.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/repos_actions_permissions.go rename to vendor/github.com/google/go-github/v74/github/repos_actions_permissions.go diff --git a/vendor/github.com/google/go-github/v66/github/repos_attestations.go b/vendor/github.com/google/go-github/v74/github/repos_attestations.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/repos_attestations.go rename to vendor/github.com/google/go-github/v74/github/repos_attestations.go diff --git a/vendor/github.com/google/go-github/v66/github/repos_autolinks.go b/vendor/github.com/google/go-github/v74/github/repos_autolinks.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/repos_autolinks.go rename to vendor/github.com/google/go-github/v74/github/repos_autolinks.go diff --git a/vendor/github.com/google/go-github/v66/github/repos_codeowners.go b/vendor/github.com/google/go-github/v74/github/repos_codeowners.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/repos_codeowners.go rename to vendor/github.com/google/go-github/v74/github/repos_codeowners.go diff --git a/vendor/github.com/google/go-github/v66/github/repos_collaborators.go b/vendor/github.com/google/go-github/v74/github/repos_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/repos_collaborators.go rename to vendor/github.com/google/go-github/v74/github/repos_collaborators.go diff --git a/vendor/github.com/google/go-github/v66/github/repos_comments.go b/vendor/github.com/google/go-github/v74/github/repos_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/repos_comments.go rename to vendor/github.com/google/go-github/v74/github/repos_comments.go diff --git a/vendor/github.com/google/go-github/v66/github/repos_commits.go b/vendor/github.com/google/go-github/v74/github/repos_commits.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/repos_commits.go rename to vendor/github.com/google/go-github/v74/github/repos_commits.go diff --git a/vendor/github.com/google/go-github/v66/github/repos_community_health.go b/vendor/github.com/google/go-github/v74/github/repos_community_health.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/repos_community_health.go rename to vendor/github.com/google/go-github/v74/github/repos_community_health.go diff --git a/vendor/github.com/google/go-github/v66/github/repos_contents.go b/vendor/github.com/google/go-github/v74/github/repos_contents.go similarity index 87% rename from vendor/github.com/google/go-github/v66/github/repos_contents.go rename to vendor/github.com/google/go-github/v74/github/repos_contents.go index 3a0c266b5e..3b24b6d4e6 100644 --- a/vendor/github.com/google/go-github/v66/github/repos_contents.go +++ b/vendor/github.com/google/go-github/v74/github/repos_contents.go @@ -62,7 +62,7 @@ type RepositoryContentFileOptions struct { } // RepositoryContentGetOptions represents an optional ref parameter, which can be a SHA, -// branch, or tag. +// branch, or tag. E.g., `6540c41b`, `heads/main`, `tags/v1.0`. type RepositoryContentGetOptions struct { Ref string `url:"ref,omitempty"` } @@ -139,17 +139,24 @@ func (s *RepositoriesService) GetReadme(ctx context.Context, owner, repo string, func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *Response, error) { dir := path.Dir(filepath) filename := path.Base(filepath) + fileContent, _, resp, err := s.GetContents(ctx, owner, repo, filepath, opts) + if err == nil && fileContent != nil { + content, err := fileContent.GetContent() + if err == nil && content != "" { + return io.NopCloser(strings.NewReader(content)), resp, nil + } + } + _, dirContents, resp, err := s.GetContents(ctx, owner, repo, dir, opts) if err != nil { return nil, resp, err } for _, contents := range dirContents { - if *contents.Name == filename { - if contents.DownloadURL == nil || *contents.DownloadURL == "" { + if contents.GetName() == filename { + if contents.GetDownloadURL() == "" { return nil, resp, fmt.Errorf("no download link found for %s", filepath) } - dlReq, err := http.NewRequestWithContext(ctx, http.MethodGet, *contents.DownloadURL, nil) if err != nil { return nil, resp, err @@ -181,17 +188,24 @@ func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *RepositoryContent, *Response, error) { dir := path.Dir(filepath) filename := path.Base(filepath) + fileContent, _, resp, err := s.GetContents(ctx, owner, repo, filepath, opts) + if err == nil && fileContent != nil { + content, err := fileContent.GetContent() + if err == nil && content != "" { + return io.NopCloser(strings.NewReader(content)), fileContent, resp, nil + } + } + _, dirContents, resp, err := s.GetContents(ctx, owner, repo, dir, opts) if err != nil { return nil, nil, resp, err } for _, contents := range dirContents { - if *contents.Name == filename { - if contents.DownloadURL == nil || *contents.DownloadURL == "" { + if contents.GetName() == filename { + if contents.GetDownloadURL() == "" { return nil, contents, resp, fmt.Errorf("no download link found for %s", filepath) } - dlReq, err := http.NewRequestWithContext(ctx, http.MethodGet, *contents.DownloadURL, nil) if err != nil { return nil, contents, resp, err @@ -254,7 +268,7 @@ func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path return nil, directoryContent, resp, nil } - return nil, nil, resp, fmt.Errorf("unmarshalling failed for both file and directory content: %s and %s", fileUnmarshalError, directoryUnmarshalError) + return nil, nil, resp, fmt.Errorf("unmarshaling failed for both file and directory content: %s and %s", fileUnmarshalError, directoryUnmarshalError) } // CreateFile creates a new file in a repository at the given path and returns @@ -348,6 +362,15 @@ func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo st if opts != nil && opts.Ref != "" { u += fmt.Sprintf("/%s", opts.Ref) } + + if s.client.RateLimitRedirectionalEndpoints { + return s.getArchiveLinkWithRateLimit(ctx, u, maxRedirects) + } + + return s.getArchiveLinkWithoutRateLimit(ctx, u, maxRedirects) +} + +func (s *RepositoriesService) getArchiveLinkWithoutRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects) if err != nil { return nil, nil, err @@ -355,7 +378,7 @@ func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo st defer resp.Body.Close() if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusFound { - return nil, newResponse(resp), fmt.Errorf("unexpected status code: %s", resp.Status) + return nil, newResponse(resp), fmt.Errorf("unexpected status code: %v", resp.Status) } parsedURL, err := url.Parse(resp.Header.Get("Location")) @@ -365,3 +388,23 @@ func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo st return parsedURL, newResponse(resp), nil } + +func (s *RepositoriesService) getArchiveLinkWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + url, resp, err := s.client.bareDoUntilFound(ctx, req, maxRedirects) + if err != nil { + return nil, resp, err + } + defer resp.Body.Close() + + // If we didn't receive a valid Location in a 302 response + if url == nil { + return nil, resp, fmt.Errorf("unexpected status code: %v", resp.Status) + } + + return url, resp, nil +} diff --git a/vendor/github.com/google/go-github/v66/github/repos_deployment_branch_policies.go b/vendor/github.com/google/go-github/v74/github/repos_deployment_branch_policies.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/repos_deployment_branch_policies.go rename to vendor/github.com/google/go-github/v74/github/repos_deployment_branch_policies.go diff --git a/vendor/github.com/google/go-github/v66/github/repos_deployment_protection_rules.go b/vendor/github.com/google/go-github/v74/github/repos_deployment_protection_rules.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/repos_deployment_protection_rules.go rename to vendor/github.com/google/go-github/v74/github/repos_deployment_protection_rules.go diff --git a/vendor/github.com/google/go-github/v66/github/repos_deployments.go b/vendor/github.com/google/go-github/v74/github/repos_deployments.go similarity index 93% rename from vendor/github.com/google/go-github/v66/github/repos_deployments.go rename to vendor/github.com/google/go-github/v74/github/repos_deployments.go index 6277ac2151..ded36a95b4 100644 --- a/vendor/github.com/google/go-github/v66/github/repos_deployments.go +++ b/vendor/github.com/google/go-github/v74/github/repos_deployments.go @@ -32,15 +32,15 @@ type Deployment struct { // DeploymentRequest represents a deployment request. type DeploymentRequest struct { - Ref *string `json:"ref,omitempty"` - Task *string `json:"task,omitempty"` - AutoMerge *bool `json:"auto_merge,omitempty"` - RequiredContexts *[]string `json:"required_contexts,omitempty"` - Payload interface{} `json:"payload,omitempty"` - Environment *string `json:"environment,omitempty"` - Description *string `json:"description,omitempty"` - TransientEnvironment *bool `json:"transient_environment,omitempty"` - ProductionEnvironment *bool `json:"production_environment,omitempty"` + Ref *string `json:"ref,omitempty"` + Task *string `json:"task,omitempty"` + AutoMerge *bool `json:"auto_merge,omitempty"` + RequiredContexts *[]string `json:"required_contexts,omitempty"` + Payload any `json:"payload,omitempty"` + Environment *string `json:"environment,omitempty"` + Description *string `json:"description,omitempty"` + TransientEnvironment *bool `json:"transient_environment,omitempty"` + ProductionEnvironment *bool `json:"production_environment,omitempty"` } // DeploymentsListOptions specifies the optional parameters to the diff --git a/vendor/github.com/google/go-github/v66/github/repos_environments.go b/vendor/github.com/google/go-github/v74/github/repos_environments.go similarity index 98% rename from vendor/github.com/google/go-github/v66/github/repos_environments.go rename to vendor/github.com/google/go-github/v74/github/repos_environments.go index ed81e3a1f9..eab51a11b1 100644 --- a/vendor/github.com/google/go-github/v66/github/repos_environments.go +++ b/vendor/github.com/google/go-github/v74/github/repos_environments.go @@ -62,8 +62,8 @@ type ProtectionRule struct { // RequiredReviewer represents a required reviewer. type RequiredReviewer struct { - Type *string `json:"type,omitempty"` - Reviewer interface{} `json:"reviewer,omitempty"` + Type *string `json:"type,omitempty"` + Reviewer any `json:"reviewer,omitempty"` } // EnvironmentListOptions specifies the optional parameters to the @@ -157,10 +157,10 @@ func (s *RepositoriesService) GetEnvironment(ctx context.Context, owner, repo, n func (c *CreateUpdateEnvironment) MarshalJSON() ([]byte, error) { type Alias CreateUpdateEnvironment if c.WaitTimer == nil { - c.WaitTimer = Int(0) + c.WaitTimer = Ptr(0) } if c.CanAdminsBypass == nil { - c.CanAdminsBypass = Bool(true) + c.CanAdminsBypass = Ptr(true) } return json.Marshal(&struct { *Alias diff --git a/vendor/github.com/google/go-github/v66/github/repos_forks.go b/vendor/github.com/google/go-github/v74/github/repos_forks.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/repos_forks.go rename to vendor/github.com/google/go-github/v74/github/repos_forks.go diff --git a/vendor/github.com/google/go-github/v66/github/repos_hooks.go b/vendor/github.com/google/go-github/v74/github/repos_hooks.go similarity index 93% rename from vendor/github.com/google/go-github/v66/github/repos_hooks.go rename to vendor/github.com/google/go-github/v74/github/repos_hooks.go index d221db21b6..67b80b857f 100644 --- a/vendor/github.com/google/go-github/v66/github/repos_hooks.go +++ b/vendor/github.com/google/go-github/v74/github/repos_hooks.go @@ -39,15 +39,15 @@ type WebHookAuthor = CommitAuthor // Hook represents a GitHub (web and service) hook for a repository. type Hook struct { - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - URL *string `json:"url,omitempty"` - ID *int64 `json:"id,omitempty"` - Type *string `json:"type,omitempty"` - Name *string `json:"name,omitempty"` - TestURL *string `json:"test_url,omitempty"` - PingURL *string `json:"ping_url,omitempty"` - LastResponse map[string]interface{} `json:"last_response,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + URL *string `json:"url,omitempty"` + ID *int64 `json:"id,omitempty"` + Type *string `json:"type,omitempty"` + Name *string `json:"name,omitempty"` + TestURL *string `json:"test_url,omitempty"` + PingURL *string `json:"ping_url,omitempty"` + LastResponse map[string]any `json:"last_response,omitempty"` // Only the following fields are used when creating a hook. // Config is required. diff --git a/vendor/github.com/google/go-github/v66/github/repos_hooks_configuration.go b/vendor/github.com/google/go-github/v74/github/repos_hooks_configuration.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/repos_hooks_configuration.go rename to vendor/github.com/google/go-github/v74/github/repos_hooks_configuration.go diff --git a/vendor/github.com/google/go-github/v66/github/repos_hooks_deliveries.go b/vendor/github.com/google/go-github/v74/github/repos_hooks_deliveries.go similarity index 88% rename from vendor/github.com/google/go-github/v66/github/repos_hooks_deliveries.go rename to vendor/github.com/google/go-github/v74/github/repos_hooks_deliveries.go index c8029f626b..526d82c6f7 100644 --- a/vendor/github.com/google/go-github/v66/github/repos_hooks_deliveries.go +++ b/vendor/github.com/google/go-github/v74/github/repos_hooks_deliveries.go @@ -9,6 +9,7 @@ import ( "context" "encoding/json" "fmt" + "strings" ) // HookDelivery represents the data that is received from GitHub's Webhook Delivery API @@ -39,6 +40,16 @@ func (d HookDelivery) String() string { return Stringify(d) } +// getHeader common function for GetHeader funcs of HookRequest & HookResponse. +func getHeader(headers map[string]string, key string) string { + for k, v := range headers { + if strings.EqualFold(k, key) { + return v + } + } + return "" +} + // HookRequest is a part of HookDelivery that contains // the HTTP headers and the JSON payload of the webhook request. type HookRequest struct { @@ -46,6 +57,11 @@ type HookRequest struct { RawPayload *json.RawMessage `json:"payload,omitempty"` } +// GetHeader gets the value associated with the given key (ignoring key case). +func (r *HookRequest) GetHeader(key string) string { + return getHeader(r.Headers, key) +} + func (r HookRequest) String() string { return Stringify(r) } @@ -57,6 +73,11 @@ type HookResponse struct { RawPayload *json.RawMessage `json:"payload,omitempty"` } +// GetHeader gets the value associated with the given key (ignoring key case). +func (r *HookResponse) GetHeader(key string) string { + return getHeader(r.Headers, key) +} + func (r HookResponse) String() string { return Stringify(r) } @@ -131,7 +152,7 @@ func (s *RepositoriesService) RedeliverHookDelivery(ctx context.Context, owner, // ParseRequestPayload parses the request payload. For recognized event types, // a value of the corresponding struct type will be returned. -func (d *HookDelivery) ParseRequestPayload() (interface{}, error) { +func (d *HookDelivery) ParseRequestPayload() (any, error) { eType, ok := messageToTypeName[d.GetEvent()] if !ok { return nil, fmt.Errorf("unsupported event type %q", d.GetEvent()) diff --git a/vendor/github.com/google/go-github/v66/github/repos_invitations.go b/vendor/github.com/google/go-github/v74/github/repos_invitations.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/repos_invitations.go rename to vendor/github.com/google/go-github/v74/github/repos_invitations.go diff --git a/vendor/github.com/google/go-github/v66/github/repos_keys.go b/vendor/github.com/google/go-github/v74/github/repos_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/repos_keys.go rename to vendor/github.com/google/go-github/v74/github/repos_keys.go diff --git a/vendor/github.com/google/go-github/v66/github/repos_lfs.go b/vendor/github.com/google/go-github/v74/github/repos_lfs.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/repos_lfs.go rename to vendor/github.com/google/go-github/v74/github/repos_lfs.go diff --git a/vendor/github.com/google/go-github/v66/github/repos_merging.go b/vendor/github.com/google/go-github/v74/github/repos_merging.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/repos_merging.go rename to vendor/github.com/google/go-github/v74/github/repos_merging.go diff --git a/vendor/github.com/google/go-github/v66/github/repos_pages.go b/vendor/github.com/google/go-github/v74/github/repos_pages.go similarity index 91% rename from vendor/github.com/google/go-github/v66/github/repos_pages.go rename to vendor/github.com/google/go-github/v74/github/repos_pages.go index 6b9ba76e44..930f6000b7 100644 --- a/vendor/github.com/google/go-github/v66/github/repos_pages.go +++ b/vendor/github.com/google/go-github/v74/github/repos_pages.go @@ -170,7 +170,36 @@ func (s *RepositoriesService) UpdatePages(ctx context.Context, owner, repo strin if err != nil { return resp, err } + return resp, nil +} + +// PagesUpdateWithoutCNAME defines parameters for updating a GitHub Pages site on GitHub Enterprise Servers. +// Sending a request with a CNAME (any value, empty string, or null) results in a 400 error: "Custom domains are not available for GitHub Pages". +type PagesUpdateWithoutCNAME struct { + BuildType *string `json:"build_type,omitempty"` + Source *PagesSource `json:"source,omitempty"` + Public *bool `json:"public,omitempty"` + HTTPSEnforced *bool `json:"https_enforced,omitempty"` +} + +// UpdatePagesGHES updates GitHub Pages for the named repo in GitHub Enterprise Servers. +// +// GitHub API docs: https://docs.github.com/rest/pages/pages#update-information-about-a-github-pages-site +// +//meta:operation PUT /repos/{owner}/{repo}/pages +func (s *RepositoriesService) UpdatePagesGHES(ctx context.Context, owner, repo string, opts *PagesUpdateWithoutCNAME) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) + req, err := s.client.NewRequest("PUT", u, opts) + + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } return resp, nil } diff --git a/vendor/github.com/google/go-github/v66/github/repos_prereceive_hooks.go b/vendor/github.com/google/go-github/v74/github/repos_prereceive_hooks.go similarity index 93% rename from vendor/github.com/google/go-github/v66/github/repos_prereceive_hooks.go rename to vendor/github.com/google/go-github/v74/github/repos_prereceive_hooks.go index 8bac8bff7e..144d2ec338 100644 --- a/vendor/github.com/google/go-github/v66/github/repos_prereceive_hooks.go +++ b/vendor/github.com/google/go-github/v74/github/repos_prereceive_hooks.go @@ -24,7 +24,7 @@ func (p PreReceiveHook) String() string { // ListPreReceiveHooks lists all pre-receive hooks for the specified repository. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PreReceiveHook, *Response, error) { @@ -53,7 +53,7 @@ func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, re // GetPreReceiveHook returns a single specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo string, id int64) (*PreReceiveHook, *Response, error) { @@ -77,7 +77,7 @@ func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo // UpdatePreReceiveHook updates a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository // //meta:operation PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, repo string, id int64, hook *PreReceiveHook) (*PreReceiveHook, *Response, error) { @@ -101,7 +101,7 @@ func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, r // DeletePreReceiveHook deletes a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) DeletePreReceiveHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v66/github/repos_properties.go b/vendor/github.com/google/go-github/v74/github/repos_properties.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/repos_properties.go rename to vendor/github.com/google/go-github/v74/github/repos_properties.go diff --git a/vendor/github.com/google/go-github/v66/github/repos_releases.go b/vendor/github.com/google/go-github/v74/github/repos_releases.go similarity index 97% rename from vendor/github.com/google/go-github/v66/github/repos_releases.go rename to vendor/github.com/google/go-github/v74/github/repos_releases.go index 7231db6d9e..fb90c0fd24 100644 --- a/vendor/github.com/google/go-github/v66/github/repos_releases.go +++ b/vendor/github.com/google/go-github/v74/github/repos_releases.go @@ -79,6 +79,7 @@ type ReleaseAsset struct { BrowserDownloadURL *string `json:"browser_download_url,omitempty"` Uploader *User `json:"uploader,omitempty"` NodeID *string `json:"node_id,omitempty"` + Digest *string `json:"digest,omitempty"` } func (r ReleaseAsset) String() string { @@ -333,9 +334,10 @@ func (s *RepositoriesService) GetReleaseAsset(ctx context.Context, owner, repo s // of the io.ReadCloser. Exactly one of rc and redirectURL will be zero. // // followRedirectsClient can be passed to download the asset from a redirected -// location. Passing http.DefaultClient is recommended unless special circumstances -// exist, but it's possible to pass any http.Client. If nil is passed the -// redirectURL will be returned instead. +// location. Specifying any http.Client is possible, but passing http.DefaultClient +// is recommended, except when the specified repository is private, in which case +// it's necessary to pass an http.Client that performs authenticated requests. +// If nil is passed the redirectURL will be returned instead. // // GitHub API docs: https://docs.github.com/rest/releases/assets#get-a-release-asset // @@ -354,7 +356,7 @@ func (s *RepositoriesService) DownloadReleaseAsset(ctx context.Context, owner, r var loc string saveRedirect := s.client.client.CheckRedirect - s.client.client.CheckRedirect = func(req *http.Request, via []*http.Request) error { + s.client.client.CheckRedirect = func(req *http.Request, _ []*http.Request) error { loc = req.URL.String() return errors.New("disable redirect") } @@ -387,7 +389,7 @@ func (s *RepositoriesService) downloadReleaseAssetFromURL(ctx context.Context, f return nil, err } req = withContext(ctx, req) - req.Header.Set("Accept", "*/*") + req.Header.Set("Accept", defaultMediaType) resp, err := followRedirectsClient.Do(req) if err != nil { return nil, err diff --git a/vendor/github.com/google/go-github/v74/github/repos_rules.go b/vendor/github.com/google/go-github/v74/github/repos_rules.go new file mode 100644 index 0000000000..038cefd71a --- /dev/null +++ b/vendor/github.com/google/go-github/v74/github/repos_rules.go @@ -0,0 +1,246 @@ +// Copyright 2023 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// rulesetNoOmitBypassActors represents a GitHub ruleset object. The struct does not omit bypassActors if the field is nil or an empty array is passed. +type rulesetNoOmitBypassActors struct { + ID *int64 `json:"id,omitempty"` + Name string `json:"name"` + Target *RulesetTarget `json:"target,omitempty"` + SourceType *RulesetSourceType `json:"source_type,omitempty"` + Source string `json:"source"` + Enforcement RulesetEnforcement `json:"enforcement"` + BypassActors []*BypassActor `json:"bypass_actors"` + CurrentUserCanBypass *BypassMode `json:"current_user_can_bypass,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Links *RepositoryRulesetLinks `json:"_links,omitempty"` + Conditions *RepositoryRulesetConditions `json:"conditions,omitempty"` + Rules *RepositoryRulesetRules `json:"rules,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` +} + +// rulesetClearBypassActors is used to clear the bypass actors when modifying a GitHub ruleset object. +type rulesetClearBypassActors struct { + BypassActors []*BypassActor `json:"bypass_actors"` +} + +// GetRulesForBranch gets all the repository rules that apply to the specified branch. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch +// +//meta:operation GET /repos/{owner}/{repo}/rules/branches/{branch} +func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo, branch string, opts *ListOptions) (*BranchRules, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rules/branches/%v", owner, repo, branch) + + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var rules *BranchRules + resp, err := s.client.Do(ctx, req, &rules) + if err != nil { + return nil, resp, err + } + + return rules, resp, nil +} + +// RepositoryListRulesetsOptions specifies optional parameters to the +// RepositoriesService.GetAllRulesets method. +type RepositoryListRulesetsOptions struct { + // IncludesParents indicates whether to include rulesets configured at the organization or enterprise level that apply to the repository. + IncludesParents *bool `url:"includes_parents,omitempty"` + ListOptions +} + +// GetAllRulesets gets all the repository rulesets for the specified repository. +// By default, this endpoint will include rulesets configured at the organization or enterprise level that apply to the repository. +// To exclude those rulesets, set the `RepositoryListRulesetsOptions.IncludesParents` parameter to `false`. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets +// +//meta:operation GET /repos/{owner}/{repo}/rulesets +func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo string, opts *RepositoryListRulesetsOptions) ([]*RepositoryRuleset, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets", owner, repo) + + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var ruleset []*RepositoryRuleset + resp, err := s.client.Do(ctx, req, &ruleset) + if err != nil { + return nil, resp, err + } + + return ruleset, resp, nil +} + +// CreateRuleset creates a repository ruleset for the specified repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset +// +//meta:operation POST /repos/{owner}/{repo}/rulesets +func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo string, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets", owner, repo) + + req, err := s.client.NewRequest("POST", u, ruleset) + if err != nil { + return nil, nil, err + } + + var rs *RepositoryRuleset + resp, err := s.client.Do(ctx, req, &rs) + if err != nil { + return nil, resp, err + } + + return rs, resp, nil +} + +// GetRuleset gets a repository ruleset for the specified repository. +// If includesParents is true, rulesets configured at the organization or enterprise level that apply to the repository will be returned. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset +// +//meta:operation GET /repos/{owner}/{repo}/rulesets/{ruleset_id} +func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string, rulesetID int64, includesParents bool) (*RepositoryRuleset, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets/%v?includes_parents=%v", owner, repo, rulesetID, includesParents) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var ruleset *RepositoryRuleset + resp, err := s.client.Do(ctx, req, &ruleset) + if err != nil { + return nil, resp, err + } + + return ruleset, resp, nil +} + +// UpdateRuleset updates a repository ruleset for the specified repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset +// +//meta:operation PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} +func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo string, rulesetID int64, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) + + req, err := s.client.NewRequest("PUT", u, ruleset) + if err != nil { + return nil, nil, err + } + + var rs *RepositoryRuleset + resp, err := s.client.Do(ctx, req, &rs) + if err != nil { + return nil, resp, err + } + + return rs, resp, nil +} + +// UpdateRulesetClearBypassActor clears the bypass actors for a repository ruleset for the specified repository. +// +// This function is necessary as the UpdateRuleset function does not marshal ByPassActor if passed as an empty array. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset +// +//meta:operation PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} +func (s *RepositoriesService) UpdateRulesetClearBypassActor(ctx context.Context, owner, repo string, rulesetID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) + + rsClearBypassActor := rulesetClearBypassActors{} + + req, err := s.client.NewRequest("PUT", u, rsClearBypassActor) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// UpdateRulesetNoBypassActor updates a repository ruleset for the specified repository. +// +// This function is necessary as the UpdateRuleset function does not marshal ByPassActor if passed as an empty array. +// +// Deprecated: Use UpdateRulesetClearBypassActor instead. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset +// +//meta:operation PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} +func (s *RepositoriesService) UpdateRulesetNoBypassActor(ctx context.Context, owner, repo string, rulesetID int64, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) + + rsNoBypassActor := rulesetNoOmitBypassActors{ + ID: ruleset.ID, + Name: ruleset.Name, + Target: ruleset.Target, + SourceType: ruleset.SourceType, + Source: ruleset.Source, + Enforcement: ruleset.Enforcement, + BypassActors: ruleset.BypassActors, + NodeID: ruleset.NodeID, + Links: ruleset.Links, + Conditions: ruleset.Conditions, + Rules: ruleset.Rules, + } + + req, err := s.client.NewRequest("PUT", u, rsNoBypassActor) + if err != nil { + return nil, nil, err + } + + var rs *RepositoryRuleset + resp, err := s.client.Do(ctx, req, &rs) + if err != nil { + return nil, resp, err + } + + return rs, resp, nil +} + +// DeleteRuleset deletes a repository ruleset for the specified repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset +// +//meta:operation DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id} +func (s *RepositoriesService) DeleteRuleset(ctx context.Context, owner, repo string, rulesetID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v66/github/repos_stats.go b/vendor/github.com/google/go-github/v74/github/repos_stats.go similarity index 98% rename from vendor/github.com/google/go-github/v66/github/repos_stats.go rename to vendor/github.com/google/go-github/v74/github/repos_stats.go index 898693f786..a6ef9c0da4 100644 --- a/vendor/github.com/google/go-github/v66/github/repos_stats.go +++ b/vendor/github.com/google/go-github/v74/github/repos_stats.go @@ -139,8 +139,8 @@ func (s *RepositoriesService) ListCodeFrequency(ctx context.Context, owner, repo } stat := &WeeklyStats{ Week: &Timestamp{time.Unix(int64(week[0]), 0)}, - Additions: Int(week[1]), - Deletions: Int(week[2]), + Additions: Ptr(week[1]), + Deletions: Ptr(week[2]), } stats = append(stats, stat) } @@ -231,9 +231,9 @@ func (s *RepositoriesService) ListPunchCard(ctx context.Context, owner, repo str continue } card := &PunchCard{ - Day: Int(result[0]), - Hour: Int(result[1]), - Commits: Int(result[2]), + Day: Ptr(result[0]), + Hour: Ptr(result[1]), + Commits: Ptr(result[2]), } cards = append(cards, card) } diff --git a/vendor/github.com/google/go-github/v66/github/repos_statuses.go b/vendor/github.com/google/go-github/v74/github/repos_statuses.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/repos_statuses.go rename to vendor/github.com/google/go-github/v74/github/repos_statuses.go diff --git a/vendor/github.com/google/go-github/v66/github/repos_tags.go b/vendor/github.com/google/go-github/v74/github/repos_tags.go similarity index 89% rename from vendor/github.com/google/go-github/v66/github/repos_tags.go rename to vendor/github.com/google/go-github/v74/github/repos_tags.go index 3fb7f583d1..b6dc36e2a3 100644 --- a/vendor/github.com/google/go-github/v66/github/repos_tags.go +++ b/vendor/github.com/google/go-github/v74/github/repos_tags.go @@ -25,7 +25,7 @@ type tagProtectionRequest struct { // Deprecated: ListTagProtection lists tag protection of the specified repository. // Deprecation notice: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets // -// GitHub API docs: https://docs.github.com/rest/repos/tags#deprecated---list-tag-protection-states-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/tags#closing-down---list-tag-protection-states-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/tags/protection func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo string) ([]*TagProtection, *Response, error) { @@ -48,7 +48,7 @@ func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo // Deprecated: CreateTagProtection creates the tag protection of the specified repository. // Deprecation notice: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset // -// GitHub API docs: https://docs.github.com/rest/repos/tags#deprecated---create-a-tag-protection-state-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/tags#closing-down---create-a-tag-protection-state-for-a-repository // //meta:operation POST /repos/{owner}/{repo}/tags/protection func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, repo, pattern string) (*TagProtection, *Response, error) { @@ -71,7 +71,7 @@ func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, re // Deprecated: DeleteTagProtection deletes a tag protection from the specified repository. // Deprecation notice: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset // -// GitHub API docs: https://docs.github.com/rest/repos/tags#deprecated---delete-a-tag-protection-state-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/tags#closing-down---delete-a-tag-protection-state-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id} func (s *RepositoriesService) DeleteTagProtection(ctx context.Context, owner, repo string, tagProtectionID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v66/github/repos_traffic.go b/vendor/github.com/google/go-github/v74/github/repos_traffic.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/repos_traffic.go rename to vendor/github.com/google/go-github/v74/github/repos_traffic.go diff --git a/vendor/github.com/google/go-github/v74/github/rules.go b/vendor/github.com/google/go-github/v74/github/rules.go new file mode 100644 index 0000000000..4def2d19ee --- /dev/null +++ b/vendor/github.com/google/go-github/v74/github/rules.go @@ -0,0 +1,1228 @@ +// Copyright 2025 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "encoding/json" + "reflect" +) + +// RulesetTarget represents a GitHub ruleset target. +type RulesetTarget string + +// This is the set of GitHub ruleset targets. +const ( + RulesetTargetBranch RulesetTarget = "branch" + RulesetTargetTag RulesetTarget = "tag" + RulesetTargetPush RulesetTarget = "push" +) + +// RulesetSourceType represents a GitHub ruleset source type. +type RulesetSourceType string + +// This is the set of GitHub ruleset source types. +const ( + RulesetSourceTypeRepository RulesetSourceType = "Repository" + RulesetSourceTypeOrganization RulesetSourceType = "Organization" + RulesetSourceTypeEnterprise RulesetSourceType = "Enterprise" +) + +// RulesetEnforcement represents a GitHub ruleset enforcement. +type RulesetEnforcement string + +// This is the set of GitHub ruleset enforcements. +const ( + RulesetEnforcementDisabled RulesetEnforcement = "disabled" + RulesetEnforcementActive RulesetEnforcement = "active" + RulesetEnforcementEvaluate RulesetEnforcement = "evaluate" +) + +// BypassActorType represents a GitHub ruleset bypass actor type. +type BypassActorType string + +// This is the set of GitHub ruleset bypass actor types. +const ( + BypassActorTypeIntegration BypassActorType = "Integration" + BypassActorTypeOrganizationAdmin BypassActorType = "OrganizationAdmin" + BypassActorTypeRepositoryRole BypassActorType = "RepositoryRole" + BypassActorTypeTeam BypassActorType = "Team" + BypassActorTypeDeployKey BypassActorType = "DeployKey" +) + +// BypassMode represents a GitHub ruleset bypass mode. +type BypassMode string + +// This is the set of GitHub ruleset bypass modes. +const ( + BypassModeAlways BypassMode = "always" + BypassModePullRequest BypassMode = "pull_request" + BypassModeNever BypassMode = "never" +) + +// RepositoryRuleType represents a GitHub ruleset rule type. +type RepositoryRuleType string + +// This is the set of GitHub ruleset rule types. +const ( + RulesetRuleTypeCreation RepositoryRuleType = "creation" + RulesetRuleTypeUpdate RepositoryRuleType = "update" + RulesetRuleTypeDeletion RepositoryRuleType = "deletion" + RulesetRuleTypeRequiredLinearHistory RepositoryRuleType = "required_linear_history" + RulesetRuleTypeMergeQueue RepositoryRuleType = "merge_queue" + RulesetRuleTypeRequiredDeployments RepositoryRuleType = "required_deployments" + RulesetRuleTypeRequiredSignatures RepositoryRuleType = "required_signatures" + RulesetRuleTypePullRequest RepositoryRuleType = "pull_request" + RulesetRuleTypeRequiredStatusChecks RepositoryRuleType = "required_status_checks" + RulesetRuleTypeNonFastForward RepositoryRuleType = "non_fast_forward" + RulesetRuleTypeCommitMessagePattern RepositoryRuleType = "commit_message_pattern" + RulesetRuleTypeCommitAuthorEmailPattern RepositoryRuleType = "commit_author_email_pattern" + RulesetRuleTypeCommitterEmailPattern RepositoryRuleType = "committer_email_pattern" + RulesetRuleTypeBranchNamePattern RepositoryRuleType = "branch_name_pattern" + RulesetRuleTypeTagNamePattern RepositoryRuleType = "tag_name_pattern" + RulesetRuleTypeFilePathRestriction RepositoryRuleType = "file_path_restriction" + RulesetRuleTypeMaxFilePathLength RepositoryRuleType = "max_file_path_length" + RulesetRuleTypeFileExtensionRestriction RepositoryRuleType = "file_extension_restriction" + RulesetRuleTypeMaxFileSize RepositoryRuleType = "max_file_size" + RulesetRuleTypeWorkflows RepositoryRuleType = "workflows" + RulesetRuleTypeCodeScanning RepositoryRuleType = "code_scanning" +) + +// MergeGroupingStrategy models a GitHub merge grouping strategy. +type MergeGroupingStrategy string + +// This is the set of GitHub merge grouping strategies. +const ( + MergeGroupingStrategyAllGreen MergeGroupingStrategy = "ALLGREEN" + MergeGroupingStrategyHeadGreen MergeGroupingStrategy = "HEADGREEN" +) + +// PullRequestMergeMethod is used in PullRequestRuleParameters, +// where the GitHub API expects lowercase merge method values: "merge", "rebase", "squash". +// +// NOTE: GitHub's API inconsistently uses different casing for the same logical values +// across different rules. +// +// TODO: Unify with MergeQueueMergeMethod once the GitHub API uses consistent casing. +type PullRequestMergeMethod string + +const ( + PullRequestMergeMethodMerge PullRequestMergeMethod = "merge" + PullRequestMergeMethodRebase PullRequestMergeMethod = "rebase" + PullRequestMergeMethodSquash PullRequestMergeMethod = "squash" +) + +// MergeQueueMergeMethod is used in MergeQueueRuleParameters, +// where the GitHub API expects uppercase merge method values: "MERGE", "REBASE", "SQUASH". +// +// NOTE: This type exists alongside PullRequestMergeMethod solely due to API casing inconsistencies. +// It enforces the correct usage by API context. +// +// TODO: Unify with PullRequestMergeMethod once the GitHub API uses consistent casing. +type MergeQueueMergeMethod string + +const ( + MergeQueueMergeMethodMerge MergeQueueMergeMethod = "MERGE" + MergeQueueMergeMethodRebase MergeQueueMergeMethod = "REBASE" + MergeQueueMergeMethodSquash MergeQueueMergeMethod = "SQUASH" +) + +// PatternRuleOperator models a GitHub pattern rule operator. +type PatternRuleOperator string + +// This is the set of GitHub pattern rule operators. +const ( + PatternRuleOperatorStartsWith PatternRuleOperator = "starts_with" + PatternRuleOperatorEndsWith PatternRuleOperator = "ends_with" + PatternRuleOperatorContains PatternRuleOperator = "contains" + PatternRuleOperatorRegex PatternRuleOperator = "regex" +) + +// CodeScanningAlertsThreshold models a GitHub code scanning alerts threshold. +type CodeScanningAlertsThreshold string + +// This is the set of GitHub code scanning alerts thresholds. +const ( + CodeScanningAlertsThresholdNone CodeScanningAlertsThreshold = "none" + CodeScanningAlertsThresholdErrors CodeScanningAlertsThreshold = "errors" + CodeScanningAlertsThresholdErrorsAndWarnings CodeScanningAlertsThreshold = "errors_and_warnings" + CodeScanningAlertsThresholdAll CodeScanningAlertsThreshold = "all" +) + +// CodeScanningSecurityAlertsThreshold models a GitHub code scanning security alerts threshold. +type CodeScanningSecurityAlertsThreshold string + +// This is the set of GitHub code scanning security alerts thresholds. +const ( + CodeScanningSecurityAlertsThresholdNone CodeScanningSecurityAlertsThreshold = "none" + CodeScanningSecurityAlertsThresholdCritical CodeScanningSecurityAlertsThreshold = "critical" + CodeScanningSecurityAlertsThresholdHighOrHigher CodeScanningSecurityAlertsThreshold = "high_or_higher" + CodeScanningSecurityAlertsThresholdMediumOrHigher CodeScanningSecurityAlertsThreshold = "medium_or_higher" + CodeScanningSecurityAlertsThresholdAll CodeScanningSecurityAlertsThreshold = "all" +) + +// RepositoryRuleset represents a GitHub ruleset object. +type RepositoryRuleset struct { + ID *int64 `json:"id,omitempty"` + Name string `json:"name"` + Target *RulesetTarget `json:"target,omitempty"` + SourceType *RulesetSourceType `json:"source_type,omitempty"` + Source string `json:"source"` + Enforcement RulesetEnforcement `json:"enforcement"` + BypassActors []*BypassActor `json:"bypass_actors,omitempty"` + CurrentUserCanBypass *BypassMode `json:"current_user_can_bypass,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Links *RepositoryRulesetLinks `json:"_links,omitempty"` + Conditions *RepositoryRulesetConditions `json:"conditions,omitempty"` + Rules *RepositoryRulesetRules `json:"rules,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` +} + +// BypassActor represents the bypass actors from a ruleset. +type BypassActor struct { + ActorID *int64 `json:"actor_id,omitempty"` + ActorType *BypassActorType `json:"actor_type,omitempty"` + BypassMode *BypassMode `json:"bypass_mode,omitempty"` +} + +// RepositoryRulesetLinks represents the "_links" object in a Ruleset. +type RepositoryRulesetLinks struct { + Self *RepositoryRulesetLink `json:"self,omitempty"` + HTML *RepositoryRulesetLink `json:"html,omitempty"` +} + +// RepositoryRulesetLink represents a single link object from GitHub ruleset request _links. +type RepositoryRulesetLink struct { + HRef *string `json:"href,omitempty"` +} + +// RepositoryRulesetConditions represents the conditions object in a ruleset. +// Set either RepositoryName or RepositoryID or RepositoryProperty, not more than one. +type RepositoryRulesetConditions struct { + RefName *RepositoryRulesetRefConditionParameters `json:"ref_name,omitempty"` + RepositoryID *RepositoryRulesetRepositoryIDsConditionParameters `json:"repository_id,omitempty"` + RepositoryName *RepositoryRulesetRepositoryNamesConditionParameters `json:"repository_name,omitempty"` + RepositoryProperty *RepositoryRulesetRepositoryPropertyConditionParameters `json:"repository_property,omitempty"` + OrganizationID *RepositoryRulesetOrganizationIDsConditionParameters `json:"organization_id,omitempty"` + OrganizationName *RepositoryRulesetOrganizationNamesConditionParameters `json:"organization_name,omitempty"` +} + +// RepositoryRulesetRefConditionParameters represents the conditions object for ref_names. +type RepositoryRulesetRefConditionParameters struct { + Include []string `json:"include"` + Exclude []string `json:"exclude"` +} + +// RepositoryRulesetRepositoryIDsConditionParameters represents the conditions object for repository_id. +type RepositoryRulesetRepositoryIDsConditionParameters struct { + RepositoryIDs []int64 `json:"repository_ids,omitempty"` +} + +// RepositoryRulesetRepositoryNamesConditionParameters represents the conditions object for repository_name. +type RepositoryRulesetRepositoryNamesConditionParameters struct { + Include []string `json:"include"` + Exclude []string `json:"exclude"` + Protected *bool `json:"protected,omitempty"` +} + +// RepositoryRulesetRepositoryPropertyConditionParameters represents the conditions object for repository_property. +type RepositoryRulesetRepositoryPropertyConditionParameters struct { + Include []*RepositoryRulesetRepositoryPropertyTargetParameters `json:"include"` + Exclude []*RepositoryRulesetRepositoryPropertyTargetParameters `json:"exclude"` +} + +// RepositoryRulesetRepositoryPropertyTargetParameters represents a repository_property name and values to be used for targeting. +type RepositoryRulesetRepositoryPropertyTargetParameters struct { + Name string `json:"name"` + PropertyValues []string `json:"property_values"` + Source *string `json:"source,omitempty"` +} + +// RepositoryRulesetOrganizationIDsConditionParameters represents the conditions object for organization_id. +type RepositoryRulesetOrganizationIDsConditionParameters struct { + OrganizationIDs []int64 `json:"organization_ids,omitempty"` +} + +// RepositoryRulesetOrganizationNamesConditionParameters represents the conditions object for organization_name. +type RepositoryRulesetOrganizationNamesConditionParameters struct { + Include []string `json:"include"` + Exclude []string `json:"exclude"` +} + +// RepositoryRule represents a GitHub ruleset rule object. +type RepositoryRule struct { + Type RepositoryRuleType `json:"type"` + Parameters any `json:"parameters,omitempty"` +} + +// RepositoryRulesetRules represents a GitHub ruleset rules object. +// This type doesn't have JSON annotations as it uses custom marshaling. +type RepositoryRulesetRules struct { + Creation *EmptyRuleParameters + Update *UpdateRuleParameters + Deletion *EmptyRuleParameters + RequiredLinearHistory *EmptyRuleParameters + MergeQueue *MergeQueueRuleParameters + RequiredDeployments *RequiredDeploymentsRuleParameters + RequiredSignatures *EmptyRuleParameters + PullRequest *PullRequestRuleParameters + RequiredStatusChecks *RequiredStatusChecksRuleParameters + NonFastForward *EmptyRuleParameters + CommitMessagePattern *PatternRuleParameters + CommitAuthorEmailPattern *PatternRuleParameters + CommitterEmailPattern *PatternRuleParameters + BranchNamePattern *PatternRuleParameters + TagNamePattern *PatternRuleParameters + FilePathRestriction *FilePathRestrictionRuleParameters + MaxFilePathLength *MaxFilePathLengthRuleParameters + FileExtensionRestriction *FileExtensionRestrictionRuleParameters + MaxFileSize *MaxFileSizeRuleParameters + Workflows *WorkflowsRuleParameters + CodeScanning *CodeScanningRuleParameters +} + +// BranchRules represents the rules active for a GitHub repository branch. +// This type doesn't have JSON annotations as it uses custom marshaling. +type BranchRules struct { + Creation []*BranchRuleMetadata + Update []*UpdateBranchRule + Deletion []*BranchRuleMetadata + RequiredLinearHistory []*BranchRuleMetadata + MergeQueue []*MergeQueueBranchRule + RequiredDeployments []*RequiredDeploymentsBranchRule + RequiredSignatures []*BranchRuleMetadata + PullRequest []*PullRequestBranchRule + RequiredStatusChecks []*RequiredStatusChecksBranchRule + NonFastForward []*BranchRuleMetadata + CommitMessagePattern []*PatternBranchRule + CommitAuthorEmailPattern []*PatternBranchRule + CommitterEmailPattern []*PatternBranchRule + BranchNamePattern []*PatternBranchRule + TagNamePattern []*PatternBranchRule + FilePathRestriction []*FilePathRestrictionBranchRule + MaxFilePathLength []*MaxFilePathLengthBranchRule + FileExtensionRestriction []*FileExtensionRestrictionBranchRule + MaxFileSize []*MaxFileSizeBranchRule + Workflows []*WorkflowsBranchRule + CodeScanning []*CodeScanningBranchRule +} + +// BranchRuleMetadata represents the metadata for a branch rule. +type BranchRuleMetadata struct { + RulesetSourceType RulesetSourceType `json:"ruleset_source_type"` + RulesetSource string `json:"ruleset_source"` + RulesetID int64 `json:"ruleset_id"` +} + +// UpdateBranchRule represents an update branch rule. +type UpdateBranchRule struct { + BranchRuleMetadata + Parameters UpdateRuleParameters `json:"parameters"` +} + +// MergeQueueBranchRule represents a merge queue branch rule. +type MergeQueueBranchRule struct { + BranchRuleMetadata + Parameters MergeQueueRuleParameters `json:"parameters"` +} + +// RequiredDeploymentsBranchRule represents a required deployments branch rule. +type RequiredDeploymentsBranchRule struct { + BranchRuleMetadata + Parameters RequiredDeploymentsRuleParameters `json:"parameters"` +} + +// PullRequestBranchRule represents a pull request branch rule. +type PullRequestBranchRule struct { + BranchRuleMetadata + Parameters PullRequestRuleParameters `json:"parameters"` +} + +// RequiredStatusChecksBranchRule represents a required status checks branch rule. +type RequiredStatusChecksBranchRule struct { + BranchRuleMetadata + Parameters RequiredStatusChecksRuleParameters `json:"parameters"` +} + +// PatternBranchRule represents a pattern branch rule. +type PatternBranchRule struct { + BranchRuleMetadata + Parameters PatternRuleParameters `json:"parameters"` +} + +// FilePathRestrictionBranchRule represents a file path restriction branch rule. +type FilePathRestrictionBranchRule struct { + BranchRuleMetadata + Parameters FilePathRestrictionRuleParameters `json:"parameters"` +} + +// MaxFilePathLengthBranchRule represents a max file path length branch rule. +type MaxFilePathLengthBranchRule struct { + BranchRuleMetadata + Parameters MaxFilePathLengthRuleParameters `json:"parameters"` +} + +// FileExtensionRestrictionBranchRule represents a file extension restriction branch rule. +type FileExtensionRestrictionBranchRule struct { + BranchRuleMetadata + Parameters FileExtensionRestrictionRuleParameters `json:"parameters"` +} + +// MaxFileSizeBranchRule represents a max file size branch rule. +type MaxFileSizeBranchRule struct { + BranchRuleMetadata + Parameters MaxFileSizeRuleParameters `json:"parameters"` +} + +// WorkflowsBranchRule represents a workflows branch rule. +type WorkflowsBranchRule struct { + BranchRuleMetadata + Parameters WorkflowsRuleParameters `json:"parameters"` +} + +// CodeScanningBranchRule represents a code scanning branch rule. +type CodeScanningBranchRule struct { + BranchRuleMetadata + Parameters CodeScanningRuleParameters `json:"parameters"` +} + +// EmptyRuleParameters represents the parameters for a rule with no options. +type EmptyRuleParameters struct{} + +// UpdateRuleParameters represents the update rule parameters. +type UpdateRuleParameters struct { + UpdateAllowsFetchAndMerge bool `json:"update_allows_fetch_and_merge,omitempty"` +} + +// MergeQueueRuleParameters represents the merge_queue rule parameters. +type MergeQueueRuleParameters struct { + CheckResponseTimeoutMinutes int `json:"check_response_timeout_minutes"` + GroupingStrategy MergeGroupingStrategy `json:"grouping_strategy"` + MaxEntriesToBuild int `json:"max_entries_to_build"` + MaxEntriesToMerge int `json:"max_entries_to_merge"` + MergeMethod MergeQueueMergeMethod `json:"merge_method"` + MinEntriesToMerge int `json:"min_entries_to_merge"` + MinEntriesToMergeWaitMinutes int `json:"min_entries_to_merge_wait_minutes"` +} + +// RequiredDeploymentsRuleParameters represents the required deployments rule parameters. +type RequiredDeploymentsRuleParameters struct { + RequiredDeploymentEnvironments []string `json:"required_deployment_environments"` +} + +// PullRequestRuleParameters represents the pull_request rule parameters. +type PullRequestRuleParameters struct { + AllowedMergeMethods []PullRequestMergeMethod `json:"allowed_merge_methods"` + AutomaticCopilotCodeReviewEnabled *bool `json:"automatic_copilot_code_review_enabled,omitempty"` + DismissStaleReviewsOnPush bool `json:"dismiss_stale_reviews_on_push"` + RequireCodeOwnerReview bool `json:"require_code_owner_review"` + RequireLastPushApproval bool `json:"require_last_push_approval"` + RequiredApprovingReviewCount int `json:"required_approving_review_count"` + RequiredReviewThreadResolution bool `json:"required_review_thread_resolution"` +} + +// RequiredStatusChecksRuleParameters represents the required status checks rule parameters. +type RequiredStatusChecksRuleParameters struct { + DoNotEnforceOnCreate *bool `json:"do_not_enforce_on_create,omitempty"` + RequiredStatusChecks []*RuleStatusCheck `json:"required_status_checks"` + StrictRequiredStatusChecksPolicy bool `json:"strict_required_status_checks_policy"` +} + +// RuleStatusCheck represents a status checks for the required status checks rule parameters. +type RuleStatusCheck struct { + Context string `json:"context"` + IntegrationID *int64 `json:"integration_id,omitempty"` +} + +// PatternRuleParameters represents the parameters for a pattern rule. +type PatternRuleParameters struct { + Name *string `json:"name,omitempty"` + // If Negate is true, the rule will fail if the pattern matches. + Negate *bool `json:"negate,omitempty"` + Operator PatternRuleOperator `json:"operator"` + Pattern string `json:"pattern"` +} + +// FilePathRestrictionRuleParameters represents the file path restriction rule parameters. +type FilePathRestrictionRuleParameters struct { + RestrictedFilePaths []string `json:"restricted_file_paths"` +} + +// MaxFilePathLengthRuleParameters represents the max file path length rule parameters. +type MaxFilePathLengthRuleParameters struct { + MaxFilePathLength int `json:"max_file_path_length"` +} + +// FileExtensionRestrictionRuleParameters represents the file extension restriction rule parameters. +type FileExtensionRestrictionRuleParameters struct { + RestrictedFileExtensions []string `json:"restricted_file_extensions"` +} + +// MaxFileSizeRuleParameters represents the max file size rule parameters. +type MaxFileSizeRuleParameters struct { + MaxFileSize int64 `json:"max_file_size"` +} + +// WorkflowsRuleParameters represents the workflows rule parameters. +type WorkflowsRuleParameters struct { + DoNotEnforceOnCreate *bool `json:"do_not_enforce_on_create,omitempty"` + Workflows []*RuleWorkflow `json:"workflows"` +} + +// RuleWorkflow represents a Workflow for the workflows rule parameters. +type RuleWorkflow struct { + Path string `json:"path"` + Ref *string `json:"ref,omitempty"` + RepositoryID *int64 `json:"repository_id,omitempty"` + SHA *string `json:"sha,omitempty"` +} + +// CodeScanningRuleParameters represents the code scanning rule parameters. +type CodeScanningRuleParameters struct { + CodeScanningTools []*RuleCodeScanningTool `json:"code_scanning_tools"` +} + +// RuleCodeScanningTool represents a single code scanning tool for the code scanning parameters. +type RuleCodeScanningTool struct { + AlertsThreshold CodeScanningAlertsThreshold `json:"alerts_threshold"` + SecurityAlertsThreshold CodeScanningSecurityAlertsThreshold `json:"security_alerts_threshold"` + Tool string `json:"tool"` +} + +// repositoryRulesetRuleWrapper is a helper type to marshal & unmarshal a ruleset rule. +type repositoryRulesetRuleWrapper struct { + Type RepositoryRuleType `json:"type"` + Parameters json.RawMessage `json:"parameters,omitempty"` +} + +// MarshalJSON is a custom JSON marshaler for RulesetRules. +func (r *RepositoryRulesetRules) MarshalJSON() ([]byte, error) { + // The RepositoryRulesetRules type marshals to between 1 and 21 rules. + // If new rules are added to RepositoryRulesetRules the capacity below needs increasing + rawRules := make([]json.RawMessage, 0, 21) + + if r.Creation != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeCreation, r.Creation) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.Update != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeUpdate, r.Update) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.Deletion != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeDeletion, r.Deletion) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.RequiredLinearHistory != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeRequiredLinearHistory, r.RequiredLinearHistory) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.MergeQueue != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeMergeQueue, r.MergeQueue) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.RequiredDeployments != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeRequiredDeployments, r.RequiredDeployments) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.RequiredSignatures != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeRequiredSignatures, r.RequiredSignatures) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.PullRequest != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypePullRequest, r.PullRequest) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.RequiredStatusChecks != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeRequiredStatusChecks, r.RequiredStatusChecks) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.NonFastForward != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeNonFastForward, r.NonFastForward) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.CommitMessagePattern != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeCommitMessagePattern, r.CommitMessagePattern) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.CommitAuthorEmailPattern != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeCommitAuthorEmailPattern, r.CommitAuthorEmailPattern) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.CommitterEmailPattern != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeCommitterEmailPattern, r.CommitterEmailPattern) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.BranchNamePattern != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeBranchNamePattern, r.BranchNamePattern) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.TagNamePattern != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeTagNamePattern, r.TagNamePattern) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.FilePathRestriction != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeFilePathRestriction, r.FilePathRestriction) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.MaxFilePathLength != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeMaxFilePathLength, r.MaxFilePathLength) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.FileExtensionRestriction != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeFileExtensionRestriction, r.FileExtensionRestriction) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.MaxFileSize != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeMaxFileSize, r.MaxFileSize) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.Workflows != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeWorkflows, r.Workflows) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + if r.CodeScanning != nil { + bytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeCodeScanning, r.CodeScanning) + if err != nil { + return nil, err + } + rawRules = append(rawRules, json.RawMessage(bytes)) + } + + return json.Marshal(rawRules) +} + +// marshalRepositoryRulesetRule is a helper function to marshal a ruleset rule. +// +// TODO: Benchmark the code that uses reflection. +// TODO: Use a generator here instead of reflection if there is a significant performance hit. +func marshalRepositoryRulesetRule[T any](t RepositoryRuleType, params T) ([]byte, error) { + paramsType := reflect.TypeFor[T]() + + if paramsType.Kind() == reflect.Pointer && (reflect.ValueOf(params).IsNil() || reflect.ValueOf(params).Elem().IsZero()) { + return json.Marshal(repositoryRulesetRuleWrapper{Type: t}) + } + + bytes, err := json.Marshal(params) + if err != nil { + return nil, err + } + + return json.Marshal(repositoryRulesetRuleWrapper{Type: t, Parameters: json.RawMessage(bytes)}) +} + +// UnmarshalJSON is a custom JSON unmarshaler for RulesetRules. +func (r *RepositoryRulesetRules) UnmarshalJSON(data []byte) error { + var wrappers []*repositoryRulesetRuleWrapper + + if err := json.Unmarshal(data, &wrappers); err != nil { + return err + } + + for _, w := range wrappers { + switch w.Type { + case RulesetRuleTypeCreation: + r.Creation = &EmptyRuleParameters{} + case RulesetRuleTypeUpdate: + r.Update = &UpdateRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.Update); err != nil { + return err + } + } + case RulesetRuleTypeDeletion: + r.Deletion = &EmptyRuleParameters{} + case RulesetRuleTypeRequiredLinearHistory: + r.RequiredLinearHistory = &EmptyRuleParameters{} + case RulesetRuleTypeMergeQueue: + r.MergeQueue = &MergeQueueRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.MergeQueue); err != nil { + return err + } + } + case RulesetRuleTypeRequiredDeployments: + r.RequiredDeployments = &RequiredDeploymentsRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.RequiredDeployments); err != nil { + return err + } + } + case RulesetRuleTypeRequiredSignatures: + r.RequiredSignatures = &EmptyRuleParameters{} + case RulesetRuleTypePullRequest: + r.PullRequest = &PullRequestRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.PullRequest); err != nil { + return err + } + } + case RulesetRuleTypeRequiredStatusChecks: + r.RequiredStatusChecks = &RequiredStatusChecksRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.RequiredStatusChecks); err != nil { + return err + } + } + case RulesetRuleTypeNonFastForward: + r.NonFastForward = &EmptyRuleParameters{} + case RulesetRuleTypeCommitMessagePattern: + r.CommitMessagePattern = &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.CommitMessagePattern); err != nil { + return err + } + } + case RulesetRuleTypeCommitAuthorEmailPattern: + r.CommitAuthorEmailPattern = &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.CommitAuthorEmailPattern); err != nil { + return err + } + } + case RulesetRuleTypeCommitterEmailPattern: + r.CommitterEmailPattern = &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.CommitterEmailPattern); err != nil { + return err + } + } + case RulesetRuleTypeBranchNamePattern: + r.BranchNamePattern = &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.BranchNamePattern); err != nil { + return err + } + } + case RulesetRuleTypeTagNamePattern: + r.TagNamePattern = &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.TagNamePattern); err != nil { + return err + } + } + case RulesetRuleTypeFilePathRestriction: + r.FilePathRestriction = &FilePathRestrictionRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.FilePathRestriction); err != nil { + return err + } + } + case RulesetRuleTypeMaxFilePathLength: + r.MaxFilePathLength = &MaxFilePathLengthRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.MaxFilePathLength); err != nil { + return err + } + } + case RulesetRuleTypeFileExtensionRestriction: + r.FileExtensionRestriction = &FileExtensionRestrictionRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.FileExtensionRestriction); err != nil { + return err + } + } + case RulesetRuleTypeMaxFileSize: + r.MaxFileSize = &MaxFileSizeRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.MaxFileSize); err != nil { + return err + } + } + case RulesetRuleTypeWorkflows: + r.Workflows = &WorkflowsRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.Workflows); err != nil { + return err + } + } + case RulesetRuleTypeCodeScanning: + r.CodeScanning = &CodeScanningRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, r.CodeScanning); err != nil { + return err + } + } + } + } + + return nil +} + +// branchRuleWrapper is a helper type to unmarshal a branch rule. +type branchRuleWrapper struct { + Type RepositoryRuleType `json:"type"` + BranchRuleMetadata + Parameters json.RawMessage `json:"parameters,omitempty"` +} + +// UnmarshalJSON is a custom JSON unmarshaler for BranchRules. +func (r *BranchRules) UnmarshalJSON(data []byte) error { + var wrappers []*branchRuleWrapper + + if err := json.Unmarshal(data, &wrappers); err != nil { + return err + } + + for _, w := range wrappers { + switch w.Type { + case RulesetRuleTypeCreation: + r.Creation = append(r.Creation, &BranchRuleMetadata{RulesetSourceType: w.RulesetSourceType, RulesetSource: w.RulesetSource, RulesetID: w.RulesetID}) + case RulesetRuleTypeUpdate: + params := &UpdateRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.Update = append(r.Update, &UpdateBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeDeletion: + r.Deletion = append(r.Deletion, &BranchRuleMetadata{RulesetSourceType: w.RulesetSourceType, RulesetSource: w.RulesetSource, RulesetID: w.RulesetID}) + case RulesetRuleTypeRequiredLinearHistory: + r.RequiredLinearHistory = append(r.RequiredLinearHistory, &BranchRuleMetadata{RulesetSourceType: w.RulesetSourceType, RulesetSource: w.RulesetSource, RulesetID: w.RulesetID}) + case RulesetRuleTypeMergeQueue: + params := &MergeQueueRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.MergeQueue = append(r.MergeQueue, &MergeQueueBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeRequiredDeployments: + params := &RequiredDeploymentsRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.RequiredDeployments = append(r.RequiredDeployments, &RequiredDeploymentsBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeRequiredSignatures: + r.RequiredSignatures = append(r.RequiredSignatures, &BranchRuleMetadata{RulesetSourceType: w.RulesetSourceType, RulesetSource: w.RulesetSource, RulesetID: w.RulesetID}) + case RulesetRuleTypePullRequest: + params := &PullRequestRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.PullRequest = append(r.PullRequest, &PullRequestBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeRequiredStatusChecks: + params := &RequiredStatusChecksRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.RequiredStatusChecks = append(r.RequiredStatusChecks, &RequiredStatusChecksBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeNonFastForward: + r.NonFastForward = append(r.NonFastForward, &BranchRuleMetadata{RulesetSourceType: w.RulesetSourceType, RulesetSource: w.RulesetSource, RulesetID: w.RulesetID}) + case RulesetRuleTypeCommitMessagePattern: + params := &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.CommitMessagePattern = append(r.CommitMessagePattern, &PatternBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeCommitAuthorEmailPattern: + params := &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.CommitAuthorEmailPattern = append(r.CommitAuthorEmailPattern, &PatternBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeCommitterEmailPattern: + params := &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.CommitterEmailPattern = append(r.CommitterEmailPattern, &PatternBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeBranchNamePattern: + params := &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.BranchNamePattern = append(r.BranchNamePattern, &PatternBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeTagNamePattern: + params := &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.TagNamePattern = append(r.TagNamePattern, &PatternBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeFilePathRestriction: + params := &FilePathRestrictionRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.FilePathRestriction = append(r.FilePathRestriction, &FilePathRestrictionBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeMaxFilePathLength: + params := &MaxFilePathLengthRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.MaxFilePathLength = append(r.MaxFilePathLength, &MaxFilePathLengthBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeFileExtensionRestriction: + params := &FileExtensionRestrictionRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.FileExtensionRestriction = append(r.FileExtensionRestriction, &FileExtensionRestrictionBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeMaxFileSize: + params := &MaxFileSizeRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.MaxFileSize = append(r.MaxFileSize, &MaxFileSizeBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeWorkflows: + params := &WorkflowsRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.Workflows = append(r.Workflows, &WorkflowsBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + case RulesetRuleTypeCodeScanning: + params := &CodeScanningRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, params); err != nil { + return err + } + } + + r.CodeScanning = append(r.CodeScanning, &CodeScanningBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params}) + } + } + + return nil +} + +// UnmarshalJSON is a custom JSON unmarshaler for RulesetRule. +func (r *RepositoryRule) UnmarshalJSON(data []byte) error { + w := repositoryRulesetRuleWrapper{} + + if err := json.Unmarshal(data, &w); err != nil { + return err + } + + r.Type = w.Type + + switch r.Type { + case RulesetRuleTypeCreation: + r.Parameters = nil + case RulesetRuleTypeUpdate: + p := &UpdateRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeDeletion: + r.Parameters = nil + case RulesetRuleTypeRequiredLinearHistory: + r.Parameters = nil + case RulesetRuleTypeMergeQueue: + p := &MergeQueueRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeRequiredDeployments: + p := &RequiredDeploymentsRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeRequiredSignatures: + r.Parameters = nil + case RulesetRuleTypePullRequest: + p := &PullRequestRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeRequiredStatusChecks: + p := &RequiredStatusChecksRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeNonFastForward: + r.Parameters = nil + case RulesetRuleTypeCommitMessagePattern: + p := &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeCommitAuthorEmailPattern: + p := &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeCommitterEmailPattern: + p := &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeBranchNamePattern: + p := &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeTagNamePattern: + p := &PatternRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeFilePathRestriction: + p := &FilePathRestrictionRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeMaxFilePathLength: + p := &MaxFilePathLengthRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeFileExtensionRestriction: + p := &FileExtensionRestrictionRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeMaxFileSize: + p := &MaxFileSizeRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeWorkflows: + p := &WorkflowsRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + case RulesetRuleTypeCodeScanning: + p := &CodeScanningRuleParameters{} + + if w.Parameters != nil { + if err := json.Unmarshal(w.Parameters, p); err != nil { + return err + } + } + + r.Parameters = p + } + + return nil +} diff --git a/vendor/github.com/google/go-github/v66/github/scim.go b/vendor/github.com/google/go-github/v74/github/scim.go similarity index 71% rename from vendor/github.com/google/go-github/v66/github/scim.go rename to vendor/github.com/google/go-github/v74/github/scim.go index 4b34c1663c..8b3c1c4ee5 100644 --- a/vendor/github.com/google/go-github/v66/github/scim.go +++ b/vendor/github.com/google/go-github/v74/github/scim.go @@ -17,6 +17,26 @@ import ( // GitHub API docs: https://docs.github.com/rest/scim type SCIMService service +// SCIMGroupAttributes represents supported SCIM Group attributes. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise +type SCIMGroupAttributes struct { + DisplayName *string `json:"displayName,omitempty"` // The name of the group, suitable for display to end-users. (Optional.) + Members []*SCIMDisplayReference `json:"members,omitempty"` // (Optional.) + Schemas []string `json:"schemas,omitempty"` // (Optional.) + ExternalID *string `json:"externalId,omitempty"` // (Optional.) + // Only populated as a result of calling ListSCIMProvisionedIdentitiesOptions: + ID *string `json:"id,omitempty"` + Meta *SCIMMeta `json:"meta,omitempty"` +} + +// SCIMDisplayReference represents a JSON SCIM (System for Cross-domain Identity Management) resource. +type SCIMDisplayReference struct { + Value string `json:"value"` // (Required.) + Ref string `json:"$ref"` // (Required.) + Display *string `json:"display,omitempty"` // (Optional.) +} + // SCIMUserAttributes represents supported SCIM User attributes. // // GitHub API docs: https://docs.github.com/rest/scim#supported-scim-user-attributes @@ -56,6 +76,15 @@ type SCIMMeta struct { Location *string `json:"location,omitempty"` } +// SCIMProvisionedGroups represents the result of calling ListSCIMProvisionedGroupsForEnterprise. +type SCIMProvisionedGroups struct { + Schemas []string `json:"schemas,omitempty"` + TotalResults *int `json:"totalResults,omitempty"` + ItemsPerPage *int `json:"itemsPerPage,omitempty"` + StartIndex *int `json:"startIndex,omitempty"` + Resources []*SCIMGroupAttributes `json:"Resources,omitempty"` +} + // SCIMProvisionedIdentities represents the result of calling ListSCIMProvisionedIdentities. type SCIMProvisionedIdentities struct { Schemas []string `json:"schemas,omitempty"` @@ -79,6 +108,26 @@ type ListSCIMProvisionedIdentitiesOptions struct { Filter *string `url:"filter,omitempty"` } +// ListSCIMProvisionedGroupsForEnterpriseOptions represents options for ListSCIMProvisionedGroupsForEnterprise. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise--parameters +type ListSCIMProvisionedGroupsForEnterpriseOptions struct { + // Filter specifies the matching results to return. + // Multiple filters are not supported. Possible filters are externalId, id, and displayName. + // For example: ?filter=externalId eq "9138790-10932-109120392-12321". + // (Optional.) + Filter *string `url:"filter,omitempty"` + // ExcludedAttributes excludes the specified attribute from being returned in the results. + // Using this parameter can speed up response time. (Optional.) + ExcludedAttributes *string `url:"excludedAttributes,omitempty"` + // StartIndex used for pagination: the starting index of the first result to return when paginating through values. (Optional.) + // Default: 1. + StartIndex *int `url:"startIndex,omitempty"` + // Count used for pagination: the number of results to return per page. (Optional.) + // Default: 30. + Count *int `url:"count,omitempty"` +} + // ListSCIMProvisionedIdentities lists SCIM provisioned identities. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#list-scim-provisioned-identities @@ -217,3 +266,29 @@ func (s *SCIMService) DeleteSCIMUserFromOrg(ctx context.Context, org, scimUserID return s.client.Do(ctx, req, nil) } + +// ListSCIMProvisionedGroupsForEnterprise lists SCIM provisioned groups for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise +// +//meta:operation GET /scim/v2/enterprises/{enterprise}/Groups +func (s *SCIMService) ListSCIMProvisionedGroupsForEnterprise(ctx context.Context, enterprise string, opts *ListSCIMProvisionedGroupsForEnterpriseOptions) (*SCIMProvisionedGroups, *Response, error) { + u := fmt.Sprintf("scim/v2/enterprises/%v/Groups", enterprise) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + groups := new(SCIMProvisionedGroups) + resp, err := s.client.Do(ctx, req, groups) + if err != nil { + return nil, resp, err + } + + return groups, resp, nil +} diff --git a/vendor/github.com/google/go-github/v66/github/search.go b/vendor/github.com/google/go-github/v74/github/search.go similarity index 98% rename from vendor/github.com/google/go-github/v66/github/search.go rename to vendor/github.com/google/go-github/v74/github/search.go index 54bc6d5e1f..71b5ae51e9 100644 --- a/vendor/github.com/google/go-github/v66/github/search.go +++ b/vendor/github.com/google/go-github/v74/github/search.go @@ -300,7 +300,7 @@ func (s *SearchService) Labels(ctx context.Context, repoID int64, query string, // // If searchParameters.Query includes multiple condition, it MUST NOT include "+" as condition separator. // For example, querying with "language:c++" and "leveldb", then searchParameters.Query should be "language:c++ leveldb" but not "language:c+++leveldb". -func (s *SearchService) search(ctx context.Context, searchType string, parameters *searchParameters, opts *SearchOptions, result interface{}) (*Response, error) { +func (s *SearchService) search(ctx context.Context, searchType string, parameters *searchParameters, opts *SearchOptions, result any) (*Response, error) { params, err := qs.Values(opts) if err != nil { return nil, err @@ -317,20 +317,20 @@ func (s *SearchService) search(ctx context.Context, searchType string, parameter return nil, err } var acceptHeaders []string - switch { - case searchType == "commits": + switch searchType { + case "commits": // Accept header for search commits preview endpoint // TODO: remove custom Accept header when this API fully launches. acceptHeaders = append(acceptHeaders, mediaTypeCommitSearchPreview) - case searchType == "topics": + case "topics": // Accept header for search repositories based on topics preview endpoint // TODO: remove custom Accept header when this API fully launches. acceptHeaders = append(acceptHeaders, mediaTypeTopicsPreview) - case searchType == "repositories": + case "repositories": // Accept header for search repositories based on topics preview endpoint // TODO: remove custom Accept header when this API fully launches. acceptHeaders = append(acceptHeaders, mediaTypeTopicsPreview) - case searchType == "issues": + case "issues": // Accept header for search issues based on reactions preview endpoint // TODO: remove custom Accept header when this API fully launches. acceptHeaders = append(acceptHeaders, mediaTypeReactionsPreview) diff --git a/vendor/github.com/google/go-github/v66/github/secret_scanning.go b/vendor/github.com/google/go-github/v74/github/secret_scanning.go similarity index 69% rename from vendor/github.com/google/go-github/v66/github/secret_scanning.go rename to vendor/github.com/google/go-github/v74/github/secret_scanning.go index 9b2ad8cd0d..ad2312d0b2 100644 --- a/vendor/github.com/google/go-github/v66/github/secret_scanning.go +++ b/vendor/github.com/google/go-github/v74/github/secret_scanning.go @@ -16,24 +16,32 @@ type SecretScanningService service // SecretScanningAlert represents a GitHub secret scanning alert. type SecretScanningAlert struct { - Number *int `json:"number,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - LocationsURL *string `json:"locations_url,omitempty"` - State *string `json:"state,omitempty"` - Resolution *string `json:"resolution,omitempty"` - ResolvedAt *Timestamp `json:"resolved_at,omitempty"` - ResolvedBy *User `json:"resolved_by,omitempty"` - SecretType *string `json:"secret_type,omitempty"` - SecretTypeDisplayName *string `json:"secret_type_display_name,omitempty"` - Secret *string `json:"secret,omitempty"` - Repository *Repository `json:"repository,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - PushProtectionBypassed *bool `json:"push_protection_bypassed,omitempty"` - PushProtectionBypassedBy *User `json:"push_protection_bypassed_by,omitempty"` - PushProtectionBypassedAt *Timestamp `json:"push_protection_bypassed_at,omitempty"` - ResolutionComment *string `json:"resolution_comment,omitempty"` + Number *int `json:"number,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + LocationsURL *string `json:"locations_url,omitempty"` + State *string `json:"state,omitempty"` + Resolution *string `json:"resolution,omitempty"` + ResolvedAt *Timestamp `json:"resolved_at,omitempty"` + ResolvedBy *User `json:"resolved_by,omitempty"` + SecretType *string `json:"secret_type,omitempty"` + SecretTypeDisplayName *string `json:"secret_type_display_name,omitempty"` + Secret *string `json:"secret,omitempty"` + Repository *Repository `json:"repository,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + IsBase64Encoded *bool `json:"is_base64_encoded,omitempty"` + MultiRepo *bool `json:"multi_repo,omitempty"` + PubliclyLeaked *bool `json:"publicly_leaked,omitempty"` + PushProtectionBypassed *bool `json:"push_protection_bypassed,omitempty"` + PushProtectionBypassedBy *User `json:"push_protection_bypassed_by,omitempty"` + PushProtectionBypassedAt *Timestamp `json:"push_protection_bypassed_at,omitempty"` + ResolutionComment *string `json:"resolution_comment,omitempty"` + PushProtectionBypassRequestComment *string `json:"push_protection_bypass_request_comment,omitempty"` + PushProtectionBypassRequestHTMLURL *string `json:"push_protection_bypass_request_html_url,omitempty"` + PushProtectionBypassRequestReviewer *User `json:"push_protection_bypass_request_reviewer,omitempty"` + PushProtectionBypassRequestReviewerComment *string `json:"push_protection_bypass_request_reviewer_comment,omitempty"` + Validity *string `json:"validity,omitempty"` } // SecretScanningAlertLocation represents the location for a secret scanning alert. @@ -44,15 +52,16 @@ type SecretScanningAlertLocation struct { // SecretScanningAlertLocationDetails represents the location details for a secret scanning alert. type SecretScanningAlertLocationDetails struct { - Path *string `json:"path,omitempty"` - Startline *int `json:"start_line,omitempty"` - EndLine *int `json:"end_line,omitempty"` - StartColumn *int `json:"start_column,omitempty"` - EndColumn *int `json:"end_column,omitempty"` - BlobSHA *string `json:"blob_sha,omitempty"` - BlobURL *string `json:"blob_url,omitempty"` - CommitSHA *string `json:"commit_sha,omitempty"` - CommitURL *string `json:"commit_url,omitempty"` + Path *string `json:"path,omitempty"` + Startline *int `json:"start_line,omitempty"` + EndLine *int `json:"end_line,omitempty"` + StartColumn *int `json:"start_column,omitempty"` + EndColumn *int `json:"end_column,omitempty"` + BlobSHA *string `json:"blob_sha,omitempty"` + BlobURL *string `json:"blob_url,omitempty"` + CommitSHA *string `json:"commit_sha,omitempty"` + CommitURL *string `json:"commit_url,omitempty"` + PullRequestCommentURL *string `json:"pull_request_comment_url,omitempty"` } // SecretScanningAlertListOptions specifies optional parameters to the SecretScanningService.ListAlertsForEnterprise method. @@ -67,6 +76,22 @@ type SecretScanningAlertListOptions struct { // Valid resolutions are false_positive, wont_fix, revoked, pattern_edited, pattern_deleted or used_in_tests. Resolution string `url:"resolution,omitempty"` + // A comma-separated list of validities that, when present, will return alerts that match the validities in this list. + // Valid options are active, inactive, and unknown. + Validity string `url:"validity,omitempty"` + + // A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. Default: false. + IsPubliclyLeaked bool `url:"is_publicly_leaked,omitempty"` + + // A boolean value representing whether or not to filter alerts by the multi-repo tag being present. Default: false. + IsMultiRepo bool `url:"is_multi_repo,omitempty"` + + // The direction to sort the results by. Possible values are: asc, desc. Default: desc. + Direction string `url:"direction,omitempty"` + + // The property by which to sort the results. Possible values are: created, updated. Default: created. + Sort string `url:"sort,omitempty"` + ListCursorOptions // List options can vary on the Enterprise type. @@ -88,6 +113,9 @@ type SecretScanningAlertUpdateOptions struct { // Required when the state is "resolved" and represents the reason for resolving the alert. // Can be one of: "false_positive", "wont_fix", "revoked", or "used_in_tests". Resolution *string `json:"resolution,omitempty"` + + // An optional comment when closing an alert. + ResolutionComment *string `json:"resolution_comment,omitempty"` } // ListAlertsForEnterprise lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest. diff --git a/vendor/github.com/google/go-github/v66/github/security_advisories.go b/vendor/github.com/google/go-github/v74/github/security_advisories.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/security_advisories.go rename to vendor/github.com/google/go-github/v74/github/security_advisories.go diff --git a/vendor/github.com/google/go-github/v66/github/strings.go b/vendor/github.com/google/go-github/v74/github/strings.go similarity index 97% rename from vendor/github.com/google/go-github/v66/github/strings.go rename to vendor/github.com/google/go-github/v74/github/strings.go index f5e61aa326..46fd55ad14 100644 --- a/vendor/github.com/google/go-github/v66/github/strings.go +++ b/vendor/github.com/google/go-github/v74/github/strings.go @@ -16,7 +16,7 @@ var timestampType = reflect.TypeOf(Timestamp{}) // Stringify attempts to create a reasonable string representation of types in // the GitHub library. It does things like resolve pointers to their values // and omits struct fields with nil values. -func Stringify(message interface{}) string { +func Stringify(message any) string { var buf bytes.Buffer v := reflect.ValueOf(message) stringifyValue(&buf, v) diff --git a/vendor/github.com/google/go-github/v74/github/sub_issue.go b/vendor/github.com/google/go-github/v74/github/sub_issue.go new file mode 100644 index 0000000000..2effcc5afb --- /dev/null +++ b/vendor/github.com/google/go-github/v74/github/sub_issue.go @@ -0,0 +1,140 @@ +// Copyright 2025 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// SubIssueService handles communication with the sub-issue related +// methods of the GitHub API. +// +// Sub-issues help you group and manage your issues with a parent/child relationship. +// +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues +type SubIssueService service + +// SubIssue represents a GitHub sub-issue on a repository. +// Note: As far as the GitHub API is concerned, every pull request is an issue, +// but not every issue is a pull request. Some endpoints, events, and webhooks +// may also return pull requests via this struct. If PullRequestLinks is nil, +// this is an issue, and if PullRequestLinks is not nil, this is a pull request. +// The IsPullRequest helper method can be used to check that. +type SubIssue Issue + +func (i SubIssue) String() string { + return Stringify(i) +} + +// SubIssueListByIssueOptions specifies the optional parameters to the +// SubIssueService.ListByIssue method. +type SubIssueListByIssueOptions struct { + IssueListByRepoOptions +} + +// SubIssueRequest represents a request to add, remove, or reprioritize sub-issues. +type SubIssueRequest struct { + SubIssueID int64 `json:"sub_issue_id"` // Required: The ID of the sub-issue + AfterID *int64 `json:"after_id,omitempty"` // Optional: Position after this sub-issue ID + BeforeID *int64 `json:"before_id,omitempty"` // Optional: Position before this sub-issue ID + ReplaceParent *bool `json:"replace_parent,omitempty"` // Optional: Whether to replace the existing parent +} + +// Remove a sub-issue from the specified repository. +// +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#remove-sub-issue +// +//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue +func (s *SubIssueService) Remove(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issue", owner, repo, issueNumber) + + req, err := s.client.NewRequest("DELETE", u, subIssue) + if err != nil { + return nil, nil, err + } + + si := new(SubIssue) + resp, err := s.client.Do(ctx, req, si) + if err != nil { + return nil, resp, err + } + + return si, resp, nil +} + +// ListByIssue lists all sub-issues for the specified issue. +// +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#list-sub-issues +// +//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues +func (s *SubIssueService) ListByIssue(ctx context.Context, owner, repo string, issueNumber int64, opts *IssueListOptions) ([]*SubIssue, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issues", owner, repo, issueNumber) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var subIssues []*SubIssue + resp, err := s.client.Do(ctx, req, &subIssues) + if err != nil { + return nil, resp, err + } + + return subIssues, resp, nil +} + +// Add adds a sub-issue to the specified issue. +// +// The sub-issue to be added must belong to the same repository owner as the parent issue. +// To replace the existing parent of a sub-issue, set replaceParent to true. +// +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#add-sub-issue +// +//meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues +func (s *SubIssueService) Add(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issues", owner, repo, issueNumber) + req, err := s.client.NewRequest("POST", u, subIssue) + if err != nil { + return nil, nil, err + } + + si := new(SubIssue) + resp, err := s.client.Do(ctx, req, si) + if err != nil { + return nil, resp, err + } + + return si, resp, nil +} + +// Reprioritize changes a sub-issue's priority to a different position in the parent list. +// +// Either afterId or beforeId must be specified to determine the new position of the sub-issue. +// +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#reprioritize-sub-issue +// +//meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority +func (s *SubIssueService) Reprioritize(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issues/priority", owner, repo, issueNumber) + req, err := s.client.NewRequest("PATCH", u, subIssue) + if err != nil { + return nil, nil, err + } + + si := new(SubIssue) + resp, err := s.client.Do(ctx, req, si) + if err != nil { + return nil, resp, err + } + + return si, resp, nil +} diff --git a/vendor/github.com/google/go-github/v66/github/teams.go b/vendor/github.com/google/go-github/v74/github/teams.go similarity index 96% rename from vendor/github.com/google/go-github/v66/github/teams.go rename to vendor/github.com/google/go-github/v74/github/teams.go index df248b6540..d334110f4a 100644 --- a/vendor/github.com/google/go-github/v66/github/teams.go +++ b/vendor/github.com/google/go-github/v74/github/teams.go @@ -30,10 +30,6 @@ type Team struct { // Permission specifies the default permission for repositories owned by the team. Permission *string `json:"permission,omitempty"` - // Permissions identifies the permissions that a team has on a given - // repository. This is only populated when calling Repositories.ListTeams. - Permissions map[string]bool `json:"permissions,omitempty"` - // Privacy identifies the level of privacy this team should have. // Possible values are: // secret - only visible to organization owners and members of this team @@ -41,6 +37,9 @@ type Team struct { // Default is "secret". Privacy *string `json:"privacy,omitempty"` + // NotificationSetting can be one of: "notifications_enabled", "notifications_disabled". + NotificationSetting *string `json:"notification_setting,omitempty"` + MembersCount *int `json:"members_count,omitempty"` ReposCount *int `json:"repos_count,omitempty"` Organization *Organization `json:"organization,omitempty"` @@ -52,6 +51,15 @@ type Team struct { // LDAPDN is only available in GitHub Enterprise and when the team // membership is synchronized with LDAP. LDAPDN *string `json:"ldap_dn,omitempty"` + + // Permissions identifies the permissions that a team has on a given + // repository. This is only populated when calling Repositories.ListTeams. + Permissions map[string]bool `json:"permissions,omitempty"` + + // Assignment identifies how a team was assigned to an organization role. Its + // possible values are: "direct", "indirect", "mixed". This is only populated when + // calling the ListTeamsAssignedToOrgRole method. + Assignment *string `json:"assignment,omitempty"` } func (t Team) String() string { @@ -106,6 +114,8 @@ func (s *TeamsService) ListTeams(ctx context.Context, org string, opts *ListOpti // GetTeamByID fetches a team, given a specified organization ID, by ID. // +// Deprecated: Use GetTeamBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#get-a-team-by-name // //meta:operation GET /orgs/{org}/teams/{team_slug} @@ -232,6 +242,8 @@ func copyNewTeamWithoutParent(team *NewTeam) *newTeamNoParent { // EditTeamByID edits a team, given an organization ID, selected by ID. // +// Deprecated: Use EditTeamBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#update-a-team // //meta:operation PATCH /orgs/{org}/teams/{team_slug} @@ -290,6 +302,8 @@ func (s *TeamsService) EditTeamBySlug(ctx context.Context, org, slug string, tea // DeleteTeamByID deletes a team referenced by ID. // +// Deprecated: Use DeleteTeamBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#delete-a-team // //meta:operation DELETE /orgs/{org}/teams/{team_slug} @@ -320,6 +334,8 @@ func (s *TeamsService) DeleteTeamBySlug(ctx context.Context, org, slug string) ( // ListChildTeamsByParentID lists child teams for a parent team given parent ID. // +// Deprecated: Use ListChildTeamsByParentSlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#list-child-teams // //meta:operation GET /orgs/{org}/teams/{team_slug}/teams @@ -372,6 +388,8 @@ func (s *TeamsService) ListChildTeamsByParentSlug(ctx context.Context, org, slug // ListTeamReposByID lists the repositories given a team ID that the specified team has access to. // +// Deprecated: Use ListTeamReposBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-repositories // //meta:operation GET /orgs/{org}/teams/{team_slug}/repos @@ -432,6 +450,8 @@ func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string // repository is managed by team, a Repository is returned which includes the // permissions team has for that repo. // +// Deprecated: Use IsTeamRepoBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository // //meta:operation GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} @@ -497,6 +517,8 @@ type TeamAddTeamRepoOptions struct { // The specified repository must be owned by the organization to which the team // belongs, or a direct fork of a repository owned by the organization. // +// Deprecated: Use AddTeamRepoBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions // //meta:operation PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} @@ -531,6 +553,8 @@ func (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner, // team given the team ID. Note that this does not delete the repository, it // just removes it from the team. // +// Deprecated: Use RemoveTeamRepoBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team // //meta:operation DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo} @@ -589,10 +613,12 @@ func (s *TeamsService) ListUserTeams(ctx context.Context, opts *ListOptions) ([] // ListTeamProjectsByID lists the organization projects for a team given the team ID. // +// Deprecated: Use ListTeamProjectsBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-projects // //meta:operation GET /orgs/{org}/teams/{team_slug}/projects -func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID int64) ([]*Project, *Response, error) { +func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID int64) ([]*ProjectV2, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects", orgID, teamID) req, err := s.client.NewRequest("GET", u, nil) @@ -603,7 +629,7 @@ func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID i // TODO: remove custom Accept header when this API fully launches. req.Header.Set("Accept", mediaTypeProjectsPreview) - var projects []*Project + var projects []*ProjectV2 resp, err := s.client.Do(ctx, req, &projects) if err != nil { return nil, resp, err @@ -617,7 +643,7 @@ func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID i // GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-projects // //meta:operation GET /orgs/{org}/teams/{team_slug}/projects -func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug string) ([]*Project, *Response, error) { +func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug string) ([]*ProjectV2, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects", org, slug) req, err := s.client.NewRequest("GET", u, nil) @@ -628,7 +654,7 @@ func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug str // TODO: remove custom Accept header when this API fully launches. req.Header.Set("Accept", mediaTypeProjectsPreview) - var projects []*Project + var projects []*ProjectV2 resp, err := s.client.Do(ctx, req, &projects) if err != nil { return nil, resp, err @@ -640,10 +666,12 @@ func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug str // ReviewTeamProjectsByID checks whether a team, given its ID, has read, write, or admin // permissions for an organization project. // +// Deprecated: Use ReviewTeamProjectsBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project // //meta:operation GET /orgs/{org}/teams/{team_slug}/projects/{project_id} -func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID, projectID int64) (*Project, *Response, error) { +func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID, projectID int64) (*ProjectV2, *Response, error) { u := fmt.Sprintf("organizations/%v/team/%v/projects/%v", orgID, teamID, projectID) req, err := s.client.NewRequest("GET", u, nil) if err != nil { @@ -653,7 +681,7 @@ func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID // TODO: remove custom Accept header when this API fully launches. req.Header.Set("Accept", mediaTypeProjectsPreview) - projects := &Project{} + projects := &ProjectV2{} resp, err := s.client.Do(ctx, req, &projects) if err != nil { return nil, resp, err @@ -668,7 +696,7 @@ func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID // GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project // //meta:operation GET /orgs/{org}/teams/{team_slug}/projects/{project_id} -func (s *TeamsService) ReviewTeamProjectsBySlug(ctx context.Context, org, slug string, projectID int64) (*Project, *Response, error) { +func (s *TeamsService) ReviewTeamProjectsBySlug(ctx context.Context, org, slug string, projectID int64) (*ProjectV2, *Response, error) { u := fmt.Sprintf("orgs/%v/teams/%v/projects/%v", org, slug, projectID) req, err := s.client.NewRequest("GET", u, nil) if err != nil { @@ -678,7 +706,7 @@ func (s *TeamsService) ReviewTeamProjectsBySlug(ctx context.Context, org, slug s // TODO: remove custom Accept header when this API fully launches. req.Header.Set("Accept", mediaTypeProjectsPreview) - projects := &Project{} + projects := &ProjectV2{} resp, err := s.client.Do(ctx, req, &projects) if err != nil { return nil, resp, err @@ -703,6 +731,8 @@ type TeamProjectOptions struct { // To add a project to a team or update the team's permission on a project, the // authenticated user must have admin permissions for the project. // +// Deprecated: Use AddTeamProjectBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions // //meta:operation PUT /orgs/{org}/teams/{team_slug}/projects/{project_id} @@ -746,6 +776,8 @@ func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug strin // or project. // Note: This endpoint removes the project from the team, but does not delete it. // +// Deprecated: Use RemoveTeamProjectBySlug instead. +// // GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team // //meta:operation DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id} @@ -834,6 +866,8 @@ func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org stri // ListIDPGroupsForTeamByID lists IDP groups connected to a team on GitHub // given organization and team IDs. // +// Deprecated: Use ListIDPGroupsForTeamBySlug instead. +// // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-a-team // //meta:operation GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings @@ -880,6 +914,8 @@ func (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug // CreateOrUpdateIDPGroupConnectionsByID creates, updates, or removes a connection // between a team and an IDP group given organization and team IDs. // +// Deprecated: Use CreateOrUpdateIDPGroupConnectionsBySlug instead. +// // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#create-or-update-idp-group-connections // //meta:operation PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings diff --git a/vendor/github.com/google/go-github/v66/github/teams_discussion_comments.go b/vendor/github.com/google/go-github/v74/github/teams_discussion_comments.go similarity index 99% rename from vendor/github.com/google/go-github/v66/github/teams_discussion_comments.go rename to vendor/github.com/google/go-github/v74/github/teams_discussion_comments.go index eba6fdf46a..70bcbbc95b 100644 --- a/vendor/github.com/google/go-github/v66/github/teams_discussion_comments.go +++ b/vendor/github.com/google/go-github/v74/github/teams_discussion_comments.go @@ -167,8 +167,8 @@ func (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int6 // GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment // //meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments -func (s *TeamsService) CreateCommentBySlug(ctx context.Context, org, slug string, discsusionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { - u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments", org, slug, discsusionNumber) +func (s *TeamsService) CreateCommentBySlug(ctx context.Context, org, slug string, discussionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/discussions/%v/comments", org, slug, discussionNumber) req, err := s.client.NewRequest("POST", u, comment) if err != nil { return nil, nil, err diff --git a/vendor/github.com/google/go-github/v66/github/teams_discussions.go b/vendor/github.com/google/go-github/v74/github/teams_discussions.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/teams_discussions.go rename to vendor/github.com/google/go-github/v74/github/teams_discussions.go diff --git a/vendor/github.com/google/go-github/v66/github/teams_members.go b/vendor/github.com/google/go-github/v74/github/teams_members.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/teams_members.go rename to vendor/github.com/google/go-github/v74/github/teams_members.go diff --git a/vendor/github.com/google/go-github/v66/github/timestamp.go b/vendor/github.com/google/go-github/v74/github/timestamp.go similarity index 94% rename from vendor/github.com/google/go-github/v66/github/timestamp.go rename to vendor/github.com/google/go-github/v74/github/timestamp.go index dc1045cf74..71660193bb 100644 --- a/vendor/github.com/google/go-github/v66/github/timestamp.go +++ b/vendor/github.com/google/go-github/v74/github/timestamp.go @@ -10,7 +10,7 @@ import ( "time" ) -// Timestamp represents a time that can be unmarshalled from a JSON string +// Timestamp represents a time that can be unmarshaled from a JSON string // formatted as either an RFC3339 or Unix timestamp. This is necessary for some // fields since the GitHub API is inconsistent in how it represents times. All // exported methods of time.Time can be called on Timestamp. diff --git a/vendor/github.com/google/go-github/v66/github/users.go b/vendor/github.com/google/go-github/v74/github/users.go similarity index 95% rename from vendor/github.com/google/go-github/v66/github/users.go rename to vendor/github.com/google/go-github/v74/github/users.go index c1ab555247..28db59c5e1 100644 --- a/vendor/github.com/google/go-github/v66/github/users.go +++ b/vendor/github.com/google/go-github/v74/github/users.go @@ -70,6 +70,14 @@ type User struct { // repository. These are only populated when calling Repositories.ListCollaborators. Permissions map[string]bool `json:"permissions,omitempty"` RoleName *string `json:"role_name,omitempty"` + + // Assignment identifies how a user was assigned to an organization role. Its + // possible values are: "direct", "indirect", "mixed". This is only populated when + // calling the ListUsersAssignedToOrgRole method. + Assignment *string `json:"assignment,omitempty"` + // InheritedFrom identifies the team that a user inherited their organization role + // from. This is only populated when calling the ListUsersAssignedToOrgRole method. + InheritedFrom []*Team `json:"inherited_from,omitempty"` } func (u User) String() string { diff --git a/vendor/github.com/google/go-github/v66/github/users_administration.go b/vendor/github.com/google/go-github/v74/github/users_administration.go similarity index 91% rename from vendor/github.com/google/go-github/v66/github/users_administration.go rename to vendor/github.com/google/go-github/v74/github/users_administration.go index 6b74da5fe8..5d0d4c15e7 100644 --- a/vendor/github.com/google/go-github/v66/github/users_administration.go +++ b/vendor/github.com/google/go-github/v74/github/users_administration.go @@ -12,7 +12,7 @@ import ( // PromoteSiteAdmin promotes a user to a site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator // //meta:operation PUT /users/{username}/site_admin func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Response, error) { @@ -28,7 +28,7 @@ func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Resp // DemoteSiteAdmin demotes a user from site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#demote-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#demote-a-site-administrator // //meta:operation DELETE /users/{username}/site_admin func (s *UsersService) DemoteSiteAdmin(ctx context.Context, user string) (*Response, error) { @@ -49,7 +49,7 @@ type UserSuspendOptions struct { // Suspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#suspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#suspend-a-user // //meta:operation PUT /users/{username}/suspended func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspendOptions) (*Response, error) { @@ -65,7 +65,7 @@ func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspe // Unsuspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#unsuspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/users#unsuspend-a-user // //meta:operation DELETE /users/{username}/suspended func (s *UsersService) Unsuspend(ctx context.Context, user string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v66/github/users_attestations.go b/vendor/github.com/google/go-github/v74/github/users_attestations.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/users_attestations.go rename to vendor/github.com/google/go-github/v74/github/users_attestations.go diff --git a/vendor/github.com/google/go-github/v66/github/users_blocking.go b/vendor/github.com/google/go-github/v74/github/users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/users_blocking.go rename to vendor/github.com/google/go-github/v74/github/users_blocking.go diff --git a/vendor/github.com/google/go-github/v66/github/users_emails.go b/vendor/github.com/google/go-github/v74/github/users_emails.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/users_emails.go rename to vendor/github.com/google/go-github/v74/github/users_emails.go diff --git a/vendor/github.com/google/go-github/v66/github/users_followers.go b/vendor/github.com/google/go-github/v74/github/users_followers.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/users_followers.go rename to vendor/github.com/google/go-github/v74/github/users_followers.go diff --git a/vendor/github.com/google/go-github/v66/github/users_gpg_keys.go b/vendor/github.com/google/go-github/v74/github/users_gpg_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/users_gpg_keys.go rename to vendor/github.com/google/go-github/v74/github/users_gpg_keys.go diff --git a/vendor/github.com/google/go-github/v66/github/users_keys.go b/vendor/github.com/google/go-github/v74/github/users_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/users_keys.go rename to vendor/github.com/google/go-github/v74/github/users_keys.go diff --git a/vendor/github.com/google/go-github/v66/github/users_packages.go b/vendor/github.com/google/go-github/v74/github/users_packages.go similarity index 98% rename from vendor/github.com/google/go-github/v66/github/users_packages.go rename to vendor/github.com/google/go-github/v74/github/users_packages.go index 3ccf68a169..b813dd9d14 100644 --- a/vendor/github.com/google/go-github/v66/github/users_packages.go +++ b/vendor/github.com/google/go-github/v74/github/users_packages.go @@ -8,6 +8,7 @@ package github import ( "context" "fmt" + "net/url" ) // ListPackages lists the packages for a user. Passing the empty string for "user" will @@ -55,9 +56,9 @@ func (s *UsersService) ListPackages(ctx context.Context, user string, opts *Pack func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packageName string) (*Package, *Response, error) { var u string if user != "" { - u = fmt.Sprintf("users/%v/packages/%v/%v", user, packageType, packageName) + u = fmt.Sprintf("users/%v/packages/%v/%v", user, packageType, url.PathEscape(packageName)) } else { - u = fmt.Sprintf("user/packages/%v/%v", packageType, packageName) + u = fmt.Sprintf("user/packages/%v/%v", packageType, url.PathEscape(packageName)) } req, err := s.client.NewRequest("GET", u, nil) diff --git a/vendor/github.com/google/go-github/v66/github/users_ssh_signing_keys.go b/vendor/github.com/google/go-github/v74/github/users_ssh_signing_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/users_ssh_signing_keys.go rename to vendor/github.com/google/go-github/v74/github/users_ssh_signing_keys.go diff --git a/vendor/github.com/google/go-github/v66/github/with_appengine.go b/vendor/github.com/google/go-github/v74/github/with_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/with_appengine.go rename to vendor/github.com/google/go-github/v74/github/with_appengine.go diff --git a/vendor/github.com/google/go-github/v66/github/without_appengine.go b/vendor/github.com/google/go-github/v74/github/without_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v66/github/without_appengine.go rename to vendor/github.com/google/go-github/v74/github/without_appengine.go diff --git a/vendor/modules.txt b/vendor/modules.txt index 6822c15117..8af695ec5a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -433,16 +433,16 @@ github.com/golangci/revgrep # github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed ## explicit; go 1.20 github.com/golangci/unconvert -# github.com/google/go-cmp v0.6.0 -## explicit; go 1.13 +# github.com/google/go-cmp v0.7.0 +## explicit; go 1.21 github.com/google/go-cmp/cmp github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags github.com/google/go-cmp/cmp/internal/function github.com/google/go-cmp/cmp/internal/value -# github.com/google/go-github/v66 v66.0.1-0.20241027130611-9e5757d5a766 -## explicit; go 1.21 -github.com/google/go-github/v66/github +# github.com/google/go-github/v74 v74.0.0 +## explicit; go 1.23.0 +github.com/google/go-github/v74/github # github.com/google/go-querystring v1.1.0 ## explicit; go 1.10 github.com/google/go-querystring/query