From 8927341466988de37a3036b56b14741fc01b7851 Mon Sep 17 00:00:00 2001 From: Francois BAYART Date: Fri, 18 Dec 2020 18:42:28 +0100 Subject: [PATCH] Added `allowsDeletions`and `allowsForcePushes`settings (#623) * Added `allowsDeletions`and `allowsForcePushes`settings https://developer.github.com/v4/changelog/2020-11-13-schema-changes/ (#1) * complete documentation * update module github.com/shurcooL/githubv4 with `go get github.com/shurcooL/githubv4` * vendor latest githubv4 * add test for deletions and force pushes Co-authored-by: Jeremy Udit --- github/resource_github_branch_protection.go | 24 + .../resource_github_branch_protection_test.go | 59 ++ github/util_v4_branch_protection.go | 12 + github/util_v4_consts.go | 2 + go.mod | 4 +- go.sum | 2 + vendor/github.com/shurcooL/githubv4/README.md | 21 +- vendor/github.com/shurcooL/githubv4/doc.go | 5 +- vendor/github.com/shurcooL/githubv4/enum.go | 430 ++++++++------ vendor/github.com/shurcooL/githubv4/input.go | 552 ++++++++++++++---- vendor/modules.txt | 2 +- .../docs/r/branch_protection.html.markdown | 7 +- 12 files changed, 837 insertions(+), 283 deletions(-) diff --git a/github/resource_github_branch_protection.go b/github/resource_github_branch_protection.go index d9f7849b5b..b98dddea1c 100644 --- a/github/resource_github_branch_protection.go +++ b/github/resource_github_branch_protection.go @@ -28,6 +28,16 @@ func resourceGithubBranchProtection() *schema.Resource { Required: true, Description: "", }, + PROTECTION_ALLOWS_DELETIONS: { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + PROTECTION_ALLOWS_FORCE_PUSHES: { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, PROTECTION_IS_ADMIN_ENFORCED: { Type: schema.TypeBool, Optional: true, @@ -122,6 +132,8 @@ func resourceGithubBranchProtectionCreate(d *schema.ResourceData, meta interface return err } input := githubv4.CreateBranchProtectionRuleInput{ + AllowsDeletions: githubv4.NewBoolean(githubv4.Boolean(data.AllowsDeletions)), + AllowsForcePushes: githubv4.NewBoolean(githubv4.Boolean(data.AllowsForcePushes)), DismissesStaleReviews: githubv4.NewBoolean(githubv4.Boolean(data.DismissesStaleReviews)), IsAdminEnforced: githubv4.NewBoolean(githubv4.Boolean(data.IsAdminEnforced)), Pattern: githubv4.String(data.Pattern), @@ -181,6 +193,16 @@ func resourceGithubBranchProtectionRead(d *schema.ResourceData, meta interface{} log.Printf("[WARN] Problem setting '%s' in %s %s branch protection (%s)", PROTECTION_PATTERN, protection.Repository.Name, protection.Pattern, d.Id()) } + err = d.Set(PROTECTION_ALLOWS_DELETIONS, protection.AllowsDeletions) + if err != nil { + log.Printf("[WARN] Problem setting '%s' in %s %s branch protection (%s)", PROTECTION_ALLOWS_DELETIONS, protection.Repository.Name, protection.Pattern, d.Id()) + } + + err = d.Set(PROTECTION_ALLOWS_FORCE_PUSHES, protection.AllowsForcePushes) + if err != nil { + log.Printf("[WARN] Problem setting '%s' in %s %s branch protection (%s)", PROTECTION_ALLOWS_FORCE_PUSHES, protection.Repository.Name, protection.Pattern, d.Id()) + } + err = d.Set(PROTECTION_IS_ADMIN_ENFORCED, protection.IsAdminEnforced) if err != nil { log.Printf("[WARN] Problem setting '%s' in %s %s branch protection (%s)", PROTECTION_IS_ADMIN_ENFORCED, protection.Repository.Name, protection.Pattern, d.Id()) @@ -226,6 +248,8 @@ func resourceGithubBranchProtectionUpdate(d *schema.ResourceData, meta interface } input := githubv4.UpdateBranchProtectionRuleInput{ BranchProtectionRuleID: d.Id(), + AllowsDeletions: githubv4.NewBoolean(githubv4.Boolean(data.AllowsDeletions)), + AllowsForcePushes: githubv4.NewBoolean(githubv4.Boolean(data.AllowsForcePushes)), DismissesStaleReviews: githubv4.NewBoolean(githubv4.Boolean(data.DismissesStaleReviews)), IsAdminEnforced: githubv4.NewBoolean(githubv4.Boolean(data.IsAdminEnforced)), Pattern: githubv4.NewString(githubv4.String(data.Pattern)), diff --git a/github/resource_github_branch_protection_test.go b/github/resource_github_branch_protection_test.go index 7309b1f45c..f6cbc1ed29 100644 --- a/github/resource_github_branch_protection_test.go +++ b/github/resource_github_branch_protection_test.go @@ -261,6 +261,65 @@ func TestAccGithubBranchProtection(t *testing.T) { }) }) + + t.Run("configures force pushes and deletions", func(t *testing.T) { + + config := fmt.Sprintf(` + resource "github_repository" "test" { + name = "tf-acc-test-%s" + auto_init = true + } + + data "github_user" "test" { + username = "%s" + } + + resource "github_branch_protection" "test" { + + repository_id = github_repository.test.name + pattern = "main" + allows_deletions = true + allows_force_pushes = true + + } + `, randomID, testOwnerFunc()) + + check := resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr( + "github_branch_protection.test", "allows_deletions", "true", + ), + resource.TestCheckResourceAttr( + "github_branch_protection.test", "allows_force_pushes", "true", + ), + ) + + testCase := func(t *testing.T, mode string) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { skipUnlessMode(t, mode) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: config, + Check: check, + }, + }, + }) + } + + t.Run("with an anonymous account", func(t *testing.T) { + t.Skip("anonymous account not supported for this operation") + }) + + t.Run("with an individual account", func(t *testing.T) { + t.Skip("individual account not supported for this operation") + }) + + t.Run("with an organization account", func(t *testing.T) { + testCase(t, organization) + }) + + }) + } func branchProtectionImportStateIdFunc(repo, pattern string) resource.ImportStateIdFunc { diff --git a/github/util_v4_branch_protection.go b/github/util_v4_branch_protection.go index 93bb593585..ad2587098b 100644 --- a/github/util_v4_branch_protection.go +++ b/github/util_v4_branch_protection.go @@ -39,6 +39,8 @@ type BranchProtectionRule struct { ReviewDismissalAllowances struct { Nodes []DismissalActorTypes } `graphql:"reviewDismissalAllowances(first: 100)"` + AllowsDeletions githubv4.Boolean + AllowsForcePushes githubv4.Boolean DismissesStaleReviews githubv4.Boolean ID githubv4.ID IsAdminEnforced githubv4.Boolean @@ -55,6 +57,8 @@ type BranchProtectionRule struct { } type BranchProtectionResourceData struct { + AllowsDeletions bool + AllowsForcePushes bool BranchProtectionRuleID string DismissesStaleReviews bool IsAdminEnforced bool @@ -88,6 +92,14 @@ func branchProtectionResourceData(d *schema.ResourceData, meta interface{}) (Bra data.Pattern = v.(string) } + if v, ok := d.GetOk(PROTECTION_ALLOWS_DELETIONS); ok { + data.AllowsDeletions = v.(bool) + } + + if v, ok := d.GetOk(PROTECTION_ALLOWS_FORCE_PUSHES); ok { + data.AllowsForcePushes = v.(bool) + } + if v, ok := d.GetOk(PROTECTION_IS_ADMIN_ENFORCED); ok { data.IsAdminEnforced = v.(bool) } diff --git a/github/util_v4_consts.go b/github/util_v4_consts.go index adfe74585c..fc8a967b2f 100644 --- a/github/util_v4_consts.go +++ b/github/util_v4_consts.go @@ -1,6 +1,8 @@ package github const ( + PROTECTION_ALLOWS_DELETIONS = "allows_deletions" + PROTECTION_ALLOWS_FORCE_PUSHES = "allows_force_pushes" PROTECTION_DISMISSES_STALE_REVIEWS = "dismiss_stale_reviews" PROTECTION_IS_ADMIN_ENFORCED = "enforce_admins" PROTECTION_PATTERN = "pattern" diff --git a/go.mod b/go.mod index 7598170951..39d945478e 100644 --- a/go.mod +++ b/go.mod @@ -5,12 +5,12 @@ go 1.13 require ( github.com/client9/misspell v0.3.4 github.com/golangci/golangci-lint v1.25.1 - github.com/google/go-github/v31 v31.0.0 + github.com/google/go-github/v31 v31.0.0 // indirect github.com/google/go-github/v32 v32.1.0 github.com/hashicorp/terraform v0.12.24 github.com/hashicorp/terraform-plugin-sdk v1.7.0 github.com/kylelemons/godebug v1.1.0 // indirect - github.com/shurcooL/githubv4 v0.0.0-20191127044304-8f68eb5628d0 + github.com/shurcooL/githubv4 v0.0.0-20201206200315-234843c633fa github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f // indirect golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d diff --git a/go.sum b/go.sum index 0c7bf1d69d..97533d08f2 100644 --- a/go.sum +++ b/go.sum @@ -480,6 +480,8 @@ github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lz github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= github.com/shurcooL/githubv4 v0.0.0-20191127044304-8f68eb5628d0 h1:T9uus1QvcPgeLShS30YOnnzk3r9Vvygp45muhlrufgY= github.com/shurcooL/githubv4 v0.0.0-20191127044304-8f68eb5628d0/go.mod h1:hAF0iLZy4td2EX+/8Tw+4nodhlMrwN3HupfaXj3zkGo= +github.com/shurcooL/githubv4 v0.0.0-20201206200315-234843c633fa h1:jozR3igKlnYCj9IVHOVump59bp07oIRoLQ/CcjMYIUA= +github.com/shurcooL/githubv4 v0.0.0-20201206200315-234843c633fa/go.mod h1:hAF0iLZy4td2EX+/8Tw+4nodhlMrwN3HupfaXj3zkGo= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e h1:MZM7FHLqUHYI0Y/mQAt3d2aYa0SiNms/hFqC9qJYolM= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041 h1:llrF3Fs4018ePo4+G/HV/uQUqEI1HMDjCeOf2V6puPc= diff --git a/vendor/github.com/shurcooL/githubv4/README.md b/vendor/github.com/shurcooL/githubv4/README.md index 319a6428ab..8516d3bdc0 100644 --- a/vendor/github.com/shurcooL/githubv4/README.md +++ b/vendor/github.com/shurcooL/githubv4/README.md @@ -3,12 +3,10 @@ githubv4 [![Build Status](https://travis-ci.org/shurcooL/githubv4.svg?branch=master)](https://travis-ci.org/shurcooL/githubv4) [![GoDoc](https://godoc.org/github.com/shurcooL/githubv4?status.svg)](https://godoc.org/github.com/shurcooL/githubv4) -Package `githubv4` is a client library for accessing GitHub GraphQL API v4 (https://developer.github.com/v4/). +Package `githubv4` is a client library for accessing GitHub GraphQL API v4 (https://docs.github.com/en/graphql). If you're looking for a client library for GitHub REST API v3, the recommended package is [`github.com/google/go-github/github`](https://godoc.org/github.com/google/go-github/github). -**Status:** In research and development. The API will change when opportunities for improvement are discovered; it is not yet frozen. - Focus ----- @@ -30,7 +28,7 @@ Usage ### Authentication -GitHub GraphQL API v4 [requires authentication](https://developer.github.com/v4/guides/forming-calls/#authenticating-with-graphql). The `githubv4` package does not directly handle authentication. Instead, when creating a new client, you're expected to pass an `http.Client` that performs authentication. The easiest and recommended way to do this is to use the [`golang.org/x/oauth2`](https://golang.org/x/oauth2) package. You'll need an OAuth token from GitHub (for example, a [personal API token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)) with the right scopes. Then: +GitHub GraphQL API v4 [requires authentication](https://docs.github.com/en/graphql/guides/forming-calls-with-graphql#authenticating-with-graphql). The `githubv4` package does not directly handle authentication. Instead, when creating a new client, you're expected to pass an `http.Client` that performs authentication. The easiest and recommended way to do this is to use the [`golang.org/x/oauth2`](https://golang.org/x/oauth2) package. You'll need an OAuth token from GitHub (for example, a [personal API token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)) with the right scopes. Then: ```Go import "golang.org/x/oauth2" @@ -46,9 +44,16 @@ func main() { } ``` +If you are using GitHub Enterprise, use [`githubv4.NewEnterpriseClient`](https://godoc.org/github.com/shurcooL/githubv4#NewEnterpriseClient): + +```Go +client := githubv4.NewEnterpriseClient(os.Getenv("GITHUB_ENDPOINT"), httpClient) +// Use client... +``` + ### Simple Query -To make a query, you need to define a Go type that corresponds to the GitHub GraphQL schema, and contains the fields you're interested in querying. You can look up the GitHub GraphQL schema at https://developer.github.com/v4/query/. +To make a query, you need to define a Go type that corresponds to the GitHub GraphQL schema, and contains the fields you're interested in querying. You can look up the GitHub GraphQL schema at https://docs.github.com/en/graphql/reference/queries. For example, to make the following GraphQL query: @@ -89,7 +94,7 @@ fmt.Println("CreatedAt:", query.Viewer.CreatedAt) ### Scalar Types -For each scalar in the GitHub GraphQL schema listed at https://developer.github.com/v4/scalar/, there is a corresponding Go type in package `githubv4`. +For each scalar in the GitHub GraphQL schema listed at https://docs.github.com/en/graphql/reference/scalars, there is a corresponding Go type in package `githubv4`. You can use these types when writing queries: @@ -127,7 +132,7 @@ var query struct { // Call client.Query() and use results in query... ``` -The [`DateTime`](https://developer.github.com/v4/scalar/datetime/) scalar is described as "an ISO-8601 encoded UTC date string". If you wanted to fetch in that form without parsing it into a `time.Time`, you can use the `string` type. For example, this would work: +The [`DateTime`](https://docs.github.com/en/graphql/reference/scalars#datetime) scalar is described as "an ISO-8601 encoded UTC date string". If you wanted to fetch in that form without parsing it into a `time.Time`, you can use the `string` type. For example, this would work: ```Go // import "html/template" @@ -336,7 +341,7 @@ for { } ``` -There is more than one way to perform pagination. Consider additional fields inside [`PageInfo`](https://developer.github.com/v4/object/pageinfo/) object. +There is more than one way to perform pagination. Consider additional fields inside [`PageInfo`](https://docs.github.com/en/graphql/reference/objects#pageinfo) object. ### Mutations diff --git a/vendor/github.com/shurcooL/githubv4/doc.go b/vendor/github.com/shurcooL/githubv4/doc.go index 0ce1a508a8..74fddc50ef 100644 --- a/vendor/github.com/shurcooL/githubv4/doc.go +++ b/vendor/github.com/shurcooL/githubv4/doc.go @@ -1,12 +1,9 @@ // Package githubv4 is a client library for accessing GitHub -// GraphQL API v4 (https://developer.github.com/v4/). +// GraphQL API v4 (https://docs.github.com/en/graphql). // // If you're looking for a client library for GitHub REST API v3, // the recommended package is github.com/google/go-github/github. // -// Status: In active early research and development. The API will change when -// opportunities for improvement are discovered; it is not yet frozen. -// // For now, see README for more details. package githubv4 // import "github.com/shurcooL/githubv4" diff --git a/vendor/github.com/shurcooL/githubv4/enum.go b/vendor/github.com/shurcooL/githubv4/enum.go index 46fbeb0da1..c8674a99cf 100644 --- a/vendor/github.com/shurcooL/githubv4/enum.go +++ b/vendor/github.com/shurcooL/githubv4/enum.go @@ -2,17 +2,6 @@ package githubv4 -// ActionExecutionCapabilitySetting represents the possible capabilities for action executions setting. -type ActionExecutionCapabilitySetting string - -// The possible capabilities for action executions setting. -const ( - ActionExecutionCapabilitySettingDisabled ActionExecutionCapabilitySetting = "DISABLED" // All action executions are disabled. - ActionExecutionCapabilitySettingAllActions ActionExecutionCapabilitySetting = "ALL_ACTIONS" // All action executions are enabled. - ActionExecutionCapabilitySettingLocalActionsOnly ActionExecutionCapabilitySetting = "LOCAL_ACTIONS_ONLY" // Only actions defined within the repo are allowed. - ActionExecutionCapabilitySettingNoPolicy ActionExecutionCapabilitySetting = "NO_POLICY" // Organization administrators action execution capabilities. -) - // AuditLogOrderField represents properties by which Audit Log connections can be ordered. type AuditLogOrderField string @@ -21,6 +10,52 @@ const ( AuditLogOrderFieldCreatedAt AuditLogOrderField = "CREATED_AT" // Order audit log entries by timestamp. ) +// CheckAnnotationLevel represents represents an annotation's information level. +type CheckAnnotationLevel string + +// Represents an annotation's information level. +const ( + CheckAnnotationLevelFailure CheckAnnotationLevel = "FAILURE" // An annotation indicating an inescapable error. + CheckAnnotationLevelNotice CheckAnnotationLevel = "NOTICE" // An annotation indicating some information. + CheckAnnotationLevelWarning CheckAnnotationLevel = "WARNING" // An annotation indicating an ignorable error. +) + +// CheckConclusionState represents the possible states for a check suite or run conclusion. +type CheckConclusionState string + +// The possible states for a check suite or run conclusion. +const ( + CheckConclusionStateActionRequired CheckConclusionState = "ACTION_REQUIRED" // The check suite or run requires action. + CheckConclusionStateTimedOut CheckConclusionState = "TIMED_OUT" // The check suite or run has timed out. + CheckConclusionStateCancelled CheckConclusionState = "CANCELLED" // The check suite or run has been cancelled. + CheckConclusionStateFailure CheckConclusionState = "FAILURE" // The check suite or run has failed. + CheckConclusionStateSuccess CheckConclusionState = "SUCCESS" // The check suite or run has succeeded. + CheckConclusionStateNeutral CheckConclusionState = "NEUTRAL" // The check suite or run was neutral. + CheckConclusionStateSkipped CheckConclusionState = "SKIPPED" // The check suite or run was skipped. + CheckConclusionStateStartupFailure CheckConclusionState = "STARTUP_FAILURE" // The check suite or run has failed at startup. + CheckConclusionStateStale CheckConclusionState = "STALE" // The check suite or run was marked stale by GitHub. Only GitHub can use this conclusion. +) + +// CheckRunType represents the possible types of check runs. +type CheckRunType string + +// The possible types of check runs. +const ( + CheckRunTypeAll CheckRunType = "ALL" // Every check run available. + CheckRunTypeLatest CheckRunType = "LATEST" // The latest check run. +) + +// CheckStatusState represents the possible states for a check suite or run status. +type CheckStatusState string + +// The possible states for a check suite or run status. +const ( + CheckStatusStateQueued CheckStatusState = "QUEUED" // The check suite or run has been queued. + CheckStatusStateInProgress CheckStatusState = "IN_PROGRESS" // The check suite or run is in progress. + CheckStatusStateCompleted CheckStatusState = "COMPLETED" // The check suite or run has been completed. + CheckStatusStateRequested CheckStatusState = "REQUESTED" // The check suite or run has been requested. +) + // CollaboratorAffiliation represents collaborators affiliation level with a subject. type CollaboratorAffiliation string @@ -38,6 +73,7 @@ type CommentAuthorAssociation string const ( CommentAuthorAssociationMember CommentAuthorAssociation = "MEMBER" // Author is a member of the organization that owns the repository. CommentAuthorAssociationOwner CommentAuthorAssociation = "OWNER" // Author is the owner of the repository. + CommentAuthorAssociationMannequin CommentAuthorAssociation = "MANNEQUIN" // Author is a placeholder for an unclaimed user. CommentAuthorAssociationCollaborator CommentAuthorAssociation = "COLLABORATOR" // Author has been invited to collaborate on the repository. CommentAuthorAssociationContributor CommentAuthorAssociation = "CONTRIBUTOR" // Author has previously committed to the repository. CommentAuthorAssociationFirstTimeContributor CommentAuthorAssociation = "FIRST_TIME_CONTRIBUTOR" // Author has not previously committed to the repository. @@ -68,14 +104,6 @@ const ( CommitContributionOrderFieldCommitCount CommitContributionOrderField = "COMMIT_COUNT" // Order commit contributions by how many commits they represent. ) -// ContributionOrderField represents properties by which contribution connections can be ordered. -type ContributionOrderField string - -// Properties by which contribution connections can be ordered. -const ( - ContributionOrderFieldOccurredAt ContributionOrderField = "OCCURRED_AT" // Order contributions by when they were made. -) - // DefaultRepositoryPermissionField represents the possible default permissions for repositories. type DefaultRepositoryPermissionField string @@ -109,6 +137,7 @@ const ( DeploymentStatePending DeploymentState = "PENDING" // The deployment is pending. DeploymentStateQueued DeploymentState = "QUEUED" // The deployment has queued. DeploymentStateInProgress DeploymentState = "IN_PROGRESS" // The deployment is in progress. + DeploymentStateWaiting DeploymentState = "WAITING" // The deployment is waiting. ) // DeploymentStatusState represents the possible states for a deployment status. @@ -125,6 +154,15 @@ const ( DeploymentStatusStateInProgress DeploymentStatusState = "IN_PROGRESS" // The deployment is in progress. ) +// DiffSide represents the possible sides of a diff. +type DiffSide string + +// The possible sides of a diff. +const ( + DiffSideLeft DiffSide = "LEFT" // The left side of the diff. + DiffSideRight DiffSide = "RIGHT" // The right side of the diff. +) + // EnterpriseAdministratorInvitationOrderField represents properties by which enterprise administrator invitation connections can be ordered. type EnterpriseAdministratorInvitationOrderField string @@ -203,25 +241,6 @@ const ( EnterpriseMembersCanMakePurchasesSettingValueDisabled EnterpriseMembersCanMakePurchasesSettingValue = "DISABLED" // The setting is disabled for organizations in the enterprise. ) -// EnterpriseMembershipType represents the possible values we have for filtering Platform::Objects::User#enterprises. -type EnterpriseMembershipType string - -// The possible values we have for filtering Platform::Objects::User#enterprises. -const ( - EnterpriseMembershipTypeAll EnterpriseMembershipType = "ALL" // Returns all enterprises in which the user is a member, admin, or billing manager. - EnterpriseMembershipTypeAdmin EnterpriseMembershipType = "ADMIN" // Returns all enterprises in which the user is an admin. - EnterpriseMembershipTypeBillingManager EnterpriseMembershipType = "BILLING_MANAGER" // Returns all enterprises in which the user is a billing manager. - EnterpriseMembershipTypeOrgMembership EnterpriseMembershipType = "ORG_MEMBERSHIP" // Returns all enterprises in which the user is a member of an org that is owned by the enterprise. -) - -// EnterpriseOrderField represents properties by which enterprise connections can be ordered. -type EnterpriseOrderField string - -// Properties by which enterprise connections can be ordered. -const ( - EnterpriseOrderFieldName EnterpriseOrderField = "NAME" // Order enterprises by name. -) - // EnterpriseServerInstallationOrderField represents properties by which Enterprise Server installation connections can be ordered. type EnterpriseServerInstallationOrderField string @@ -285,6 +304,16 @@ const ( EnterpriseUserDeploymentServer EnterpriseUserDeployment = "SERVER" // The user is part of a GitHub Enterprise Server deployment. ) +// FileViewedState represents the possible viewed states of a file . +type FileViewedState string + +// The possible viewed states of a file . +const ( + FileViewedStateDismissed FileViewedState = "DISMISSED" // The file has new changes since last viewed. + FileViewedStateViewed FileViewedState = "VIEWED" // The file has been marked as viewed. + FileViewedStateUnviewed FileViewedState = "UNVIEWED" // The file has not been marked as viewed. +) + // FundingPlatform represents the possible funding platforms for repository funding links. type FundingPlatform string @@ -356,6 +385,32 @@ const ( IdentityProviderConfigurationStateUnconfigured IdentityProviderConfigurationState = "UNCONFIGURED" // Authentication with an identity provider is not configured. ) +// IpAllowListEnabledSettingValue represents the possible values for the IP allow list enabled setting. +type IpAllowListEnabledSettingValue string + +// The possible values for the IP allow list enabled setting. +const ( + IpAllowListEnabledSettingValueEnabled IpAllowListEnabledSettingValue = "ENABLED" // The setting is enabled for the owner. + IpAllowListEnabledSettingValueDisabled IpAllowListEnabledSettingValue = "DISABLED" // The setting is disabled for the owner. +) + +// IpAllowListEntryOrderField represents properties by which IP allow list entry connections can be ordered. +type IpAllowListEntryOrderField string + +// Properties by which IP allow list entry connections can be ordered. +const ( + IpAllowListEntryOrderFieldCreatedAt IpAllowListEntryOrderField = "CREATED_AT" // Order IP allow list entries by creation time. + IpAllowListEntryOrderFieldAllowListValue IpAllowListEntryOrderField = "ALLOW_LIST_VALUE" // Order IP allow list entries by the allow list value. +) + +// IssueCommentOrderField represents properties by which issue comment connections can be ordered. +type IssueCommentOrderField string + +// Properties by which issue comment connections can be ordered. +const ( + IssueCommentOrderFieldUpdatedAt IssueCommentOrderField = "UPDATED_AT" // Order issue comments by update time. +) + // IssueOrderField represents properties by which issue connections can be ordered. type IssueOrderField string @@ -366,17 +421,6 @@ const ( IssueOrderFieldComments IssueOrderField = "COMMENTS" // Order issues by comment count. ) -// IssuePubSubTopic represents the possible PubSub channels for an issue. -type IssuePubSubTopic string - -// The possible PubSub channels for an issue. -const ( - IssuePubSubTopicUpdated IssuePubSubTopic = "UPDATED" // The channel ID for observing issue updates. - IssuePubSubTopicMarkasread IssuePubSubTopic = "MARKASREAD" // The channel ID for marking an issue as read. - IssuePubSubTopicTimeline IssuePubSubTopic = "TIMELINE" // The channel ID for updating items on the issue timeline. - IssuePubSubTopicState IssuePubSubTopic = "STATE" // The channel ID for observing issue state updates. -) - // IssueState represents the possible states of an issue. type IssueState string @@ -397,8 +441,10 @@ const ( IssueTimelineItemsItemTypeAssignedEvent IssueTimelineItemsItemType = "ASSIGNED_EVENT" // Represents an 'assigned' event on any assignable object. IssueTimelineItemsItemTypeClosedEvent IssueTimelineItemsItemType = "CLOSED_EVENT" // Represents a 'closed' event on any `Closable`. IssueTimelineItemsItemTypeCommentDeletedEvent IssueTimelineItemsItemType = "COMMENT_DELETED_EVENT" // Represents a 'comment_deleted' event on a given issue or pull request. + IssueTimelineItemsItemTypeConnectedEvent IssueTimelineItemsItemType = "CONNECTED_EVENT" // Represents a 'connected' event on a given issue or pull request. IssueTimelineItemsItemTypeConvertedNoteToIssueEvent IssueTimelineItemsItemType = "CONVERTED_NOTE_TO_ISSUE_EVENT" // Represents a 'converted_note_to_issue' event on a given issue or pull request. IssueTimelineItemsItemTypeDemilestonedEvent IssueTimelineItemsItemType = "DEMILESTONED_EVENT" // Represents a 'demilestoned' event on a given issue or pull request. + IssueTimelineItemsItemTypeDisconnectedEvent IssueTimelineItemsItemType = "DISCONNECTED_EVENT" // Represents a 'disconnected' event on a given issue or pull request. IssueTimelineItemsItemTypeLabeledEvent IssueTimelineItemsItemType = "LABELED_EVENT" // Represents a 'labeled' event on a given issue or pull request. IssueTimelineItemsItemTypeLockedEvent IssueTimelineItemsItemType = "LOCKED_EVENT" // Represents a 'locked' event on a given issue or pull request. IssueTimelineItemsItemTypeMarkedAsDuplicateEvent IssueTimelineItemsItemType = "MARKED_AS_DUPLICATE_EVENT" // Represents a 'marked_as_duplicate' event on a given issue or pull request. @@ -416,10 +462,20 @@ const ( IssueTimelineItemsItemTypeUnlabeledEvent IssueTimelineItemsItemType = "UNLABELED_EVENT" // Represents an 'unlabeled' event on a given issue or pull request. IssueTimelineItemsItemTypeUnlockedEvent IssueTimelineItemsItemType = "UNLOCKED_EVENT" // Represents an 'unlocked' event on a given issue or pull request. IssueTimelineItemsItemTypeUserBlockedEvent IssueTimelineItemsItemType = "USER_BLOCKED_EVENT" // Represents a 'user_blocked' event on a given user. + IssueTimelineItemsItemTypeUnmarkedAsDuplicateEvent IssueTimelineItemsItemType = "UNMARKED_AS_DUPLICATE_EVENT" // Represents an 'unmarked_as_duplicate' event on a given issue or pull request. IssueTimelineItemsItemTypeUnpinnedEvent IssueTimelineItemsItemType = "UNPINNED_EVENT" // Represents an 'unpinned' event on a given issue or pull request. IssueTimelineItemsItemTypeUnsubscribedEvent IssueTimelineItemsItemType = "UNSUBSCRIBED_EVENT" // Represents an 'unsubscribed' event on a given `Subscribable`. ) +// LabelOrderField represents properties by which label connections can be ordered. +type LabelOrderField string + +// Properties by which label connections can be ordered. +const ( + LabelOrderFieldName LabelOrderField = "NAME" // Order labels by name. + LabelOrderFieldCreatedAt LabelOrderField = "CREATED_AT" // Order labels by creation time. +) + // LanguageOrderField represents properties by which language connections can be ordered. type LanguageOrderField string @@ -479,16 +535,6 @@ const ( OauthApplicationCreateAuditEntryStatePendingDeletion OauthApplicationCreateAuditEntryState = "PENDING_DELETION" // The OAuth Application was in the process of being deleted. ) -// OauthApplicationRevokeTokensAuditEntryState represents the state of an OAuth Application when its tokens were revoked. -type OauthApplicationRevokeTokensAuditEntryState string - -// The state of an OAuth Application when its tokens were revoked. -const ( - OauthApplicationRevokeTokensAuditEntryStateActive OauthApplicationRevokeTokensAuditEntryState = "ACTIVE" // The OAuth Application was active and allowed to have OAuth Accesses. - OauthApplicationRevokeTokensAuditEntryStateSuspended OauthApplicationRevokeTokensAuditEntryState = "SUSPENDED" // The OAuth Application was suspended from generating OAuth Accesses due to abuse or security concerns. - OauthApplicationRevokeTokensAuditEntryStatePendingDeletion OauthApplicationRevokeTokensAuditEntryState = "PENDING_DELETION" // The OAuth Application was in the process of being deleted. -) - // OperationType represents the corresponding operation type for the action. type OperationType string @@ -563,6 +609,8 @@ const ( OrgRemoveMemberAuditEntryReasonTwoFactorRequirementNonCompliance OrgRemoveMemberAuditEntryReason = "TWO_FACTOR_REQUIREMENT_NON_COMPLIANCE" // The organization required 2FA of its billing managers and this user did not have 2FA enabled. OrgRemoveMemberAuditEntryReasonSamlExternalIdentityMissing OrgRemoveMemberAuditEntryReason = "SAML_EXTERNAL_IDENTITY_MISSING" // SAML external identity missing. OrgRemoveMemberAuditEntryReasonSamlSsoEnforcementRequiresExternalIdentity OrgRemoveMemberAuditEntryReason = "SAML_SSO_ENFORCEMENT_REQUIRES_EXTERNAL_IDENTITY" // SAML SSO enforcement requires an external identity. + OrgRemoveMemberAuditEntryReasonUserAccountDeleted OrgRemoveMemberAuditEntryReason = "USER_ACCOUNT_DELETED" // User account has been deleted. + OrgRemoveMemberAuditEntryReasonTwoFactorAccountRecovery OrgRemoveMemberAuditEntryReason = "TWO_FACTOR_ACCOUNT_RECOVERY" // User was removed from organization during account recovery. ) // OrgRemoveOutsideCollaboratorAuditEntryMembershipType represents the type of membership a user has with an Organization. @@ -609,8 +657,14 @@ type OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibility string // The permissions available for repository creation on an Organization. const ( - OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibilityAll OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibility = "ALL" // All organization members are restricted from creating any repositories. - OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibilityPublic OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibility = "PUBLIC" // All organization members are restricted from creating public repositories. + OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibilityAll OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibility = "ALL" // All organization members are restricted from creating any repositories. + OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibilityPublic OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibility = "PUBLIC" // All organization members are restricted from creating public repositories. + OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibilityNone OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibility = "NONE" // All organization members are allowed to create any repositories. + OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibilityPrivate OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibility = "PRIVATE" // All organization members are restricted from creating private repositories. + OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibilityInternal OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibility = "INTERNAL" // All organization members are restricted from creating internal repositories. + OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibilityPublicInternal OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibility = "PUBLIC_INTERNAL" // All organization members are restricted from creating public or internal repositories. + OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibilityPrivateInternal OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibility = "PRIVATE_INTERNAL" // All organization members are restricted from creating private or internal repositories. + OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibilityPublicPrivate OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibility = "PUBLIC_PRIVATE" // All organization members are restricted from creating public or private repositories. ) // OrganizationInvitationRole represents the possible organization invitation roles. @@ -661,6 +715,44 @@ const ( OrganizationOrderFieldLogin OrganizationOrderField = "LOGIN" // Order organizations by login. ) +// PackageFileOrderField represents properties by which package file connections can be ordered. +type PackageFileOrderField string + +// Properties by which package file connections can be ordered. +const ( + PackageFileOrderFieldCreatedAt PackageFileOrderField = "CREATED_AT" // Order package files by creation time. +) + +// PackageOrderField represents properties by which package connections can be ordered. +type PackageOrderField string + +// Properties by which package connections can be ordered. +const ( + PackageOrderFieldCreatedAt PackageOrderField = "CREATED_AT" // Order packages by creation time. +) + +// PackageType represents the possible types of a package. +type PackageType string + +// The possible types of a package. +const ( + PackageTypeNpm PackageType = "NPM" // An npm package. + PackageTypeRubygems PackageType = "RUBYGEMS" // A rubygems package. + PackageTypeMaven PackageType = "MAVEN" // A maven package. + PackageTypeDocker PackageType = "DOCKER" // A docker image. + PackageTypeDebian PackageType = "DEBIAN" // A debian package. + PackageTypeNuget PackageType = "NUGET" // A nuget package. + PackageTypePypi PackageType = "PYPI" // A python package. +) + +// PackageVersionOrderField represents properties by which package version connections can be ordered. +type PackageVersionOrderField string + +// Properties by which package version connections can be ordered. +const ( + PackageVersionOrderFieldCreatedAt PackageVersionOrderField = "CREATED_AT" // Order package versions by creation time. +) + // PinnableItemType represents represents items that can be pinned to a profile page or dashboard. type PinnableItemType string @@ -754,18 +846,6 @@ const ( PullRequestOrderFieldUpdatedAt PullRequestOrderField = "UPDATED_AT" // Order pull_requests by update time. ) -// PullRequestPubSubTopic represents the possible PubSub channels for a pull request. -type PullRequestPubSubTopic string - -// The possible PubSub channels for a pull request. -const ( - PullRequestPubSubTopicUpdated PullRequestPubSubTopic = "UPDATED" // The channel ID for observing pull request updates. - PullRequestPubSubTopicMarkasread PullRequestPubSubTopic = "MARKASREAD" // The channel ID for marking an pull request as read. - PullRequestPubSubTopicHeadRef PullRequestPubSubTopic = "HEAD_REF" // The channel ID for observing head ref updates. - PullRequestPubSubTopicTimeline PullRequestPubSubTopic = "TIMELINE" // The channel ID for updating items on the pull request timeline. - PullRequestPubSubTopicState PullRequestPubSubTopic = "STATE" // The channel ID for observing pull request state updates. -) - // PullRequestReviewCommentState represents the possible states of a pull request review comment. type PullRequestReviewCommentState string @@ -775,6 +855,16 @@ const ( PullRequestReviewCommentStateSubmitted PullRequestReviewCommentState = "SUBMITTED" // A comment that is part of a submitted review. ) +// PullRequestReviewDecision represents the review status of a pull request. +type PullRequestReviewDecision string + +// The review status of a pull request. +const ( + PullRequestReviewDecisionChangesRequested PullRequestReviewDecision = "CHANGES_REQUESTED" // Changes have been requested on the pull request. + PullRequestReviewDecisionApproved PullRequestReviewDecision = "APPROVED" // The pull request has received an approving review. + PullRequestReviewDecisionReviewRequired PullRequestReviewDecision = "REVIEW_REQUIRED" // A review is required before the pull request can be merged. +) + // PullRequestReviewEvent represents the possible events to perform on a pull request review. type PullRequestReviewEvent string @@ -813,50 +903,57 @@ type PullRequestTimelineItemsItemType string // The possible item types found in a timeline. const ( - PullRequestTimelineItemsItemTypePullRequestCommit PullRequestTimelineItemsItemType = "PULL_REQUEST_COMMIT" // Represents a Git commit part of a pull request. - PullRequestTimelineItemsItemTypePullRequestCommitCommentThread PullRequestTimelineItemsItemType = "PULL_REQUEST_COMMIT_COMMENT_THREAD" // Represents a commit comment thread part of a pull request. - PullRequestTimelineItemsItemTypePullRequestReview PullRequestTimelineItemsItemType = "PULL_REQUEST_REVIEW" // A review object for a given pull request. - PullRequestTimelineItemsItemTypePullRequestReviewThread PullRequestTimelineItemsItemType = "PULL_REQUEST_REVIEW_THREAD" // A threaded list of comments for a given pull request. - PullRequestTimelineItemsItemTypePullRequestRevisionMarker PullRequestTimelineItemsItemType = "PULL_REQUEST_REVISION_MARKER" // Represents the latest point in the pull request timeline for which the viewer has seen the pull request's commits. - PullRequestTimelineItemsItemTypeBaseRefChangedEvent PullRequestTimelineItemsItemType = "BASE_REF_CHANGED_EVENT" // Represents a 'base_ref_changed' event on a given issue or pull request. - PullRequestTimelineItemsItemTypeBaseRefForcePushedEvent PullRequestTimelineItemsItemType = "BASE_REF_FORCE_PUSHED_EVENT" // Represents a 'base_ref_force_pushed' event on a given pull request. - PullRequestTimelineItemsItemTypeDeployedEvent PullRequestTimelineItemsItemType = "DEPLOYED_EVENT" // Represents a 'deployed' event on a given pull request. - PullRequestTimelineItemsItemTypeDeploymentEnvironmentChangedEvent PullRequestTimelineItemsItemType = "DEPLOYMENT_ENVIRONMENT_CHANGED_EVENT" // Represents a 'deployment_environment_changed' event on a given pull request. - PullRequestTimelineItemsItemTypeHeadRefDeletedEvent PullRequestTimelineItemsItemType = "HEAD_REF_DELETED_EVENT" // Represents a 'head_ref_deleted' event on a given pull request. - PullRequestTimelineItemsItemTypeHeadRefForcePushedEvent PullRequestTimelineItemsItemType = "HEAD_REF_FORCE_PUSHED_EVENT" // Represents a 'head_ref_force_pushed' event on a given pull request. - PullRequestTimelineItemsItemTypeHeadRefRestoredEvent PullRequestTimelineItemsItemType = "HEAD_REF_RESTORED_EVENT" // Represents a 'head_ref_restored' event on a given pull request. - PullRequestTimelineItemsItemTypeMergedEvent PullRequestTimelineItemsItemType = "MERGED_EVENT" // Represents a 'merged' event on a given pull request. - PullRequestTimelineItemsItemTypeReviewDismissedEvent PullRequestTimelineItemsItemType = "REVIEW_DISMISSED_EVENT" // Represents a 'review_dismissed' event on a given issue or pull request. - PullRequestTimelineItemsItemTypeReviewRequestedEvent PullRequestTimelineItemsItemType = "REVIEW_REQUESTED_EVENT" // Represents an 'review_requested' event on a given pull request. - PullRequestTimelineItemsItemTypeReviewRequestRemovedEvent PullRequestTimelineItemsItemType = "REVIEW_REQUEST_REMOVED_EVENT" // Represents an 'review_request_removed' event on a given pull request. - PullRequestTimelineItemsItemTypeReadyForReviewEvent PullRequestTimelineItemsItemType = "READY_FOR_REVIEW_EVENT" // Represents a 'ready_for_review' event on a given pull request. - PullRequestTimelineItemsItemTypeIssueComment PullRequestTimelineItemsItemType = "ISSUE_COMMENT" // Represents a comment on an Issue. - PullRequestTimelineItemsItemTypeCrossReferencedEvent PullRequestTimelineItemsItemType = "CROSS_REFERENCED_EVENT" // Represents a mention made by one issue or pull request to another. - PullRequestTimelineItemsItemTypeAddedToProjectEvent PullRequestTimelineItemsItemType = "ADDED_TO_PROJECT_EVENT" // Represents a 'added_to_project' event on a given issue or pull request. - PullRequestTimelineItemsItemTypeAssignedEvent PullRequestTimelineItemsItemType = "ASSIGNED_EVENT" // Represents an 'assigned' event on any assignable object. - PullRequestTimelineItemsItemTypeClosedEvent PullRequestTimelineItemsItemType = "CLOSED_EVENT" // Represents a 'closed' event on any `Closable`. - PullRequestTimelineItemsItemTypeCommentDeletedEvent PullRequestTimelineItemsItemType = "COMMENT_DELETED_EVENT" // Represents a 'comment_deleted' event on a given issue or pull request. - PullRequestTimelineItemsItemTypeConvertedNoteToIssueEvent PullRequestTimelineItemsItemType = "CONVERTED_NOTE_TO_ISSUE_EVENT" // Represents a 'converted_note_to_issue' event on a given issue or pull request. - PullRequestTimelineItemsItemTypeDemilestonedEvent PullRequestTimelineItemsItemType = "DEMILESTONED_EVENT" // Represents a 'demilestoned' event on a given issue or pull request. - PullRequestTimelineItemsItemTypeLabeledEvent PullRequestTimelineItemsItemType = "LABELED_EVENT" // Represents a 'labeled' event on a given issue or pull request. - PullRequestTimelineItemsItemTypeLockedEvent PullRequestTimelineItemsItemType = "LOCKED_EVENT" // Represents a 'locked' event on a given issue or pull request. - PullRequestTimelineItemsItemTypeMarkedAsDuplicateEvent PullRequestTimelineItemsItemType = "MARKED_AS_DUPLICATE_EVENT" // Represents a 'marked_as_duplicate' event on a given issue or pull request. - PullRequestTimelineItemsItemTypeMentionedEvent PullRequestTimelineItemsItemType = "MENTIONED_EVENT" // Represents a 'mentioned' event on a given issue or pull request. - PullRequestTimelineItemsItemTypeMilestonedEvent PullRequestTimelineItemsItemType = "MILESTONED_EVENT" // Represents a 'milestoned' event on a given issue or pull request. - PullRequestTimelineItemsItemTypeMovedColumnsInProjectEvent PullRequestTimelineItemsItemType = "MOVED_COLUMNS_IN_PROJECT_EVENT" // Represents a 'moved_columns_in_project' event on a given issue or pull request. - PullRequestTimelineItemsItemTypePinnedEvent PullRequestTimelineItemsItemType = "PINNED_EVENT" // Represents a 'pinned' event on a given issue or pull request. - PullRequestTimelineItemsItemTypeReferencedEvent PullRequestTimelineItemsItemType = "REFERENCED_EVENT" // Represents a 'referenced' event on a given `ReferencedSubject`. - PullRequestTimelineItemsItemTypeRemovedFromProjectEvent PullRequestTimelineItemsItemType = "REMOVED_FROM_PROJECT_EVENT" // Represents a 'removed_from_project' event on a given issue or pull request. - PullRequestTimelineItemsItemTypeRenamedTitleEvent PullRequestTimelineItemsItemType = "RENAMED_TITLE_EVENT" // Represents a 'renamed' event on a given issue or pull request. - PullRequestTimelineItemsItemTypeReopenedEvent PullRequestTimelineItemsItemType = "REOPENED_EVENT" // Represents a 'reopened' event on any `Closable`. - PullRequestTimelineItemsItemTypeSubscribedEvent PullRequestTimelineItemsItemType = "SUBSCRIBED_EVENT" // Represents a 'subscribed' event on a given `Subscribable`. - PullRequestTimelineItemsItemTypeTransferredEvent PullRequestTimelineItemsItemType = "TRANSFERRED_EVENT" // Represents a 'transferred' event on a given issue or pull request. - PullRequestTimelineItemsItemTypeUnassignedEvent PullRequestTimelineItemsItemType = "UNASSIGNED_EVENT" // Represents an 'unassigned' event on any assignable object. - PullRequestTimelineItemsItemTypeUnlabeledEvent PullRequestTimelineItemsItemType = "UNLABELED_EVENT" // Represents an 'unlabeled' event on a given issue or pull request. - PullRequestTimelineItemsItemTypeUnlockedEvent PullRequestTimelineItemsItemType = "UNLOCKED_EVENT" // Represents an 'unlocked' event on a given issue or pull request. - PullRequestTimelineItemsItemTypeUserBlockedEvent PullRequestTimelineItemsItemType = "USER_BLOCKED_EVENT" // Represents a 'user_blocked' event on a given user. - PullRequestTimelineItemsItemTypeUnpinnedEvent PullRequestTimelineItemsItemType = "UNPINNED_EVENT" // Represents an 'unpinned' event on a given issue or pull request. - PullRequestTimelineItemsItemTypeUnsubscribedEvent PullRequestTimelineItemsItemType = "UNSUBSCRIBED_EVENT" // Represents an 'unsubscribed' event on a given `Subscribable`. + PullRequestTimelineItemsItemTypePullRequestCommit PullRequestTimelineItemsItemType = "PULL_REQUEST_COMMIT" // Represents a Git commit part of a pull request. + PullRequestTimelineItemsItemTypePullRequestCommitCommentThread PullRequestTimelineItemsItemType = "PULL_REQUEST_COMMIT_COMMENT_THREAD" // Represents a commit comment thread part of a pull request. + PullRequestTimelineItemsItemTypePullRequestReview PullRequestTimelineItemsItemType = "PULL_REQUEST_REVIEW" // A review object for a given pull request. + PullRequestTimelineItemsItemTypePullRequestReviewThread PullRequestTimelineItemsItemType = "PULL_REQUEST_REVIEW_THREAD" // A threaded list of comments for a given pull request. + PullRequestTimelineItemsItemTypePullRequestRevisionMarker PullRequestTimelineItemsItemType = "PULL_REQUEST_REVISION_MARKER" // Represents the latest point in the pull request timeline for which the viewer has seen the pull request's commits. + PullRequestTimelineItemsItemTypeAutomaticBaseChangeFailedEvent PullRequestTimelineItemsItemType = "AUTOMATIC_BASE_CHANGE_FAILED_EVENT" // Represents a 'automatic_base_change_failed' event on a given pull request. + PullRequestTimelineItemsItemTypeAutomaticBaseChangeSucceededEvent PullRequestTimelineItemsItemType = "AUTOMATIC_BASE_CHANGE_SUCCEEDED_EVENT" // Represents a 'automatic_base_change_succeeded' event on a given pull request. + PullRequestTimelineItemsItemTypeBaseRefChangedEvent PullRequestTimelineItemsItemType = "BASE_REF_CHANGED_EVENT" // Represents a 'base_ref_changed' event on a given issue or pull request. + PullRequestTimelineItemsItemTypeBaseRefForcePushedEvent PullRequestTimelineItemsItemType = "BASE_REF_FORCE_PUSHED_EVENT" // Represents a 'base_ref_force_pushed' event on a given pull request. + PullRequestTimelineItemsItemTypeBaseRefDeletedEvent PullRequestTimelineItemsItemType = "BASE_REF_DELETED_EVENT" // Represents a 'base_ref_deleted' event on a given pull request. + PullRequestTimelineItemsItemTypeDeployedEvent PullRequestTimelineItemsItemType = "DEPLOYED_EVENT" // Represents a 'deployed' event on a given pull request. + PullRequestTimelineItemsItemTypeDeploymentEnvironmentChangedEvent PullRequestTimelineItemsItemType = "DEPLOYMENT_ENVIRONMENT_CHANGED_EVENT" // Represents a 'deployment_environment_changed' event on a given pull request. + PullRequestTimelineItemsItemTypeHeadRefDeletedEvent PullRequestTimelineItemsItemType = "HEAD_REF_DELETED_EVENT" // Represents a 'head_ref_deleted' event on a given pull request. + PullRequestTimelineItemsItemTypeHeadRefForcePushedEvent PullRequestTimelineItemsItemType = "HEAD_REF_FORCE_PUSHED_EVENT" // Represents a 'head_ref_force_pushed' event on a given pull request. + PullRequestTimelineItemsItemTypeHeadRefRestoredEvent PullRequestTimelineItemsItemType = "HEAD_REF_RESTORED_EVENT" // Represents a 'head_ref_restored' event on a given pull request. + PullRequestTimelineItemsItemTypeMergedEvent PullRequestTimelineItemsItemType = "MERGED_EVENT" // Represents a 'merged' event on a given pull request. + PullRequestTimelineItemsItemTypeReviewDismissedEvent PullRequestTimelineItemsItemType = "REVIEW_DISMISSED_EVENT" // Represents a 'review_dismissed' event on a given issue or pull request. + PullRequestTimelineItemsItemTypeReviewRequestedEvent PullRequestTimelineItemsItemType = "REVIEW_REQUESTED_EVENT" // Represents an 'review_requested' event on a given pull request. + PullRequestTimelineItemsItemTypeReviewRequestRemovedEvent PullRequestTimelineItemsItemType = "REVIEW_REQUEST_REMOVED_EVENT" // Represents an 'review_request_removed' event on a given pull request. + PullRequestTimelineItemsItemTypeReadyForReviewEvent PullRequestTimelineItemsItemType = "READY_FOR_REVIEW_EVENT" // Represents a 'ready_for_review' event on a given pull request. + PullRequestTimelineItemsItemTypeConvertToDraftEvent PullRequestTimelineItemsItemType = "CONVERT_TO_DRAFT_EVENT" // Represents a 'convert_to_draft' event on a given pull request. + PullRequestTimelineItemsItemTypeIssueComment PullRequestTimelineItemsItemType = "ISSUE_COMMENT" // Represents a comment on an Issue. + PullRequestTimelineItemsItemTypeCrossReferencedEvent PullRequestTimelineItemsItemType = "CROSS_REFERENCED_EVENT" // Represents a mention made by one issue or pull request to another. + PullRequestTimelineItemsItemTypeAddedToProjectEvent PullRequestTimelineItemsItemType = "ADDED_TO_PROJECT_EVENT" // Represents a 'added_to_project' event on a given issue or pull request. + PullRequestTimelineItemsItemTypeAssignedEvent PullRequestTimelineItemsItemType = "ASSIGNED_EVENT" // Represents an 'assigned' event on any assignable object. + PullRequestTimelineItemsItemTypeClosedEvent PullRequestTimelineItemsItemType = "CLOSED_EVENT" // Represents a 'closed' event on any `Closable`. + PullRequestTimelineItemsItemTypeCommentDeletedEvent PullRequestTimelineItemsItemType = "COMMENT_DELETED_EVENT" // Represents a 'comment_deleted' event on a given issue or pull request. + PullRequestTimelineItemsItemTypeConnectedEvent PullRequestTimelineItemsItemType = "CONNECTED_EVENT" // Represents a 'connected' event on a given issue or pull request. + PullRequestTimelineItemsItemTypeConvertedNoteToIssueEvent PullRequestTimelineItemsItemType = "CONVERTED_NOTE_TO_ISSUE_EVENT" // Represents a 'converted_note_to_issue' event on a given issue or pull request. + PullRequestTimelineItemsItemTypeDemilestonedEvent PullRequestTimelineItemsItemType = "DEMILESTONED_EVENT" // Represents a 'demilestoned' event on a given issue or pull request. + PullRequestTimelineItemsItemTypeDisconnectedEvent PullRequestTimelineItemsItemType = "DISCONNECTED_EVENT" // Represents a 'disconnected' event on a given issue or pull request. + PullRequestTimelineItemsItemTypeLabeledEvent PullRequestTimelineItemsItemType = "LABELED_EVENT" // Represents a 'labeled' event on a given issue or pull request. + PullRequestTimelineItemsItemTypeLockedEvent PullRequestTimelineItemsItemType = "LOCKED_EVENT" // Represents a 'locked' event on a given issue or pull request. + PullRequestTimelineItemsItemTypeMarkedAsDuplicateEvent PullRequestTimelineItemsItemType = "MARKED_AS_DUPLICATE_EVENT" // Represents a 'marked_as_duplicate' event on a given issue or pull request. + PullRequestTimelineItemsItemTypeMentionedEvent PullRequestTimelineItemsItemType = "MENTIONED_EVENT" // Represents a 'mentioned' event on a given issue or pull request. + PullRequestTimelineItemsItemTypeMilestonedEvent PullRequestTimelineItemsItemType = "MILESTONED_EVENT" // Represents a 'milestoned' event on a given issue or pull request. + PullRequestTimelineItemsItemTypeMovedColumnsInProjectEvent PullRequestTimelineItemsItemType = "MOVED_COLUMNS_IN_PROJECT_EVENT" // Represents a 'moved_columns_in_project' event on a given issue or pull request. + PullRequestTimelineItemsItemTypePinnedEvent PullRequestTimelineItemsItemType = "PINNED_EVENT" // Represents a 'pinned' event on a given issue or pull request. + PullRequestTimelineItemsItemTypeReferencedEvent PullRequestTimelineItemsItemType = "REFERENCED_EVENT" // Represents a 'referenced' event on a given `ReferencedSubject`. + PullRequestTimelineItemsItemTypeRemovedFromProjectEvent PullRequestTimelineItemsItemType = "REMOVED_FROM_PROJECT_EVENT" // Represents a 'removed_from_project' event on a given issue or pull request. + PullRequestTimelineItemsItemTypeRenamedTitleEvent PullRequestTimelineItemsItemType = "RENAMED_TITLE_EVENT" // Represents a 'renamed' event on a given issue or pull request. + PullRequestTimelineItemsItemTypeReopenedEvent PullRequestTimelineItemsItemType = "REOPENED_EVENT" // Represents a 'reopened' event on any `Closable`. + PullRequestTimelineItemsItemTypeSubscribedEvent PullRequestTimelineItemsItemType = "SUBSCRIBED_EVENT" // Represents a 'subscribed' event on a given `Subscribable`. + PullRequestTimelineItemsItemTypeTransferredEvent PullRequestTimelineItemsItemType = "TRANSFERRED_EVENT" // Represents a 'transferred' event on a given issue or pull request. + PullRequestTimelineItemsItemTypeUnassignedEvent PullRequestTimelineItemsItemType = "UNASSIGNED_EVENT" // Represents an 'unassigned' event on any assignable object. + PullRequestTimelineItemsItemTypeUnlabeledEvent PullRequestTimelineItemsItemType = "UNLABELED_EVENT" // Represents an 'unlabeled' event on a given issue or pull request. + PullRequestTimelineItemsItemTypeUnlockedEvent PullRequestTimelineItemsItemType = "UNLOCKED_EVENT" // Represents an 'unlocked' event on a given issue or pull request. + PullRequestTimelineItemsItemTypeUserBlockedEvent PullRequestTimelineItemsItemType = "USER_BLOCKED_EVENT" // Represents a 'user_blocked' event on a given user. + PullRequestTimelineItemsItemTypeUnmarkedAsDuplicateEvent PullRequestTimelineItemsItemType = "UNMARKED_AS_DUPLICATE_EVENT" // Represents an 'unmarked_as_duplicate' event on a given issue or pull request. + PullRequestTimelineItemsItemTypeUnpinnedEvent PullRequestTimelineItemsItemType = "UNPINNED_EVENT" // Represents an 'unpinned' event on a given issue or pull request. + PullRequestTimelineItemsItemTypeUnsubscribedEvent PullRequestTimelineItemsItemType = "UNSUBSCRIBED_EVENT" // Represents an 'unsubscribed' event on a given `Subscribable`. ) // PullRequestUpdateState represents the possible target states when updating a pull request. @@ -900,42 +997,6 @@ const ( RefOrderFieldAlphabetical RefOrderField = "ALPHABETICAL" // Order refs by their alphanumeric name. ) -// RegistryPackageDependencyType represents the possible types of a registry package dependency. -type RegistryPackageDependencyType string - -// The possible types of a registry package dependency. -const ( - RegistryPackageDependencyTypeDefault RegistryPackageDependencyType = "DEFAULT" // A default registry package dependency type. - RegistryPackageDependencyTypeDev RegistryPackageDependencyType = "DEV" // A dev registry package dependency type. - RegistryPackageDependencyTypeTest RegistryPackageDependencyType = "TEST" // A test registry package dependency type. - RegistryPackageDependencyTypePeer RegistryPackageDependencyType = "PEER" // A peer registry package dependency type. - RegistryPackageDependencyTypeOptional RegistryPackageDependencyType = "OPTIONAL" // An optional registry package dependency type. - RegistryPackageDependencyTypeBundled RegistryPackageDependencyType = "BUNDLED" // An optional registry package dependency type. -) - -// RegistryPackageFileState represents the possible states of a registry package file. -type RegistryPackageFileState string - -// The possible states of a registry package file. -const ( - RegistryPackageFileStateNew RegistryPackageFileState = "NEW" // Package file doesn't have a blob backing it. - RegistryPackageFileStateUploaded RegistryPackageFileState = "UPLOADED" // All Package file contents have been uploaded. -) - -// RegistryPackageType represents the possible types of a registry package. -type RegistryPackageType string - -// The possible types of a registry package. -const ( - RegistryPackageTypeNpm RegistryPackageType = "NPM" // An npm registry package. - RegistryPackageTypeRubygems RegistryPackageType = "RUBYGEMS" // A rubygems registry package. - RegistryPackageTypeMaven RegistryPackageType = "MAVEN" // A maven registry package. - RegistryPackageTypeDocker RegistryPackageType = "DOCKER" // A docker image. - RegistryPackageTypeDebian RegistryPackageType = "DEBIAN" // A debian package. - RegistryPackageTypeNuget RegistryPackageType = "NUGET" // A nuget package. - RegistryPackageTypePython RegistryPackageType = "PYTHON" // A python package. -) - // ReleaseOrderField represents properties by which release connections can be ordered. type ReleaseOrderField string @@ -1020,11 +1081,12 @@ type ReportedContentClassifiers string // The reasons a piece of content can be reported or minimized. const ( - ReportedContentClassifiersSpam ReportedContentClassifiers = "SPAM" // A spammy piece of content. - ReportedContentClassifiersAbuse ReportedContentClassifiers = "ABUSE" // An abusive or harassing piece of content. - ReportedContentClassifiersOffTopic ReportedContentClassifiers = "OFF_TOPIC" // An irrelevant piece of content. - ReportedContentClassifiersOutdated ReportedContentClassifiers = "OUTDATED" // An outdated piece of content. - ReportedContentClassifiersResolved ReportedContentClassifiers = "RESOLVED" // The content has been resolved. + ReportedContentClassifiersSpam ReportedContentClassifiers = "SPAM" // A spammy piece of content. + ReportedContentClassifiersAbuse ReportedContentClassifiers = "ABUSE" // An abusive or harassing piece of content. + ReportedContentClassifiersOffTopic ReportedContentClassifiers = "OFF_TOPIC" // An irrelevant piece of content. + ReportedContentClassifiersOutdated ReportedContentClassifiers = "OUTDATED" // An outdated piece of content. + ReportedContentClassifiersDuplicate ReportedContentClassifiers = "DUPLICATE" // A duplicated piece of content. + ReportedContentClassifiersResolved ReportedContentClassifiers = "RESOLVED" // The content has been resolved. ) // RepositoryAffiliation represents the affiliation of a user to a repository. @@ -1037,15 +1099,6 @@ const ( RepositoryAffiliationOrganizationMember RepositoryAffiliation = "ORGANIZATION_MEMBER" // Repositories that the user has access to through being a member of an organization. This includes every repository on every team that the user is on. ) -// RepositoryCollaboratorAffiliation represents the affiliation type between collaborator and repository. -type RepositoryCollaboratorAffiliation string - -// The affiliation type between collaborator and repository. -const ( - RepositoryCollaboratorAffiliationAll RepositoryCollaboratorAffiliation = "ALL" // All collaborators of the repository. - RepositoryCollaboratorAffiliationOutside RepositoryCollaboratorAffiliation = "OUTSIDE" // All outside collaborators of an organization-owned repository. -) - // RepositoryContributionType represents the reason a repository is listed as 'contributed'. type RepositoryContributionType string @@ -1058,6 +1111,39 @@ const ( RepositoryContributionTypePullRequestReview RepositoryContributionType = "PULL_REQUEST_REVIEW" // Reviewed a pull request. ) +// RepositoryInteractionLimit represents a repository interaction limit. +type RepositoryInteractionLimit string + +// A repository interaction limit. +const ( + RepositoryInteractionLimitExistingUsers RepositoryInteractionLimit = "EXISTING_USERS" // Users that have recently created their account will be unable to interact with the repository. + RepositoryInteractionLimitContributorsOnly RepositoryInteractionLimit = "CONTRIBUTORS_ONLY" // Users that have not previously committed to a repository’s default branch will be unable to interact with the repository. + RepositoryInteractionLimitCollaboratorsOnly RepositoryInteractionLimit = "COLLABORATORS_ONLY" // Users that are not collaborators will not be able to interact with the repository. + RepositoryInteractionLimitNoLimit RepositoryInteractionLimit = "NO_LIMIT" // No interaction limits are enabled. +) + +// RepositoryInteractionLimitExpiry represents the length for a repository interaction limit to be enabled for. +type RepositoryInteractionLimitExpiry string + +// The length for a repository interaction limit to be enabled for. +const ( + RepositoryInteractionLimitExpiryOneDay RepositoryInteractionLimitExpiry = "ONE_DAY" // The interaction limit will expire after 1 day. + RepositoryInteractionLimitExpiryThreeDays RepositoryInteractionLimitExpiry = "THREE_DAYS" // The interaction limit will expire after 3 days. + RepositoryInteractionLimitExpiryOneWeek RepositoryInteractionLimitExpiry = "ONE_WEEK" // The interaction limit will expire after 1 week. + RepositoryInteractionLimitExpiryOneMonth RepositoryInteractionLimitExpiry = "ONE_MONTH" // The interaction limit will expire after 1 month. + RepositoryInteractionLimitExpirySixMonths RepositoryInteractionLimitExpiry = "SIX_MONTHS" // The interaction limit will expire after 6 months. +) + +// RepositoryInteractionLimitOrigin represents indicates where an interaction limit is configured. +type RepositoryInteractionLimitOrigin string + +// Indicates where an interaction limit is configured. +const ( + RepositoryInteractionLimitOriginRepository RepositoryInteractionLimitOrigin = "REPOSITORY" // A limit that is configured at the repository level. + RepositoryInteractionLimitOriginOrganization RepositoryInteractionLimitOrigin = "ORGANIZATION" // A limit that is configured at the organization level. + RepositoryInteractionLimitOriginUser RepositoryInteractionLimitOrigin = "USER" // A limit that is configured at the user-wide level. +) + // RepositoryInvitationOrderField represents properties by which repository invitation connections can be ordered. type RepositoryInvitationOrderField string @@ -1121,6 +1207,16 @@ const ( RepositoryVisibilityInternal RepositoryVisibility = "INTERNAL" // The repository is visible only to users in the same business. ) +// RequestableCheckStatusState represents the possible states that can be requested when creating a check run. +type RequestableCheckStatusState string + +// The possible states that can be requested when creating a check run. +const ( + RequestableCheckStatusStateQueued RequestableCheckStatusState = "QUEUED" // The check suite or run has been queued. + RequestableCheckStatusStateInProgress RequestableCheckStatusState = "IN_PROGRESS" // The check suite or run is in progress. + RequestableCheckStatusStateCompleted RequestableCheckStatusState = "COMPLETED" // The check suite or run has been completed. +) + // SamlDigestAlgorithm represents the possible digest algorithms used to sign SAML requests for an identity provider. type SamlDigestAlgorithm string diff --git a/vendor/github.com/shurcooL/githubv4/input.go b/vendor/github.com/shurcooL/githubv4/input.go index 91555f4e46..550d544e98 100644 --- a/vendor/github.com/shurcooL/githubv4/input.go +++ b/vendor/github.com/shurcooL/githubv4/input.go @@ -4,7 +4,7 @@ package githubv4 // Input represents one of the Input structs: // -// AcceptEnterpriseAdministratorInvitationInput, AcceptTopicSuggestionInput, AddAssigneesToAssignableInput, AddCommentInput, AddLabelsToLabelableInput, AddProjectCardInput, AddProjectColumnInput, AddPullRequestReviewCommentInput, AddPullRequestReviewInput, AddReactionInput, AddStarInput, ArchiveRepositoryInput, AuditLogOrder, CancelEnterpriseAdminInvitationInput, ChangeUserStatusInput, ClearLabelsFromLabelableInput, CloneProjectInput, CloneTemplateRepositoryInput, CloseIssueInput, ClosePullRequestInput, CommitAuthor, CommitContributionOrder, ContributionOrder, ConvertProjectCardNoteToIssueInput, CreateBranchProtectionRuleInput, CreateContentAttachmentInput, CreateEnterpriseOrganizationInput, CreateIssueInput, CreateProjectInput, CreatePullRequestInput, CreateRefInput, CreateRepositoryInput, CreateTeamDiscussionCommentInput, CreateTeamDiscussionInput, DeclineTopicSuggestionInput, DeleteBranchProtectionRuleInput, DeleteIssueCommentInput, DeleteIssueInput, DeletePackageVersionInput, DeleteProjectCardInput, DeleteProjectColumnInput, DeleteProjectInput, DeletePullRequestReviewCommentInput, DeletePullRequestReviewInput, DeleteRefInput, DeleteTeamDiscussionCommentInput, DeleteTeamDiscussionInput, DeploymentOrder, DismissPullRequestReviewInput, DraftPullRequestReviewComment, EnterpriseAdministratorInvitationOrder, EnterpriseMemberOrder, EnterpriseOrder, EnterpriseServerInstallationOrder, EnterpriseServerUserAccountEmailOrder, EnterpriseServerUserAccountOrder, EnterpriseServerUserAccountsUploadOrder, FollowUserInput, GistOrder, ImportProjectInput, InviteEnterpriseAdminInput, IssueFilters, IssueOrder, LanguageOrder, LinkRepositoryToProjectInput, LockLockableInput, MergeBranchInput, MergePullRequestInput, MilestoneOrder, MinimizeCommentInput, MoveProjectCardInput, MoveProjectColumnInput, OrganizationOrder, PinIssueInput, ProjectCardImport, ProjectColumnImport, ProjectOrder, PullRequestOrder, ReactionOrder, RefOrder, RegenerateEnterpriseIdentityProviderRecoveryCodesInput, RegistryPackageMetadatum, ReleaseOrder, RemoveAssigneesFromAssignableInput, RemoveEnterpriseAdminInput, RemoveEnterpriseOrganizationInput, RemoveLabelsFromLabelableInput, RemoveOutsideCollaboratorInput, RemoveReactionInput, RemoveStarInput, ReopenIssueInput, ReopenPullRequestInput, RepositoryInvitationOrder, RepositoryOrder, RequestReviewsInput, ResolveReviewThreadInput, SavedReplyOrder, SecurityAdvisoryIdentifierFilter, SecurityAdvisoryOrder, SecurityVulnerabilityOrder, SponsorsTierOrder, SponsorshipOrder, StarOrder, SubmitPullRequestReviewInput, TeamDiscussionCommentOrder, TeamDiscussionOrder, TeamMemberOrder, TeamOrder, TeamRepositoryOrder, TransferIssueInput, UnarchiveRepositoryInput, UnfollowUserInput, UnlinkRepositoryFromProjectInput, UnlockLockableInput, UnmarkIssueAsDuplicateInput, UnminimizeCommentInput, UnpinIssueInput, UnresolveReviewThreadInput, UpdateBranchProtectionRuleInput, UpdateEnterpriseActionExecutionCapabilitySettingInput, UpdateEnterpriseAdministratorRoleInput, UpdateEnterpriseAllowPrivateRepositoryForkingSettingInput, UpdateEnterpriseDefaultRepositoryPermissionSettingInput, UpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput, UpdateEnterpriseMembersCanCreateRepositoriesSettingInput, UpdateEnterpriseMembersCanDeleteIssuesSettingInput, UpdateEnterpriseMembersCanDeleteRepositoriesSettingInput, UpdateEnterpriseMembersCanInviteCollaboratorsSettingInput, UpdateEnterpriseMembersCanMakePurchasesSettingInput, UpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput, UpdateEnterpriseMembersCanViewDependencyInsightsSettingInput, UpdateEnterpriseOrganizationProjectsSettingInput, UpdateEnterpriseProfileInput, UpdateEnterpriseRepositoryProjectsSettingInput, UpdateEnterpriseTeamDiscussionsSettingInput, UpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput, UpdateIssueCommentInput, UpdateIssueInput, UpdateProjectCardInput, UpdateProjectColumnInput, UpdateProjectInput, UpdatePullRequestInput, UpdatePullRequestReviewCommentInput, UpdatePullRequestReviewInput, UpdateRefInput, UpdateRepositoryInput, UpdateSubscriptionInput, UpdateTeamDiscussionCommentInput, UpdateTeamDiscussionInput, UpdateTopicsInput, UserStatusOrder. +// AcceptEnterpriseAdministratorInvitationInput, AcceptTopicSuggestionInput, AddAssigneesToAssignableInput, AddCommentInput, AddLabelsToLabelableInput, AddProjectCardInput, AddProjectColumnInput, AddPullRequestReviewCommentInput, AddPullRequestReviewInput, AddPullRequestReviewThreadInput, AddReactionInput, AddStarInput, ArchiveRepositoryInput, AuditLogOrder, CancelEnterpriseAdminInvitationInput, ChangeUserStatusInput, CheckAnnotationData, CheckAnnotationRange, CheckRunAction, CheckRunFilter, CheckRunOutput, CheckRunOutputImage, CheckSuiteAutoTriggerPreference, CheckSuiteFilter, ClearLabelsFromLabelableInput, CloneProjectInput, CloneTemplateRepositoryInput, CloseIssueInput, ClosePullRequestInput, CommitAuthor, CommitContributionOrder, ContributionOrder, ConvertProjectCardNoteToIssueInput, CreateBranchProtectionRuleInput, CreateCheckRunInput, CreateCheckSuiteInput, CreateEnterpriseOrganizationInput, CreateIpAllowListEntryInput, CreateIssueInput, CreateProjectInput, CreatePullRequestInput, CreateRefInput, CreateRepositoryInput, CreateTeamDiscussionCommentInput, CreateTeamDiscussionInput, DeclineTopicSuggestionInput, DeleteBranchProtectionRuleInput, DeleteDeploymentInput, DeleteIpAllowListEntryInput, DeleteIssueCommentInput, DeleteIssueInput, DeleteProjectCardInput, DeleteProjectColumnInput, DeleteProjectInput, DeletePullRequestReviewCommentInput, DeletePullRequestReviewInput, DeleteRefInput, DeleteTeamDiscussionCommentInput, DeleteTeamDiscussionInput, DeploymentOrder, DismissPullRequestReviewInput, DraftPullRequestReviewComment, DraftPullRequestReviewThread, EnterpriseAdministratorInvitationOrder, EnterpriseMemberOrder, EnterpriseServerInstallationOrder, EnterpriseServerUserAccountEmailOrder, EnterpriseServerUserAccountOrder, EnterpriseServerUserAccountsUploadOrder, FollowUserInput, GistOrder, InviteEnterpriseAdminInput, IpAllowListEntryOrder, IssueCommentOrder, IssueFilters, IssueOrder, LabelOrder, LanguageOrder, LinkRepositoryToProjectInput, LockLockableInput, MarkFileAsViewedInput, MarkPullRequestReadyForReviewInput, MergeBranchInput, MergePullRequestInput, MilestoneOrder, MinimizeCommentInput, MoveProjectCardInput, MoveProjectColumnInput, OrganizationOrder, PackageFileOrder, PackageOrder, PackageVersionOrder, ProjectOrder, PullRequestOrder, ReactionOrder, RefOrder, RegenerateEnterpriseIdentityProviderRecoveryCodesInput, ReleaseOrder, RemoveAssigneesFromAssignableInput, RemoveEnterpriseAdminInput, RemoveEnterpriseIdentityProviderInput, RemoveEnterpriseOrganizationInput, RemoveLabelsFromLabelableInput, RemoveOutsideCollaboratorInput, RemoveReactionInput, RemoveStarInput, ReopenIssueInput, ReopenPullRequestInput, RepositoryInvitationOrder, RepositoryOrder, RequestReviewsInput, RerequestCheckSuiteInput, ResolveReviewThreadInput, SavedReplyOrder, SecurityAdvisoryIdentifierFilter, SecurityAdvisoryOrder, SecurityVulnerabilityOrder, SetEnterpriseIdentityProviderInput, SetOrganizationInteractionLimitInput, SetRepositoryInteractionLimitInput, SetUserInteractionLimitInput, SponsorsTierOrder, SponsorshipOrder, StarOrder, SubmitPullRequestReviewInput, TeamDiscussionCommentOrder, TeamDiscussionOrder, TeamMemberOrder, TeamOrder, TeamRepositoryOrder, TransferIssueInput, UnarchiveRepositoryInput, UnfollowUserInput, UnlinkRepositoryFromProjectInput, UnlockLockableInput, UnmarkFileAsViewedInput, UnmarkIssueAsDuplicateInput, UnminimizeCommentInput, UnresolveReviewThreadInput, UpdateBranchProtectionRuleInput, UpdateCheckRunInput, UpdateCheckSuitePreferencesInput, UpdateEnterpriseAdministratorRoleInput, UpdateEnterpriseAllowPrivateRepositoryForkingSettingInput, UpdateEnterpriseDefaultRepositoryPermissionSettingInput, UpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput, UpdateEnterpriseMembersCanCreateRepositoriesSettingInput, UpdateEnterpriseMembersCanDeleteIssuesSettingInput, UpdateEnterpriseMembersCanDeleteRepositoriesSettingInput, UpdateEnterpriseMembersCanInviteCollaboratorsSettingInput, UpdateEnterpriseMembersCanMakePurchasesSettingInput, UpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput, UpdateEnterpriseMembersCanViewDependencyInsightsSettingInput, UpdateEnterpriseOrganizationProjectsSettingInput, UpdateEnterpriseProfileInput, UpdateEnterpriseRepositoryProjectsSettingInput, UpdateEnterpriseTeamDiscussionsSettingInput, UpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput, UpdateIpAllowListEnabledSettingInput, UpdateIpAllowListEntryInput, UpdateIssueCommentInput, UpdateIssueInput, UpdateProjectCardInput, UpdateProjectColumnInput, UpdateProjectInput, UpdatePullRequestInput, UpdatePullRequestReviewCommentInput, UpdatePullRequestReviewInput, UpdateRefInput, UpdateRepositoryInput, UpdateSubscriptionInput, UpdateTeamDiscussionCommentInput, UpdateTeamDiscussionInput, UpdateTopicsInput, UserStatusOrder. type Input interface{} // AcceptEnterpriseAdministratorInvitationInput is an autogenerated input type of AcceptEnterpriseAdministratorInvitation. @@ -86,11 +86,13 @@ type AddProjectColumnInput struct { // AddPullRequestReviewCommentInput is an autogenerated input type of AddPullRequestReviewComment. type AddPullRequestReviewCommentInput struct { - // The Node ID of the review to modify. (Required.) - PullRequestReviewID ID `json:"pullRequestReviewId"` // The text of the comment. (Required.) Body String `json:"body"` + // The node ID of the pull request reviewing. (Optional.) + PullRequestID *ID `json:"pullRequestId,omitempty"` + // The Node ID of the review to modify. (Optional.) + PullRequestReviewID *ID `json:"pullRequestReviewId,omitempty"` // The SHA of the commit to comment on. (Optional.) CommitOID *GitObjectID `json:"commitOID,omitempty"` // The relative path of the file to comment on. (Optional.) @@ -116,6 +118,31 @@ type AddPullRequestReviewInput struct { Event *PullRequestReviewEvent `json:"event,omitempty"` // The review line comments. (Optional.) Comments *[]*DraftPullRequestReviewComment `json:"comments,omitempty"` + // The review line comment threads. (Optional.) + Threads *[]*DraftPullRequestReviewThread `json:"threads,omitempty"` + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + +// AddPullRequestReviewThreadInput is an autogenerated input type of AddPullRequestReviewThread. +type AddPullRequestReviewThreadInput struct { + // Path to the file being commented on. (Required.) + Path String `json:"path"` + // Body of the thread's first comment. (Required.) + Body String `json:"body"` + // The line of the blob to which the thread refers. The end of the line range for multi-line comments. (Required.) + Line Int `json:"line"` + + // The node ID of the pull request reviewing. (Optional.) + PullRequestID *ID `json:"pullRequestId,omitempty"` + // The Node ID of the review to modify. (Optional.) + PullRequestReviewID *ID `json:"pullRequestReviewId,omitempty"` + // The side of the diff on which the line resides. For multi-line comments, this is the side for the end of the line range. (Optional.) + Side *DiffSide `json:"side,omitempty"` + // The first line of the range to which the comment refers. (Optional.) + StartLine *Int `json:"startLine,omitempty"` + // The side of the diff on which the start line resides. (Optional.) + StartSide *DiffSide `json:"startSide,omitempty"` // A unique identifier for the client performing the mutation. (Optional.) ClientMutationID *String `json:"clientMutationId,omitempty"` } @@ -184,6 +211,102 @@ type ChangeUserStatusInput struct { ClientMutationID *String `json:"clientMutationId,omitempty"` } +// CheckAnnotationData represents information from a check run analysis to specific lines of code. +type CheckAnnotationData struct { + // The path of the file to add an annotation to. (Required.) + Path String `json:"path"` + // The location of the annotation. (Required.) + Location CheckAnnotationRange `json:"location"` + // Represents an annotation's information level. (Required.) + AnnotationLevel CheckAnnotationLevel `json:"annotationLevel"` + // A short description of the feedback for these lines of code. (Required.) + Message String `json:"message"` + + // The title that represents the annotation. (Optional.) + Title *String `json:"title,omitempty"` + // Details about this annotation. (Optional.) + RawDetails *String `json:"rawDetails,omitempty"` +} + +// CheckAnnotationRange represents information from a check run analysis to specific lines of code. +type CheckAnnotationRange struct { + // The starting line of the range. (Required.) + StartLine Int `json:"startLine"` + // The ending line of the range. (Required.) + EndLine Int `json:"endLine"` + + // The starting column of the range. (Optional.) + StartColumn *Int `json:"startColumn,omitempty"` + // The ending column of the range. (Optional.) + EndColumn *Int `json:"endColumn,omitempty"` +} + +// CheckRunAction represents possible further actions the integrator can perform. +type CheckRunAction struct { + // The text to be displayed on a button in the web UI. (Required.) + Label String `json:"label"` + // A short explanation of what this action would do. (Required.) + Description String `json:"description"` + // A reference for the action on the integrator's system. (Required.) + Identifier String `json:"identifier"` +} + +// CheckRunFilter represents the filters that are available when fetching check runs. +type CheckRunFilter struct { + + // Filters the check runs by this type. (Optional.) + CheckType *CheckRunType `json:"checkType,omitempty"` + // Filters the check runs created by this application ID. (Optional.) + AppID *Int `json:"appId,omitempty"` + // Filters the check runs by this name. (Optional.) + CheckName *String `json:"checkName,omitempty"` + // Filters the check runs by this status. (Optional.) + Status *CheckStatusState `json:"status,omitempty"` +} + +// CheckRunOutput represents descriptive details about the check run. +type CheckRunOutput struct { + // A title to provide for this check run. (Required.) + Title String `json:"title"` + // The summary of the check run (supports Commonmark). (Required.) + Summary String `json:"summary"` + + // The details of the check run (supports Commonmark). (Optional.) + Text *String `json:"text,omitempty"` + // The annotations that are made as part of the check run. (Optional.) + Annotations *[]CheckAnnotationData `json:"annotations,omitempty"` + // Images attached to the check run output displayed in the GitHub pull request UI. (Optional.) + Images *[]CheckRunOutputImage `json:"images,omitempty"` +} + +// CheckRunOutputImage represents images attached to the check run output displayed in the GitHub pull request UI. +type CheckRunOutputImage struct { + // The alternative text for the image. (Required.) + Alt String `json:"alt"` + // The full URL of the image. (Required.) + ImageURL URI `json:"imageUrl"` + + // A short image description. (Optional.) + Caption *String `json:"caption,omitempty"` +} + +// CheckSuiteAutoTriggerPreference represents the auto-trigger preferences that are available for check suites. +type CheckSuiteAutoTriggerPreference struct { + // The node ID of the application that owns the check suite. (Required.) + AppID ID `json:"appId"` + // Set to `true` to enable automatic creation of CheckSuite events upon pushes to the repository. (Required.) + Setting Boolean `json:"setting"` +} + +// CheckSuiteFilter represents the filters that are available when fetching check suites. +type CheckSuiteFilter struct { + + // Filters the check suites created by this application ID. (Optional.) + AppID *Int `json:"appId,omitempty"` + // Filters the check suites by this name. (Optional.) + CheckName *String `json:"checkName,omitempty"` +} + // ClearLabelsFromLabelableInput is an autogenerated input type of ClearLabelsFromLabelable. type ClearLabelsFromLabelableInput struct { // The id of the labelable object to clear the labels from. (Required.) @@ -225,6 +348,8 @@ type CloneTemplateRepositoryInput struct { // A short description of the new repository. (Optional.) Description *String `json:"description,omitempty"` + // Whether to copy all branches from the template to the new repository. Defaults to copying only the default branch of the template. (Optional.) + IncludeAllBranches *Boolean `json:"includeAllBranches,omitempty"` // A unique identifier for the client performing the mutation. (Optional.) ClientMutationID *String `json:"clientMutationId,omitempty"` } @@ -268,9 +393,6 @@ type CommitContributionOrder struct { type ContributionOrder struct { // The ordering direction. (Required.) Direction OrderDirection `json:"direction"` - - // The field by which to order contributions. **Upcoming Change on 2019-10-01 UTC** **Description:** `field` will be removed. Only one order field is supported. **Reason:** `field` will be removed. (Optional.) - Field *ContributionOrderField `json:"field,omitempty"` } // ConvertProjectCardNoteToIssueInput is an autogenerated input type of ConvertProjectCardNoteToIssue. @@ -301,6 +423,12 @@ type CreateBranchProtectionRuleInput struct { RequiredApprovingReviewCount *Int `json:"requiredApprovingReviewCount,omitempty"` // Are commits required to be signed. (Optional.) RequiresCommitSignatures *Boolean `json:"requiresCommitSignatures,omitempty"` + // Are merge commits prohibited from being pushed to this branch. (Optional.) + RequiresLinearHistory *Boolean `json:"requiresLinearHistory,omitempty"` + // Are force pushes allowed on this branch. (Optional.) + AllowsForcePushes *Boolean `json:"allowsForcePushes,omitempty"` + // Can this branch be deleted. (Optional.) + AllowsDeletions *Boolean `json:"allowsDeletions,omitempty"` // Can admins overwrite branch protection. (Optional.) IsAdminEnforced *Boolean `json:"isAdminEnforced,omitempty"` // Are status checks required to update matching branches. (Optional.) @@ -325,14 +453,41 @@ type CreateBranchProtectionRuleInput struct { ClientMutationID *String `json:"clientMutationId,omitempty"` } -// CreateContentAttachmentInput is an autogenerated input type of CreateContentAttachment. -type CreateContentAttachmentInput struct { - // The node ID of the content_reference. (Required.) - ContentReferenceID ID `json:"contentReferenceId"` - // The title of the content attachment. (Required.) - Title String `json:"title"` - // The body of the content attachment, which may contain markdown. (Required.) - Body String `json:"body"` +// CreateCheckRunInput is an autogenerated input type of CreateCheckRun. +type CreateCheckRunInput struct { + // The node ID of the repository. (Required.) + RepositoryID ID `json:"repositoryId"` + // The name of the check. (Required.) + Name String `json:"name"` + // The SHA of the head commit. (Required.) + HeadSha GitObjectID `json:"headSha"` + + // The URL of the integrator's site that has the full details of the check. (Optional.) + DetailsURL *URI `json:"detailsUrl,omitempty"` + // A reference for the run on the integrator's system. (Optional.) + ExternalID *String `json:"externalId,omitempty"` + // The current status. (Optional.) + Status *RequestableCheckStatusState `json:"status,omitempty"` + // The time that the check run began. (Optional.) + StartedAt *DateTime `json:"startedAt,omitempty"` + // The final conclusion of the check. (Optional.) + Conclusion *CheckConclusionState `json:"conclusion,omitempty"` + // The time that the check run finished. (Optional.) + CompletedAt *DateTime `json:"completedAt,omitempty"` + // Descriptive details about the run. (Optional.) + Output *CheckRunOutput `json:"output,omitempty"` + // Possible further actions the integrator can perform, which a user may trigger. (Optional.) + Actions *[]CheckRunAction `json:"actions,omitempty"` + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + +// CreateCheckSuiteInput is an autogenerated input type of CreateCheckSuite. +type CreateCheckSuiteInput struct { + // The Node ID of the repository. (Required.) + RepositoryID ID `json:"repositoryId"` + // The SHA of the head commit. (Required.) + HeadSha GitObjectID `json:"headSha"` // A unique identifier for the client performing the mutation. (Optional.) ClientMutationID *String `json:"clientMutationId,omitempty"` @@ -355,6 +510,21 @@ type CreateEnterpriseOrganizationInput struct { ClientMutationID *String `json:"clientMutationId,omitempty"` } +// CreateIpAllowListEntryInput is an autogenerated input type of CreateIpAllowListEntry. +type CreateIpAllowListEntryInput struct { + // The ID of the owner for which to create the new IP allow list entry. (Required.) + OwnerID ID `json:"ownerId"` + // An IP address or range of addresses in CIDR notation. (Required.) + AllowListValue String `json:"allowListValue"` + // Whether the IP allow list entry is active when an IP allow list is enabled. (Required.) + IsActive Boolean `json:"isActive"` + + // An optional name for the IP allow list entry. (Optional.) + Name *String `json:"name,omitempty"` + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + // CreateIssueInput is an autogenerated input type of CreateIssue. type CreateIssueInput struct { // The Node ID of the repository. (Required.) @@ -372,6 +542,8 @@ type CreateIssueInput struct { LabelIDs *[]ID `json:"labelIds,omitempty"` // An array of Node IDs for projects associated with this issue. (Optional.) ProjectIDs *[]ID `json:"projectIds,omitempty"` + // The name of an issue template in the repository, assigns labels and assignees from the template to the issue. (Optional.) + IssueTemplate *String `json:"issueTemplate,omitempty"` // A unique identifier for the client performing the mutation. (Optional.) ClientMutationID *String `json:"clientMutationId,omitempty"` } @@ -408,6 +580,8 @@ type CreatePullRequestInput struct { Body *String `json:"body,omitempty"` // Indicates whether maintainers can modify the pull request. (Optional.) MaintainerCanModify *Boolean `json:"maintainerCanModify,omitempty"` + // Indicates whether this pull request should be a draft. (Optional.) + Draft *Boolean `json:"draft,omitempty"` // A unique identifier for the client performing the mutation. (Optional.) ClientMutationID *String `json:"clientMutationId,omitempty"` } @@ -498,6 +672,24 @@ type DeleteBranchProtectionRuleInput struct { ClientMutationID *String `json:"clientMutationId,omitempty"` } +// DeleteDeploymentInput is an autogenerated input type of DeleteDeployment. +type DeleteDeploymentInput struct { + // The Node ID of the deployment to be deleted. (Required.) + ID ID `json:"id"` + + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + +// DeleteIpAllowListEntryInput is an autogenerated input type of DeleteIpAllowListEntry. +type DeleteIpAllowListEntryInput struct { + // The ID of the IP allow list entry to delete. (Required.) + IPAllowListEntryID ID `json:"ipAllowListEntryId"` + + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + // DeleteIssueCommentInput is an autogenerated input type of DeleteIssueComment. type DeleteIssueCommentInput struct { // The ID of the comment to delete. (Required.) @@ -516,15 +708,6 @@ type DeleteIssueInput struct { ClientMutationID *String `json:"clientMutationId,omitempty"` } -// DeletePackageVersionInput is an autogenerated input type of DeletePackageVersion. -type DeletePackageVersionInput struct { - // The ID of the package version to be deleted. (Required.) - PackageVersionID ID `json:"packageVersionId"` - - // A unique identifier for the client performing the mutation. (Optional.) - ClientMutationID *String `json:"clientMutationId,omitempty"` -} - // DeleteProjectCardInput is an autogenerated input type of DeleteProjectCard. type DeleteProjectCardInput struct { // The id of the card to delete. (Required.) @@ -626,6 +809,23 @@ type DraftPullRequestReviewComment struct { Body String `json:"body"` } +// DraftPullRequestReviewThread specifies a review comment thread to be left with a Pull Request Review. +type DraftPullRequestReviewThread struct { + // Path to the file being commented on. (Required.) + Path String `json:"path"` + // The line of the blob to which the thread refers. The end of the line range for multi-line comments. (Required.) + Line Int `json:"line"` + // Body of the comment to leave. (Required.) + Body String `json:"body"` + + // The side of the diff on which the line resides. For multi-line comments, this is the side for the end of the line range. (Optional.) + Side *DiffSide `json:"side,omitempty"` + // The first line of the range to which the comment refers. (Optional.) + StartLine *Int `json:"startLine,omitempty"` + // The side of the diff on which the start line resides. (Optional.) + StartSide *DiffSide `json:"startSide,omitempty"` +} + // EnterpriseAdministratorInvitationOrder represents ordering options for enterprise administrator invitation connections. type EnterpriseAdministratorInvitationOrder struct { // The field to order enterprise administrator invitations by. (Required.) @@ -642,14 +842,6 @@ type EnterpriseMemberOrder struct { Direction OrderDirection `json:"direction"` } -// EnterpriseOrder represents ordering options for enterprises. -type EnterpriseOrder struct { - // The field to order enterprises by. (Required.) - Field EnterpriseOrderField `json:"field"` - // The ordering direction. (Required.) - Direction OrderDirection `json:"direction"` -} - // EnterpriseServerInstallationOrder represents ordering options for Enterprise Server installation connections. type EnterpriseServerInstallationOrder struct { // The field to order Enterprise Server installations by. (Required.) @@ -699,23 +891,6 @@ type GistOrder struct { Direction OrderDirection `json:"direction"` } -// ImportProjectInput is an autogenerated input type of ImportProject. -type ImportProjectInput struct { - // The name of the Organization or User to create the Project under. (Required.) - OwnerName String `json:"ownerName"` - // The name of Project. (Required.) - Name String `json:"name"` - // A list of columns containing issues and pull requests. (Required.) - ColumnImports []ProjectColumnImport `json:"columnImports"` - - // The description of Project. (Optional.) - Body *String `json:"body,omitempty"` - // Whether the Project is public or not. (Optional.) - Public *Boolean `json:"public,omitempty"` - // A unique identifier for the client performing the mutation. (Optional.) - ClientMutationID *String `json:"clientMutationId,omitempty"` -} - // InviteEnterpriseAdminInput is an autogenerated input type of InviteEnterpriseAdmin. type InviteEnterpriseAdminInput struct { // The ID of the enterprise to which you want to invite an administrator. (Required.) @@ -731,6 +906,22 @@ type InviteEnterpriseAdminInput struct { ClientMutationID *String `json:"clientMutationId,omitempty"` } +// IpAllowListEntryOrder represents ordering options for IP allow list entry connections. +type IpAllowListEntryOrder struct { + // The field to order IP allow list entries by. (Required.) + Field IpAllowListEntryOrderField `json:"field"` + // The ordering direction. (Required.) + Direction OrderDirection `json:"direction"` +} + +// IssueCommentOrder represents ways in which lists of issue comments can be ordered upon return. +type IssueCommentOrder struct { + // The field in which to order issue comments by. (Required.) + Field IssueCommentOrderField `json:"field"` + // The direction in which to order issue comments by the specified field. (Required.) + Direction OrderDirection `json:"direction"` +} + // IssueFilters represents ways in which to filter lists of issues. type IssueFilters struct { @@ -760,6 +951,14 @@ type IssueOrder struct { Direction OrderDirection `json:"direction"` } +// LabelOrder represents ways in which lists of labels can be ordered upon return. +type LabelOrder struct { + // The field in which to order labels by. (Required.) + Field LabelOrderField `json:"field"` + // The direction in which to order labels by the specified field. (Required.) + Direction OrderDirection `json:"direction"` +} + // LanguageOrder represents ordering options for language connections. type LanguageOrder struct { // The field to order languages by. (Required.) @@ -781,15 +980,35 @@ type LinkRepositoryToProjectInput struct { // LockLockableInput is an autogenerated input type of LockLockable. type LockLockableInput struct { - // ID of the issue or pull request to be locked. (Required.) + // ID of the item to be locked. (Required.) LockableID ID `json:"lockableId"` - // A reason for why the issue or pull request will be locked. (Optional.) + // A reason for why the item will be locked. (Optional.) LockReason *LockReason `json:"lockReason,omitempty"` // A unique identifier for the client performing the mutation. (Optional.) ClientMutationID *String `json:"clientMutationId,omitempty"` } +// MarkFileAsViewedInput is an autogenerated input type of MarkFileAsViewed. +type MarkFileAsViewedInput struct { + // The Node ID of the pull request. (Required.) + PullRequestID ID `json:"pullRequestId"` + // The path of the file to mark as viewed. (Required.) + Path String `json:"path"` + + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + +// MarkPullRequestReadyForReviewInput is an autogenerated input type of MarkPullRequestReadyForReview. +type MarkPullRequestReadyForReviewInput struct { + // ID of the pull request to be marked as ready for review. (Required.) + PullRequestID ID `json:"pullRequestId"` + + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + // MergeBranchInput is an autogenerated input type of MergeBranch. type MergeBranchInput struct { // The Node ID of the Repository containing the base branch that will be modified. (Required.) @@ -801,6 +1020,8 @@ type MergeBranchInput struct { // Message to use for the merge commit. If omitted, a default will be used. (Optional.) CommitMessage *String `json:"commitMessage,omitempty"` + // The email address to associate with this commit. (Optional.) + AuthorEmail *String `json:"authorEmail,omitempty"` // A unique identifier for the client performing the mutation. (Optional.) ClientMutationID *String `json:"clientMutationId,omitempty"` } @@ -818,6 +1039,8 @@ type MergePullRequestInput struct { ExpectedHeadOid *GitObjectID `json:"expectedHeadOid,omitempty"` // The merge method to use. If omitted, defaults to 'MERGE'. (Optional.) MergeMethod *PullRequestMergeMethod `json:"mergeMethod,omitempty"` + // The email address to associate with this merge. (Optional.) + AuthorEmail *String `json:"authorEmail,omitempty"` // A unique identifier for the client performing the mutation. (Optional.) ClientMutationID *String `json:"clientMutationId,omitempty"` } @@ -873,32 +1096,31 @@ type OrganizationOrder struct { Direction OrderDirection `json:"direction"` } -// PinIssueInput is an autogenerated input type of PinIssue. -type PinIssueInput struct { - // The ID of the issue to be pinned. (Required.) - IssueID ID `json:"issueId"` +// PackageFileOrder represents ways in which lists of package files can be ordered upon return. +type PackageFileOrder struct { - // A unique identifier for the client performing the mutation. (Optional.) - ClientMutationID *String `json:"clientMutationId,omitempty"` + // The field in which to order package files by. (Optional.) + Field *PackageFileOrderField `json:"field,omitempty"` + // The direction in which to order package files by the specified field. (Optional.) + Direction *OrderDirection `json:"direction,omitempty"` } -// ProjectCardImport represents an issue or PR and its owning repository to be used in a project card. -type ProjectCardImport struct { - // Repository name with owner (owner/repository). (Required.) - Repository String `json:"repository"` - // The issue or pull request number. (Required.) - Number Int `json:"number"` +// PackageOrder represents ways in which lists of packages can be ordered upon return. +type PackageOrder struct { + + // The field in which to order packages by. (Optional.) + Field *PackageOrderField `json:"field,omitempty"` + // The direction in which to order packages by the specified field. (Optional.) + Direction *OrderDirection `json:"direction,omitempty"` } -// ProjectColumnImport represents a project column and a list of its issues and PRs. -type ProjectColumnImport struct { - // The name of the column. (Required.) - ColumnName String `json:"columnName"` - // The position of the column, starting from 0. (Required.) - Position Int `json:"position"` +// PackageVersionOrder represents ways in which lists of package versions can be ordered upon return. +type PackageVersionOrder struct { - // A list of issues and pull requests in the column. (Optional.) - Issues *[]ProjectCardImport `json:"issues,omitempty"` + // The field in which to order package versions by. (Optional.) + Field *PackageVersionOrderField `json:"field,omitempty"` + // The direction in which to order package versions by the specified field. (Optional.) + Direction *OrderDirection `json:"direction,omitempty"` } // ProjectOrder represents ways in which lists of projects can be ordered upon return. @@ -942,17 +1164,6 @@ type RegenerateEnterpriseIdentityProviderRecoveryCodesInput struct { ClientMutationID *String `json:"clientMutationId,omitempty"` } -// RegistryPackageMetadatum represents represents a single registry metadatum. -type RegistryPackageMetadatum struct { - // Name of the metadatum. (Required.) - Name String `json:"name"` - // Value of the metadatum. (Required.) - Value String `json:"value"` - - // True, if the metadatum can be updated if it already exists. (Optional.) - Update *Boolean `json:"update,omitempty"` -} - // ReleaseOrder represents ways in which lists of releases can be ordered upon return. type ReleaseOrder struct { // The field in which to order releases by. (Required.) @@ -983,6 +1194,15 @@ type RemoveEnterpriseAdminInput struct { ClientMutationID *String `json:"clientMutationId,omitempty"` } +// RemoveEnterpriseIdentityProviderInput is an autogenerated input type of RemoveEnterpriseIdentityProvider. +type RemoveEnterpriseIdentityProviderInput struct { + // The ID of the enterprise from which to remove the identity provider. (Required.) + EnterpriseID ID `json:"enterpriseId"` + + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + // RemoveEnterpriseOrganizationInput is an autogenerated input type of RemoveEnterpriseOrganization. type RemoveEnterpriseOrganizationInput struct { // The ID of the enterprise from which the organization should be removed. (Required.) @@ -1085,6 +1305,17 @@ type RequestReviewsInput struct { ClientMutationID *String `json:"clientMutationId,omitempty"` } +// RerequestCheckSuiteInput is an autogenerated input type of RerequestCheckSuite. +type RerequestCheckSuiteInput struct { + // The Node ID of the repository. (Required.) + RepositoryID ID `json:"repositoryId"` + // The Node ID of the check suite. (Required.) + CheckSuiteID ID `json:"checkSuiteId"` + + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + // ResolveReviewThreadInput is an autogenerated input type of ResolveReviewThread. type ResolveReviewThreadInput struct { // The ID of the thread to resolve. (Required.) @@ -1126,6 +1357,64 @@ type SecurityVulnerabilityOrder struct { Direction OrderDirection `json:"direction"` } +// SetEnterpriseIdentityProviderInput is an autogenerated input type of SetEnterpriseIdentityProvider. +type SetEnterpriseIdentityProviderInput struct { + // The ID of the enterprise on which to set an identity provider. (Required.) + EnterpriseID ID `json:"enterpriseId"` + // The URL endpoint for the identity provider's SAML SSO. (Required.) + SsoURL URI `json:"ssoUrl"` + // The x509 certificate used by the identity provider to sign assertions and responses. (Required.) + IdpCertificate String `json:"idpCertificate"` + // The signature algorithm used to sign SAML requests for the identity provider. (Required.) + SignatureMethod SamlSignatureAlgorithm `json:"signatureMethod"` + // The digest algorithm used to sign SAML requests for the identity provider. (Required.) + DigestMethod SamlDigestAlgorithm `json:"digestMethod"` + + // The Issuer Entity ID for the SAML identity provider. (Optional.) + Issuer *String `json:"issuer,omitempty"` + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + +// SetOrganizationInteractionLimitInput is an autogenerated input type of SetOrganizationInteractionLimit. +type SetOrganizationInteractionLimitInput struct { + // The ID of the organization to set a limit for. (Required.) + OrganizationID ID `json:"organizationId"` + // The limit to set. (Required.) + Limit RepositoryInteractionLimit `json:"limit"` + + // When this limit should expire. (Optional.) + Expiry *RepositoryInteractionLimitExpiry `json:"expiry,omitempty"` + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + +// SetRepositoryInteractionLimitInput is an autogenerated input type of SetRepositoryInteractionLimit. +type SetRepositoryInteractionLimitInput struct { + // The ID of the repository to set a limit for. (Required.) + RepositoryID ID `json:"repositoryId"` + // The limit to set. (Required.) + Limit RepositoryInteractionLimit `json:"limit"` + + // When this limit should expire. (Optional.) + Expiry *RepositoryInteractionLimitExpiry `json:"expiry,omitempty"` + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + +// SetUserInteractionLimitInput is an autogenerated input type of SetUserInteractionLimit. +type SetUserInteractionLimitInput struct { + // The ID of the user to set a limit for. (Required.) + UserID ID `json:"userId"` + // The limit to set. (Required.) + Limit RepositoryInteractionLimit `json:"limit"` + + // When this limit should expire. (Optional.) + Expiry *RepositoryInteractionLimitExpiry `json:"expiry,omitempty"` + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + // SponsorsTierOrder represents ordering options for Sponsors tiers connections. type SponsorsTierOrder struct { // The field to order tiers by. (Required.) @@ -1152,11 +1441,13 @@ type StarOrder struct { // SubmitPullRequestReviewInput is an autogenerated input type of SubmitPullRequestReview. type SubmitPullRequestReviewInput struct { - // The Pull Request Review ID to submit. (Required.) - PullRequestReviewID ID `json:"pullRequestReviewId"` // The event to send to the Pull Request Review. (Required.) Event PullRequestReviewEvent `json:"event"` + // The Pull Request ID to submit any pending reviews. (Optional.) + PullRequestID *ID `json:"pullRequestId,omitempty"` + // The Pull Request Review ID to submit. (Optional.) + PullRequestReviewID *ID `json:"pullRequestReviewId,omitempty"` // The text field to set on the Pull Request Review. (Optional.) Body *String `json:"body,omitempty"` // A unique identifier for the client performing the mutation. (Optional.) @@ -1245,13 +1536,24 @@ type UnlinkRepositoryFromProjectInput struct { // UnlockLockableInput is an autogenerated input type of UnlockLockable. type UnlockLockableInput struct { - // ID of the issue or pull request to be unlocked. (Required.) + // ID of the item to be unlocked. (Required.) LockableID ID `json:"lockableId"` // A unique identifier for the client performing the mutation. (Optional.) ClientMutationID *String `json:"clientMutationId,omitempty"` } +// UnmarkFileAsViewedInput is an autogenerated input type of UnmarkFileAsViewed. +type UnmarkFileAsViewedInput struct { + // The Node ID of the pull request. (Required.) + PullRequestID ID `json:"pullRequestId"` + // The path of the file to mark as unviewed. (Required.) + Path String `json:"path"` + + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + // UnmarkIssueAsDuplicateInput is an autogenerated input type of UnmarkIssueAsDuplicate. type UnmarkIssueAsDuplicateInput struct { // ID of the issue or pull request currently marked as a duplicate. (Required.) @@ -1272,15 +1574,6 @@ type UnminimizeCommentInput struct { ClientMutationID *String `json:"clientMutationId,omitempty"` } -// UnpinIssueInput is an autogenerated input type of UnpinIssue. -type UnpinIssueInput struct { - // The ID of the issue to be unpinned. (Required.) - IssueID ID `json:"issueId"` - - // A unique identifier for the client performing the mutation. (Optional.) - ClientMutationID *String `json:"clientMutationId,omitempty"` -} - // UnresolveReviewThreadInput is an autogenerated input type of UnresolveReviewThread. type UnresolveReviewThreadInput struct { // The ID of the thread to unresolve. (Required.) @@ -1303,6 +1596,12 @@ type UpdateBranchProtectionRuleInput struct { RequiredApprovingReviewCount *Int `json:"requiredApprovingReviewCount,omitempty"` // Are commits required to be signed. (Optional.) RequiresCommitSignatures *Boolean `json:"requiresCommitSignatures,omitempty"` + // Are merge commits prohibited from being pushed to this branch. (Optional.) + RequiresLinearHistory *Boolean `json:"requiresLinearHistory,omitempty"` + // Are force pushes allowed on this branch. (Optional.) + AllowsForcePushes *Boolean `json:"allowsForcePushes,omitempty"` + // Can this branch be deleted. (Optional.) + AllowsDeletions *Boolean `json:"allowsDeletions,omitempty"` // Can admins overwrite branch protection. (Optional.) IsAdminEnforced *Boolean `json:"isAdminEnforced,omitempty"` // Are status checks required to update matching branches. (Optional.) @@ -1327,12 +1626,41 @@ type UpdateBranchProtectionRuleInput struct { ClientMutationID *String `json:"clientMutationId,omitempty"` } -// UpdateEnterpriseActionExecutionCapabilitySettingInput is an autogenerated input type of UpdateEnterpriseActionExecutionCapabilitySetting. -type UpdateEnterpriseActionExecutionCapabilitySettingInput struct { - // The ID of the enterprise on which to set the members can create repositories setting. (Required.) - EnterpriseID ID `json:"enterpriseId"` - // The value for the action execution capability setting on the enterprise. (Required.) - Capability ActionExecutionCapabilitySetting `json:"capability"` +// UpdateCheckRunInput is an autogenerated input type of UpdateCheckRun. +type UpdateCheckRunInput struct { + // The node ID of the repository. (Required.) + RepositoryID ID `json:"repositoryId"` + // The node of the check. (Required.) + CheckRunID ID `json:"checkRunId"` + + // The name of the check. (Optional.) + Name *String `json:"name,omitempty"` + // The URL of the integrator's site that has the full details of the check. (Optional.) + DetailsURL *URI `json:"detailsUrl,omitempty"` + // A reference for the run on the integrator's system. (Optional.) + ExternalID *String `json:"externalId,omitempty"` + // The current status. (Optional.) + Status *RequestableCheckStatusState `json:"status,omitempty"` + // The time that the check run began. (Optional.) + StartedAt *DateTime `json:"startedAt,omitempty"` + // The final conclusion of the check. (Optional.) + Conclusion *CheckConclusionState `json:"conclusion,omitempty"` + // The time that the check run finished. (Optional.) + CompletedAt *DateTime `json:"completedAt,omitempty"` + // Descriptive details about the run. (Optional.) + Output *CheckRunOutput `json:"output,omitempty"` + // Possible further actions the integrator can perform, which a user may trigger. (Optional.) + Actions *[]CheckRunAction `json:"actions,omitempty"` + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + +// UpdateCheckSuitePreferencesInput is an autogenerated input type of UpdateCheckSuitePreferences. +type UpdateCheckSuitePreferencesInput struct { + // The Node ID of the repository. (Required.) + RepositoryID ID `json:"repositoryId"` + // The check suite preferences to modify. (Required.) + AutoTriggerPreferences []CheckSuiteAutoTriggerPreference `json:"autoTriggerPreferences"` // A unique identifier for the client performing the mutation. (Optional.) ClientMutationID *String `json:"clientMutationId,omitempty"` @@ -1530,6 +1858,32 @@ type UpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput struct { ClientMutationID *String `json:"clientMutationId,omitempty"` } +// UpdateIpAllowListEnabledSettingInput is an autogenerated input type of UpdateIpAllowListEnabledSetting. +type UpdateIpAllowListEnabledSettingInput struct { + // The ID of the owner on which to set the IP allow list enabled setting. (Required.) + OwnerID ID `json:"ownerId"` + // The value for the IP allow list enabled setting. (Required.) + SettingValue IpAllowListEnabledSettingValue `json:"settingValue"` + + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + +// UpdateIpAllowListEntryInput is an autogenerated input type of UpdateIpAllowListEntry. +type UpdateIpAllowListEntryInput struct { + // The ID of the IP allow list entry to update. (Required.) + IPAllowListEntryID ID `json:"ipAllowListEntryId"` + // An IP address or range of addresses in CIDR notation. (Required.) + AllowListValue String `json:"allowListValue"` + // Whether the IP allow list entry is active when an IP allow list is enabled. (Required.) + IsActive Boolean `json:"isActive"` + + // An optional name for the IP allow list entry. (Optional.) + Name *String `json:"name,omitempty"` + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + // UpdateIssueCommentInput is an autogenerated input type of UpdateIssueComment. type UpdateIssueCommentInput struct { // The ID of the IssueComment to modify. (Required.) diff --git a/vendor/modules.txt b/vendor/modules.txt index a8312c65e5..73d13f6b57 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -364,7 +364,7 @@ github.com/ryancurrah/gomodguard # github.com/securego/gosec v0.0.0-20200316084457-7da9f46445fd github.com/securego/gosec github.com/securego/gosec/rules -# github.com/shurcooL/githubv4 v0.0.0-20191127044304-8f68eb5628d0 +# github.com/shurcooL/githubv4 v0.0.0-20201206200315-234843c633fa github.com/shurcooL/githubv4 # github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f github.com/shurcooL/graphql diff --git a/website/docs/r/branch_protection.html.markdown b/website/docs/r/branch_protection.html.markdown index c74fac620a..ef63393ed5 100644 --- a/website/docs/r/branch_protection.html.markdown +++ b/website/docs/r/branch_protection.html.markdown @@ -24,8 +24,9 @@ resource "github_branch_protection" "example" { # also accepts repository name # repository_id = github_repository.example.name - pattern = "main" - enforce_admins = true + pattern = "main" + enforce_admins = true + allows_deletions = true required_status_checks { strict = false @@ -74,6 +75,8 @@ The following arguments are supported: * `required_status_checks` - (Optional) Enforce restrictions for required status checks. See [Required Status Checks](#required-status-checks) below for details. * `required_pull_request_reviews` - (Optional) Enforce restrictions for pull request reviews. See [Required Pull Request Reviews](#required-pull-request-reviews) below for details. * `push_restrictions` - (Optional) The list of actor IDs that may push to the branch. +* `allows_deletions` - (Optional) Boolean, setting this to `true` to allow the branch to be deleted. +* `allows_force_pushes` - (Optional) Boolean, setting this to `true` to allow force pushes on the branch. ### Required Status Checks