diff --git a/github/resource_github_branch_protection.go b/github/resource_github_branch_protection.go index ca6e3b2109..73162cdc65 100644 --- a/github/resource_github_branch_protection.go +++ b/github/resource_github_branch_protection.go @@ -38,6 +38,11 @@ func resourceGithubBranchProtection() *schema.Resource { Optional: true, Default: false, }, + PROTECTION_BLOCKS_CREATIONS: { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, PROTECTION_IS_ADMIN_ENFORCED: { Type: schema.TypeBool, Optional: true, @@ -152,6 +157,7 @@ func resourceGithubBranchProtectionCreate(d *schema.ResourceData, meta interface input := githubv4.CreateBranchProtectionRuleInput{ AllowsDeletions: githubv4.NewBoolean(githubv4.Boolean(data.AllowsDeletions)), AllowsForcePushes: githubv4.NewBoolean(githubv4.Boolean(data.AllowsForcePushes)), + BlocksCreations: githubv4.NewBoolean(githubv4.Boolean(data.BlocksCreations)), BypassPullRequestActorIDs: githubv4NewIDSlice(githubv4IDSliceEmpty(data.BypassPullRequestActorIDs)), DismissesStaleReviews: githubv4.NewBoolean(githubv4.Boolean(data.DismissesStaleReviews)), IsAdminEnforced: githubv4.NewBoolean(githubv4.Boolean(data.IsAdminEnforced)), @@ -224,6 +230,11 @@ func resourceGithubBranchProtectionRead(d *schema.ResourceData, meta interface{} log.Printf("[DEBUG] Problem setting '%s' in %s %s branch protection (%s)", PROTECTION_ALLOWS_FORCE_PUSHES, protection.Repository.Name, protection.Pattern, d.Id()) } + err = d.Set(PROTECTION_BLOCKS_CREATIONS, protection.BlocksCreations) + if err != nil { + log.Printf("[DEBUG] Problem setting '%s' in %s %s branch protection (%s)", PROTECTION_BLOCKS_CREATIONS, protection.Repository.Name, protection.Pattern, d.Id()) + } + err = d.Set(PROTECTION_IS_ADMIN_ENFORCED, protection.IsAdminEnforced) if err != nil { log.Printf("[DEBUG] Problem setting '%s' in %s %s branch protection (%s)", PROTECTION_IS_ADMIN_ENFORCED, protection.Repository.Name, protection.Pattern, d.Id()) @@ -281,6 +292,7 @@ func resourceGithubBranchProtectionUpdate(d *schema.ResourceData, meta interface BranchProtectionRuleID: d.Id(), AllowsDeletions: githubv4.NewBoolean(githubv4.Boolean(data.AllowsDeletions)), AllowsForcePushes: githubv4.NewBoolean(githubv4.Boolean(data.AllowsForcePushes)), + BlocksCreations: githubv4.NewBoolean(githubv4.Boolean(data.BlocksCreations)), BypassPullRequestActorIDs: githubv4NewIDSlice(githubv4IDSliceEmpty(data.BypassPullRequestActorIDs)), DismissesStaleReviews: githubv4.NewBoolean(githubv4.Boolean(data.DismissesStaleReviews)), IsAdminEnforced: githubv4.NewBoolean(githubv4.Boolean(data.IsAdminEnforced)), diff --git a/github/resource_github_branch_protection_test.go b/github/resource_github_branch_protection_test.go index 65cadd0957..492a7d935e 100644 --- a/github/resource_github_branch_protection_test.go +++ b/github/resource_github_branch_protection_test.go @@ -438,6 +438,60 @@ func TestAccGithubBranchProtection(t *testing.T) { }) + t.Run("configures blocksCreations", 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" + blocks_creations = true + + } + `, randomID, testOwnerFunc()) + + check := resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr( + "github_branch_protection.test", "blocks_creations", "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) + }) + + }) + t.Run("configures non-empty list of pull request bypassers", func(t *testing.T) { config := fmt.Sprintf(` diff --git a/github/util_v4_branch_protection.go b/github/util_v4_branch_protection.go index ef6be1ff76..a06cd22d47 100644 --- a/github/util_v4_branch_protection.go +++ b/github/util_v4_branch_protection.go @@ -51,6 +51,7 @@ type BranchProtectionRule struct { } `graphql:"bypassPullRequestAllowances(first: 100)"` AllowsDeletions githubv4.Boolean AllowsForcePushes githubv4.Boolean + BlocksCreations githubv4.Boolean DismissesStaleReviews githubv4.Boolean ID githubv4.ID IsAdminEnforced githubv4.Boolean @@ -71,6 +72,7 @@ type BranchProtectionRule struct { type BranchProtectionResourceData struct { AllowsDeletions bool AllowsForcePushes bool + BlocksCreations bool BranchProtectionRuleID string BypassPullRequestActorIDs []string DismissesStaleReviews bool @@ -115,6 +117,10 @@ func branchProtectionResourceData(d *schema.ResourceData, meta interface{}) (Bra data.AllowsForcePushes = v.(bool) } + if v, ok := d.GetOk(PROTECTION_BLOCKS_CREATIONS); ok { + data.BlocksCreations = 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 804fb49575..c0d9ac209f 100644 --- a/github/util_v4_consts.go +++ b/github/util_v4_consts.go @@ -3,6 +3,7 @@ package github const ( PROTECTION_ALLOWS_DELETIONS = "allows_deletions" PROTECTION_ALLOWS_FORCE_PUSHES = "allows_force_pushes" + PROTECTION_BLOCKS_CREATIONS = "blocks_creations" 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 cf6964431d..35abc3972f 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/hashicorp/hcl/v2 v2.3.0 // indirect github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7 // indirect github.com/hashicorp/terraform-plugin-sdk v1.7.0 - github.com/shurcooL/githubv4 v0.0.0-20220106005112-0707a5a90543 + github.com/shurcooL/githubv4 v0.0.0-20220520033151-0b4e3294ff00 github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29 // indirect github.com/ulikunitz/xz v0.5.10 // indirect golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 diff --git a/go.sum b/go.sum index 0cb178971c..85226c2e3b 100644 --- a/go.sum +++ b/go.sum @@ -360,8 +360,8 @@ github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc= github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= -github.com/shurcooL/githubv4 v0.0.0-20220106005112-0707a5a90543 h1:TLml5yQBxKTGrjQQUt+fMcJNNIUyNH0wDeCVGyaLF+s= -github.com/shurcooL/githubv4 v0.0.0-20220106005112-0707a5a90543/go.mod h1:hAF0iLZy4td2EX+/8Tw+4nodhlMrwN3HupfaXj3zkGo= +github.com/shurcooL/githubv4 v0.0.0-20220520033151-0b4e3294ff00 h1:fiFvD4lT0aWjuuAb64LlZ/67v87m+Kc9Qsu5cMFNK0w= +github.com/shurcooL/githubv4 v0.0.0-20220520033151-0b4e3294ff00/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 8516d3bdc0..b62f6bb8d3 100644 --- a/vendor/github.com/shurcooL/githubv4/README.md +++ b/vendor/github.com/shurcooL/githubv4/README.md @@ -329,7 +329,7 @@ variables := map[string]interface{}{ // Get comments from all pages. var allComments []comment for { - err := s.clQL.Query(ctx, &q, variables) + err := client.Query(ctx, &q, variables) if err != nil { return err } diff --git a/vendor/github.com/shurcooL/githubv4/deprecated.go b/vendor/github.com/shurcooL/githubv4/deprecated.go new file mode 100644 index 0000000000..dd430762b7 --- /dev/null +++ b/vendor/github.com/shurcooL/githubv4/deprecated.go @@ -0,0 +1,8 @@ +package githubv4 + +const ( + // IssueHunt funding platform. + // + // Deprecated: Use FundingPlatformIssueHunt instead. This will be deleted after 2022-11-19. + FundingPlatformIssuehunt = FundingPlatformIssueHunt +) diff --git a/vendor/github.com/shurcooL/githubv4/enum.go b/vendor/github.com/shurcooL/githubv4/enum.go index 61fc573b83..a31baf1ecb 100644 --- a/vendor/github.com/shurcooL/githubv4/enum.go +++ b/vendor/github.com/shurcooL/githubv4/enum.go @@ -2,6 +2,15 @@ package githubv4 +// ActorType represents the actor's type. +type ActorType string + +// The actor's type. +const ( + ActorTypeUser ActorType = "USER" // Indicates a user actor. + ActorTypeTeam ActorType = "TEAM" // Indicates a team actor. +) + // AuditLogOrderField represents properties by which Audit Log connections can be ordered. type AuditLogOrderField string @@ -129,6 +138,21 @@ const ( DefaultRepositoryPermissionFieldAdmin DefaultRepositoryPermissionField = "ADMIN" // Can read, write, and administrate repos by default. ) +// DependencyGraphEcosystem represents the possible ecosystems of a dependency graph package. +type DependencyGraphEcosystem string + +// The possible ecosystems of a dependency graph package. +const ( + DependencyGraphEcosystemRubygems DependencyGraphEcosystem = "RUBYGEMS" // Ruby gems hosted at RubyGems.org. + DependencyGraphEcosystemNpm DependencyGraphEcosystem = "NPM" // JavaScript packages hosted at npmjs.com. + DependencyGraphEcosystemPip DependencyGraphEcosystem = "PIP" // Python packages hosted at PyPI.org. + DependencyGraphEcosystemMaven DependencyGraphEcosystem = "MAVEN" // Java artifacts hosted at the Maven central repository. + DependencyGraphEcosystemNuget DependencyGraphEcosystem = "NUGET" // .NET packages hosted at the NuGet Gallery. + DependencyGraphEcosystemComposer DependencyGraphEcosystem = "COMPOSER" // PHP packages hosted at packagist.org. + DependencyGraphEcosystemGo DependencyGraphEcosystem = "GO" // Go modules. + DependencyGraphEcosystemActions DependencyGraphEcosystem = "ACTIONS" // GitHub Actions. +) + // DeploymentOrderField represents properties by which deployment connections can be ordered. type DeploymentOrderField string @@ -380,8 +404,9 @@ const ( FundingPlatformTidelift FundingPlatform = "TIDELIFT" // Tidelift funding platform. FundingPlatformCommunityBridge FundingPlatform = "COMMUNITY_BRIDGE" // Community Bridge funding platform. FundingPlatformLiberapay FundingPlatform = "LIBERAPAY" // Liberapay funding platform. - FundingPlatformIssuehunt FundingPlatform = "ISSUEHUNT" // IssueHunt funding platform. + FundingPlatformIssueHunt FundingPlatform = "ISSUEHUNT" // IssueHunt funding platform. FundingPlatformOtechie FundingPlatform = "OTECHIE" // Otechie funding platform. + FundingPlatformLFXCrowdfunding FundingPlatform = "LFX_CROWDFUNDING" // LFX Crowdfunding funding platform. FundingPlatformCustom FundingPlatform = "CUSTOM" // Custom funding platform. ) @@ -569,6 +594,30 @@ const ( MergeableStateUnknown MergeableState = "UNKNOWN" // The mergeability of the pull request is still being calculated. ) +// MigrationSourceType represents represents the different Octoshift migration sources. +type MigrationSourceType string + +// Represents the different Octoshift migration sources. +const ( + MigrationSourceTypeGitLab MigrationSourceType = "GITLAB" // A GitLab migration source. + MigrationSourceTypeAzureDevOps MigrationSourceType = "AZURE_DEVOPS" // An Azure DevOps migration source. + MigrationSourceTypeBitbucketServer MigrationSourceType = "BITBUCKET_SERVER" // A Bitbucket Server migration source. + MigrationSourceTypeGitHub MigrationSourceType = "GITHUB" // A GitHub migration source. + MigrationSourceTypeGitHubArchive MigrationSourceType = "GITHUB_ARCHIVE" // A GitHub Migration API source. +) + +// MigrationState represents the Octoshift migration state. +type MigrationState string + +// The Octoshift migration state. +const ( + MigrationStateNotStarted MigrationState = "NOT_STARTED" // The Octoshift migration has not started. + MigrationStateQueued MigrationState = "QUEUED" // The Octoshift migration has been queued. + MigrationStateInProgress MigrationState = "IN_PROGRESS" // The Octoshift migration is in progress. + MigrationStateSucceeded MigrationState = "SUCCEEDED" // The Octoshift migration has succeeded. + MigrationStateFailed MigrationState = "FAILED" // The Octoshift migration has failed. +) + // MilestoneOrderField represents properties by which milestone connections can be ordered. type MilestoneOrderField string @@ -843,6 +892,19 @@ const ( PackageVersionOrderFieldCreatedAt PackageVersionOrderField = "CREATED_AT" // Order package versions by creation time. ) +// PatchStatus represents the possible types of patch statuses. +type PatchStatus string + +// The possible types of patch statuses. +const ( + PatchStatusAdded PatchStatus = "ADDED" // The file was added. Git status 'A'. + PatchStatusDeleted PatchStatus = "DELETED" // The file was deleted. Git status 'D'. + PatchStatusRenamed PatchStatus = "RENAMED" // The file was renamed. Git status 'R'. + PatchStatusCopied PatchStatus = "COPIED" // The file was copied. Git status 'C'. + PatchStatusModified PatchStatus = "MODIFIED" // The file's contents were changed. Git status 'M'. + PatchStatusChanged PatchStatus = "CHANGED" // The file's type was changed. Git status 'T'. +) + // PinnableItemType represents represents items that can be pinned to a profile page or dashboard. type PinnableItemType string @@ -912,6 +974,37 @@ const ( ProjectColumnPurposeDone ProjectColumnPurpose = "DONE" // The column contains cards which are complete. ) +// ProjectItemType represents the type of a project item. +type ProjectItemType string + +// The type of a project item. +const ( + ProjectItemTypeIssue ProjectItemType = "ISSUE" // Issue. + ProjectItemTypePullRequest ProjectItemType = "PULL_REQUEST" // Pull Request. + ProjectItemTypeDraftIssue ProjectItemType = "DRAFT_ISSUE" // Draft Issue. + ProjectItemTypeRedacted ProjectItemType = "REDACTED" // Redacted Item. +) + +// ProjectNextFieldType represents the type of a project next field. +type ProjectNextFieldType string + +// The type of a project next field. +const ( + ProjectNextFieldTypeAssignees ProjectNextFieldType = "ASSIGNEES" // Assignees. + ProjectNextFieldTypeLinkedPullRequests ProjectNextFieldType = "LINKED_PULL_REQUESTS" // Linked Pull Requests. + ProjectNextFieldTypeReviewers ProjectNextFieldType = "REVIEWERS" // Reviewers. + ProjectNextFieldTypeLabels ProjectNextFieldType = "LABELS" // Labels. + ProjectNextFieldTypeMilestone ProjectNextFieldType = "MILESTONE" // Milestone. + ProjectNextFieldTypeRepository ProjectNextFieldType = "REPOSITORY" // Repository. + ProjectNextFieldTypeTitle ProjectNextFieldType = "TITLE" // Title. + ProjectNextFieldTypeText ProjectNextFieldType = "TEXT" // Text. + ProjectNextFieldTypeSingleSelect ProjectNextFieldType = "SINGLE_SELECT" // Single Select. + ProjectNextFieldTypeNumber ProjectNextFieldType = "NUMBER" // Number. + ProjectNextFieldTypeDate ProjectNextFieldType = "DATE" // Date. + ProjectNextFieldTypeIteration ProjectNextFieldType = "ITERATION" // Iteration. + ProjectNextFieldTypeTracks ProjectNextFieldType = "TRACKS" // Tracks. +) + // ProjectNextOrderField represents properties by which the return project can be ordered. type ProjectNextOrderField string @@ -953,6 +1046,15 @@ const ( ProjectTemplateBugTriage ProjectTemplate = "BUG_TRIAGE" // Create a board to triage and prioritize bugs with To do, priority, and Done columns. ) +// ProjectViewLayout represents the layout of a project view. +type ProjectViewLayout string + +// The layout of a project view. +const ( + ProjectViewLayoutBoardLayout ProjectViewLayout = "BOARD_LAYOUT" // Board layout. + ProjectViewLayoutTableLayout ProjectViewLayout = "TABLE_LAYOUT" // Table layout. +) + // PullRequestMergeMethod represents represents available types of methods to use when merging a pull request. type PullRequestMergeMethod string @@ -1054,6 +1156,8 @@ const ( 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. + PullRequestTimelineItemsItemTypeAddedToMergeQueueEvent PullRequestTimelineItemsItemType = "ADDED_TO_MERGE_QUEUE_EVENT" // Represents an 'added_to_merge_queue' event on a given pull request. + PullRequestTimelineItemsItemTypeRemovedFromMergeQueueEvent PullRequestTimelineItemsItemType = "REMOVED_FROM_MERGE_QUEUE_EVENT" // Represents a 'removed_from_merge_queue' 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. @@ -1280,8 +1384,7 @@ type RepositoryInvitationOrderField string // Properties by which repository invitation connections can be ordered. const ( - RepositoryInvitationOrderFieldCreatedAt RepositoryInvitationOrderField = "CREATED_AT" // Order repository invitations by creation time. - RepositoryInvitationOrderFieldInviteeLogin RepositoryInvitationOrderField = "INVITEE_LOGIN" // Order repository invitations by invitee login. + RepositoryInvitationOrderFieldCreatedAt RepositoryInvitationOrderField = "CREATED_AT" // Order repository invitations by creation time. ) // RepositoryLockReason represents the possible reasons a given repository could be in a locked state. @@ -1295,6 +1398,23 @@ const ( RepositoryLockReasonMigrating RepositoryLockReason = "MIGRATING" // The repository is locked due to a migration. ) +// RepositoryMigrationOrderDirection represents possible directions in which to order a list of repository migrations when provided an `orderBy` argument. +type RepositoryMigrationOrderDirection string + +// Possible directions in which to order a list of repository migrations when provided an `orderBy` argument. +const ( + RepositoryMigrationOrderDirectionAsc RepositoryMigrationOrderDirection = "ASC" // Specifies an ascending order for a given `orderBy` argument. + RepositoryMigrationOrderDirectionDesc RepositoryMigrationOrderDirection = "DESC" // Specifies a descending order for a given `orderBy` argument. +) + +// RepositoryMigrationOrderField represents properties by which repository migrations can be ordered. +type RepositoryMigrationOrderField string + +// Properties by which repository migrations can be ordered. +const ( + RepositoryMigrationOrderFieldCreatedAt RepositoryMigrationOrderField = "CREATED_AT" // Order mannequins why when they were created. +) + // RepositoryOrderField represents properties by which repository connections can be ordered. type RepositoryOrderField string @@ -1338,6 +1458,16 @@ const ( RepositoryVisibilityInternal RepositoryVisibility = "INTERNAL" // The repository is visible only to users in the same business. ) +// RepositoryVulnerabilityAlertState represents the possible states of an alert. +type RepositoryVulnerabilityAlertState string + +// The possible states of an alert. +const ( + RepositoryVulnerabilityAlertStateOpen RepositoryVulnerabilityAlertState = "OPEN" // An alert that is still open. + RepositoryVulnerabilityAlertStateFixed RepositoryVulnerabilityAlertState = "FIXED" // An alert that has been resolved by a code change. + RepositoryVulnerabilityAlertStateDismissed RepositoryVulnerabilityAlertState = "DISMISSED" // An alert that has been manually closed by a user. +) + // RequestableCheckStatusState represents the possible states that can be requested when creating a check run. type RequestableCheckStatusState string @@ -1669,6 +1799,15 @@ const ( TopicSuggestionDeclineReasonTooGeneral TopicSuggestionDeclineReason = "TOO_GENERAL" // The suggested topic is too general for the repository. ) +// TrackedIssueStates represents the possible states of a tracked issue. +type TrackedIssueStates string + +// The possible states of a tracked issue. +const ( + TrackedIssueStatesOpen TrackedIssueStates = "OPEN" // The tracked issue is open. + TrackedIssueStatesClosed TrackedIssueStates = "CLOSED" // The tracked issue is closed. +) + // UserBlockDuration represents the possible durations that a user can be blocked for. type UserBlockDuration string diff --git a/vendor/github.com/shurcooL/githubv4/input.go b/vendor/github.com/shurcooL/githubv4/input.go index 37ee58231a..3433a25b70 100644 --- a/vendor/github.com/shurcooL/githubv4/input.go +++ b/vendor/github.com/shurcooL/githubv4/input.go @@ -4,9 +4,18 @@ package githubv4 // Input represents one of the Input structs: // -// AcceptEnterpriseAdministratorInvitationInput, AcceptTopicSuggestionInput, AddAssigneesToAssignableInput, AddCommentInput, AddDiscussionCommentInput, AddEnterpriseSupportEntitlementInput, AddLabelsToLabelableInput, AddProjectCardInput, AddProjectColumnInput, AddProjectNextItemInput, AddPullRequestReviewCommentInput, AddPullRequestReviewInput, AddPullRequestReviewThreadInput, AddReactionInput, AddStarInput, AddUpvoteInput, AddVerifiableDomainInput, ApproveDeploymentsInput, ApproveVerifiableDomainInput, ArchiveRepositoryInput, AuditLogOrder, CancelEnterpriseAdminInvitationInput, CancelSponsorshipInput, ChangeUserStatusInput, CheckAnnotationData, CheckAnnotationRange, CheckRunAction, CheckRunFilter, CheckRunOutput, CheckRunOutputImage, CheckSuiteAutoTriggerPreference, CheckSuiteFilter, ClearLabelsFromLabelableInput, CloneProjectInput, CloneTemplateRepositoryInput, CloseIssueInput, ClosePullRequestInput, CommitAuthor, CommitContributionOrder, CommitMessage, CommittableBranch, ContributionOrder, ConvertProjectCardNoteToIssueInput, ConvertPullRequestToDraftInput, CreateBranchProtectionRuleInput, CreateCheckRunInput, CreateCheckSuiteInput, CreateCommitOnBranchInput, CreateDiscussionInput, CreateEnterpriseOrganizationInput, CreateEnvironmentInput, CreateIpAllowListEntryInput, CreateIssueInput, CreateProjectInput, CreatePullRequestInput, CreateRefInput, CreateRepositoryInput, CreateSponsorshipInput, CreateTeamDiscussionCommentInput, CreateTeamDiscussionInput, DeclineTopicSuggestionInput, DeleteBranchProtectionRuleInput, DeleteDeploymentInput, DeleteDiscussionCommentInput, DeleteDiscussionInput, DeleteEnvironmentInput, DeleteIpAllowListEntryInput, DeleteIssueCommentInput, DeleteIssueInput, DeleteProjectCardInput, DeleteProjectColumnInput, DeleteProjectInput, DeleteProjectNextItemInput, DeletePullRequestReviewCommentInput, DeletePullRequestReviewInput, DeleteRefInput, DeleteTeamDiscussionCommentInput, DeleteTeamDiscussionInput, DeleteVerifiableDomainInput, DeploymentOrder, DisablePullRequestAutoMergeInput, DiscussionOrder, DismissPullRequestReviewInput, DismissRepositoryVulnerabilityAlertInput, DraftPullRequestReviewComment, DraftPullRequestReviewThread, EnablePullRequestAutoMergeInput, EnterpriseAdministratorInvitationOrder, EnterpriseMemberOrder, EnterpriseServerInstallationOrder, EnterpriseServerUserAccountEmailOrder, EnterpriseServerUserAccountOrder, EnterpriseServerUserAccountsUploadOrder, FileAddition, FileChanges, FileDeletion, FollowUserInput, GistOrder, InviteEnterpriseAdminInput, IpAllowListEntryOrder, IssueCommentOrder, IssueFilters, IssueOrder, LabelOrder, LanguageOrder, LinkRepositoryToProjectInput, LockLockableInput, MarkDiscussionCommentAsAnswerInput, MarkFileAsViewedInput, MarkPullRequestReadyForReviewInput, MergeBranchInput, MergePullRequestInput, MilestoneOrder, MinimizeCommentInput, MoveProjectCardInput, MoveProjectColumnInput, OrgEnterpriseOwnerOrder, OrganizationOrder, PackageFileOrder, PackageOrder, PackageVersionOrder, PinIssueInput, ProjectOrder, PullRequestOrder, ReactionOrder, RefOrder, RegenerateEnterpriseIdentityProviderRecoveryCodesInput, RegenerateVerifiableDomainTokenInput, RejectDeploymentsInput, ReleaseOrder, RemoveAssigneesFromAssignableInput, RemoveEnterpriseAdminInput, RemoveEnterpriseIdentityProviderInput, RemoveEnterpriseOrganizationInput, RemoveEnterpriseSupportEntitlementInput, RemoveLabelsFromLabelableInput, RemoveOutsideCollaboratorInput, RemoveReactionInput, RemoveStarInput, RemoveUpvoteInput, ReopenIssueInput, ReopenPullRequestInput, RepositoryInvitationOrder, RepositoryOrder, RequestReviewsInput, RequiredStatusCheckInput, RerequestCheckSuiteInput, ResolveReviewThreadInput, SavedReplyOrder, SecurityAdvisoryIdentifierFilter, SecurityAdvisoryOrder, SecurityVulnerabilityOrder, SetEnterpriseIdentityProviderInput, SetOrganizationInteractionLimitInput, SetRepositoryInteractionLimitInput, SetUserInteractionLimitInput, SponsorOrder, SponsorableOrder, SponsorsActivityOrder, SponsorsTierOrder, SponsorshipNewsletterOrder, SponsorshipOrder, StarOrder, SubmitPullRequestReviewInput, TeamDiscussionCommentOrder, TeamDiscussionOrder, TeamMemberOrder, TeamOrder, TeamRepositoryOrder, TransferIssueInput, UnarchiveRepositoryInput, UnfollowUserInput, UnlinkRepositoryFromProjectInput, UnlockLockableInput, UnmarkDiscussionCommentAsAnswerInput, UnmarkFileAsViewedInput, UnmarkIssueAsDuplicateInput, UnminimizeCommentInput, UnpinIssueInput, UnresolveReviewThreadInput, UpdateBranchProtectionRuleInput, UpdateCheckRunInput, UpdateCheckSuitePreferencesInput, UpdateDiscussionCommentInput, UpdateDiscussionInput, UpdateEnterpriseAdministratorRoleInput, UpdateEnterpriseAllowPrivateRepositoryForkingSettingInput, UpdateEnterpriseDefaultRepositoryPermissionSettingInput, UpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput, UpdateEnterpriseMembersCanCreateRepositoriesSettingInput, UpdateEnterpriseMembersCanDeleteIssuesSettingInput, UpdateEnterpriseMembersCanDeleteRepositoriesSettingInput, UpdateEnterpriseMembersCanInviteCollaboratorsSettingInput, UpdateEnterpriseMembersCanMakePurchasesSettingInput, UpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput, UpdateEnterpriseMembersCanViewDependencyInsightsSettingInput, UpdateEnterpriseOrganizationProjectsSettingInput, UpdateEnterpriseProfileInput, UpdateEnterpriseRepositoryProjectsSettingInput, UpdateEnterpriseTeamDiscussionsSettingInput, UpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput, UpdateEnvironmentInput, UpdateIpAllowListEnabledSettingInput, UpdateIpAllowListEntryInput, UpdateIpAllowListForInstalledAppsEnabledSettingInput, UpdateIssueCommentInput, UpdateIssueInput, UpdateNotificationRestrictionSettingInput, UpdateOrganizationAllowPrivateRepositoryForkingSettingInput, UpdateProjectCardInput, UpdateProjectColumnInput, UpdateProjectInput, UpdateProjectNextItemFieldInput, UpdatePullRequestBranchInput, UpdatePullRequestInput, UpdatePullRequestReviewCommentInput, UpdatePullRequestReviewInput, UpdateRefInput, UpdateRepositoryInput, UpdateSponsorshipPreferencesInput, UpdateSubscriptionInput, UpdateTeamDiscussionCommentInput, UpdateTeamDiscussionInput, UpdateTopicsInput, UserStatusOrder, VerifiableDomainOrder, VerifyVerifiableDomainInput. +// AbortQueuedMigrationsInput, AcceptEnterpriseAdministratorInvitationInput, AcceptTopicSuggestionInput, AddAssigneesToAssignableInput, AddCommentInput, AddDiscussionCommentInput, AddEnterpriseSupportEntitlementInput, AddLabelsToLabelableInput, AddProjectCardInput, AddProjectColumnInput, AddProjectDraftIssueInput, AddProjectNextItemInput, AddPullRequestReviewCommentInput, AddPullRequestReviewInput, AddPullRequestReviewThreadInput, AddReactionInput, AddStarInput, AddUpvoteInput, AddVerifiableDomainInput, ApproveDeploymentsInput, ApproveVerifiableDomainInput, ArchiveRepositoryInput, AuditLogOrder, CancelEnterpriseAdminInvitationInput, CancelSponsorshipInput, ChangeUserStatusInput, CheckAnnotationData, CheckAnnotationRange, CheckRunAction, CheckRunFilter, CheckRunOutput, CheckRunOutputImage, CheckSuiteAutoTriggerPreference, CheckSuiteFilter, ClearLabelsFromLabelableInput, CloneProjectInput, CloneTemplateRepositoryInput, CloseIssueInput, ClosePullRequestInput, CommitAuthor, CommitContributionOrder, CommitMessage, CommittableBranch, ContributionOrder, ConvertProjectCardNoteToIssueInput, ConvertPullRequestToDraftInput, CreateBranchProtectionRuleInput, CreateCheckRunInput, CreateCheckSuiteInput, CreateCommitOnBranchInput, CreateDiscussionInput, CreateEnterpriseOrganizationInput, CreateEnvironmentInput, CreateIpAllowListEntryInput, CreateIssueInput, CreateMigrationSourceInput, CreateProjectInput, CreatePullRequestInput, CreateRefInput, CreateRepositoryInput, CreateSponsorsTierInput, CreateSponsorshipInput, CreateTeamDiscussionCommentInput, CreateTeamDiscussionInput, DeclineTopicSuggestionInput, DeleteBranchProtectionRuleInput, DeleteDeploymentInput, DeleteDiscussionCommentInput, DeleteDiscussionInput, DeleteEnvironmentInput, DeleteIpAllowListEntryInput, DeleteIssueCommentInput, DeleteIssueInput, DeleteProjectCardInput, DeleteProjectColumnInput, DeleteProjectInput, DeleteProjectNextItemInput, DeletePullRequestReviewCommentInput, DeletePullRequestReviewInput, DeleteRefInput, DeleteTeamDiscussionCommentInput, DeleteTeamDiscussionInput, DeleteVerifiableDomainInput, DeploymentOrder, DisablePullRequestAutoMergeInput, DiscussionOrder, DismissPullRequestReviewInput, DismissRepositoryVulnerabilityAlertInput, DraftPullRequestReviewComment, DraftPullRequestReviewThread, EnablePullRequestAutoMergeInput, EnterpriseAdministratorInvitationOrder, EnterpriseMemberOrder, EnterpriseServerInstallationOrder, EnterpriseServerUserAccountEmailOrder, EnterpriseServerUserAccountOrder, EnterpriseServerUserAccountsUploadOrder, FileAddition, FileChanges, FileDeletion, FollowOrganizationInput, FollowUserInput, GistOrder, GrantEnterpriseOrganizationsMigratorRoleInput, GrantMigratorRoleInput, InviteEnterpriseAdminInput, IpAllowListEntryOrder, IssueCommentOrder, IssueFilters, IssueOrder, LabelOrder, LanguageOrder, LinkRepositoryToProjectInput, LockLockableInput, MarkDiscussionCommentAsAnswerInput, MarkFileAsViewedInput, MarkPullRequestReadyForReviewInput, MergeBranchInput, MergePullRequestInput, MilestoneOrder, MinimizeCommentInput, MoveProjectCardInput, MoveProjectColumnInput, OrgEnterpriseOwnerOrder, OrganizationOrder, PackageFileOrder, PackageOrder, PackageVersionOrder, PinIssueInput, ProjectOrder, PullRequestOrder, ReactionOrder, RefOrder, RegenerateEnterpriseIdentityProviderRecoveryCodesInput, RegenerateVerifiableDomainTokenInput, RejectDeploymentsInput, ReleaseOrder, RemoveAssigneesFromAssignableInput, RemoveEnterpriseAdminInput, RemoveEnterpriseIdentityProviderInput, RemoveEnterpriseOrganizationInput, RemoveEnterpriseSupportEntitlementInput, RemoveLabelsFromLabelableInput, RemoveOutsideCollaboratorInput, RemoveReactionInput, RemoveStarInput, RemoveUpvoteInput, ReopenIssueInput, ReopenPullRequestInput, RepositoryInvitationOrder, RepositoryMigrationOrder, RepositoryOrder, RequestReviewsInput, RequiredStatusCheckInput, RerequestCheckSuiteInput, ResolveReviewThreadInput, RevokeEnterpriseOrganizationsMigratorRoleInput, RevokeMigratorRoleInput, SavedReplyOrder, SecurityAdvisoryIdentifierFilter, SecurityAdvisoryOrder, SecurityVulnerabilityOrder, SetEnterpriseIdentityProviderInput, SetOrganizationInteractionLimitInput, SetRepositoryInteractionLimitInput, SetUserInteractionLimitInput, SponsorOrder, SponsorableOrder, SponsorsActivityOrder, SponsorsTierOrder, SponsorshipNewsletterOrder, SponsorshipOrder, StarOrder, StartRepositoryMigrationInput, SubmitPullRequestReviewInput, TeamDiscussionCommentOrder, TeamDiscussionOrder, TeamMemberOrder, TeamOrder, TeamRepositoryOrder, TransferIssueInput, UnarchiveRepositoryInput, UnfollowOrganizationInput, UnfollowUserInput, UnlinkRepositoryFromProjectInput, UnlockLockableInput, UnmarkDiscussionCommentAsAnswerInput, UnmarkFileAsViewedInput, UnmarkIssueAsDuplicateInput, UnminimizeCommentInput, UnpinIssueInput, UnresolveReviewThreadInput, UpdateBranchProtectionRuleInput, UpdateCheckRunInput, UpdateCheckSuitePreferencesInput, UpdateDiscussionCommentInput, UpdateDiscussionInput, UpdateEnterpriseAdministratorRoleInput, UpdateEnterpriseAllowPrivateRepositoryForkingSettingInput, UpdateEnterpriseDefaultRepositoryPermissionSettingInput, UpdateEnterpriseMembersCanChangeRepositoryVisibilitySettingInput, UpdateEnterpriseMembersCanCreateRepositoriesSettingInput, UpdateEnterpriseMembersCanDeleteIssuesSettingInput, UpdateEnterpriseMembersCanDeleteRepositoriesSettingInput, UpdateEnterpriseMembersCanInviteCollaboratorsSettingInput, UpdateEnterpriseMembersCanMakePurchasesSettingInput, UpdateEnterpriseMembersCanUpdateProtectedBranchesSettingInput, UpdateEnterpriseMembersCanViewDependencyInsightsSettingInput, UpdateEnterpriseOrganizationProjectsSettingInput, UpdateEnterpriseOwnerOrganizationRoleInput, UpdateEnterpriseProfileInput, UpdateEnterpriseRepositoryProjectsSettingInput, UpdateEnterpriseTeamDiscussionsSettingInput, UpdateEnterpriseTwoFactorAuthenticationRequiredSettingInput, UpdateEnvironmentInput, UpdateIpAllowListEnabledSettingInput, UpdateIpAllowListEntryInput, UpdateIpAllowListForInstalledAppsEnabledSettingInput, UpdateIssueCommentInput, UpdateIssueInput, UpdateNotificationRestrictionSettingInput, UpdateOrganizationAllowPrivateRepositoryForkingSettingInput, UpdateProjectCardInput, UpdateProjectColumnInput, UpdateProjectDraftIssueInput, UpdateProjectInput, UpdateProjectNextInput, UpdateProjectNextItemFieldInput, UpdatePullRequestBranchInput, UpdatePullRequestInput, UpdatePullRequestReviewCommentInput, UpdatePullRequestReviewInput, UpdateRefInput, UpdateRepositoryInput, UpdateSponsorshipPreferencesInput, UpdateSubscriptionInput, UpdateTeamDiscussionCommentInput, UpdateTeamDiscussionInput, UpdateTeamsRepositoryInput, UpdateTopicsInput, UserStatusOrder, VerifiableDomainOrder, VerifyVerifiableDomainInput. type Input interface{} +// AbortQueuedMigrationsInput is an autogenerated input type of AbortQueuedMigrations. +type AbortQueuedMigrationsInput struct { + // The ID of the organization that is running the migrations. (Required.) + OwnerID ID `json:"ownerId"` + + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + // AcceptEnterpriseAdministratorInvitationInput is an autogenerated input type of AcceptEnterpriseAdministratorInvitation. type AcceptEnterpriseAdministratorInvitationInput struct { // The id of the invitation being accepted. (Required.) @@ -108,6 +117,21 @@ type AddProjectColumnInput struct { ClientMutationID *String `json:"clientMutationId,omitempty"` } +// AddProjectDraftIssueInput is an autogenerated input type of AddProjectDraftIssue. +type AddProjectDraftIssueInput struct { + // The ID of the Project to add the draft issue to. (Required.) + ProjectID ID `json:"projectId"` + // The title of the draft issue. (Required.) + Title String `json:"title"` + + // The body of the draft issue. (Optional.) + Body *String `json:"body,omitempty"` + // The IDs of the assignees of the draft issue. (Optional.) + AssigneeIDs *[]ID `json:"assigneeIds,omitempty"` + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + // AddProjectNextItemInput is an autogenerated input type of AddProjectNextItem. type AddProjectNextItemInput struct { // The ID of the Project to add the item to. (Required.) @@ -546,6 +570,8 @@ type CreateBranchProtectionRuleInput struct { RequiresCommitSignatures *Boolean `json:"requiresCommitSignatures,omitempty"` // Are merge commits prohibited from being pushed to this branch. (Optional.) RequiresLinearHistory *Boolean `json:"requiresLinearHistory,omitempty"` + // Is branch creation a protected operation. (Optional.) + BlocksCreations *Boolean `json:"blocksCreations,omitempty"` // Are force pushes allowed on this branch. (Optional.) AllowsForcePushes *Boolean `json:"allowsForcePushes,omitempty"` // Can this branch be deleted. (Optional.) @@ -570,7 +596,7 @@ type CreateBranchProtectionRuleInput struct { BypassForcePushActorIDs *[]ID `json:"bypassForcePushActorIds,omitempty"` // Is pushing to matching branches restricted. (Optional.) RestrictsPushes *Boolean `json:"restrictsPushes,omitempty"` - // A list of User, Team or App IDs allowed to push to matching branches. (Optional.) + // A list of User, Team, or App IDs allowed to push to matching branches. (Optional.) PushActorIDs *[]ID `json:"pushActorIds,omitempty"` // List of required status check contexts that must pass for commits to be accepted to matching branches. (Optional.) RequiredStatusCheckContexts *[]String `json:"requiredStatusCheckContexts,omitempty"` @@ -718,6 +744,25 @@ type CreateIssueInput struct { ClientMutationID *String `json:"clientMutationId,omitempty"` } +// CreateMigrationSourceInput is an autogenerated input type of CreateMigrationSource. +type CreateMigrationSourceInput struct { + // The Octoshift migration source name. (Required.) + Name String `json:"name"` + // The Octoshift migration source URL. (Required.) + URL String `json:"url"` + // The Octoshift migration source type. (Required.) + Type MigrationSourceType `json:"type"` + // The ID of the organization that will own the Octoshift migration source. (Required.) + OwnerID ID `json:"ownerId"` + + // The Octoshift migration source access token. (Optional.) + AccessToken *String `json:"accessToken,omitempty"` + // The GitHub personal access token of the user importing to the target repository. (Optional.) + GitHubPat *String `json:"githubPat,omitempty"` + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + // CreateProjectInput is an autogenerated input type of CreateProject. type CreateProjectInput struct { // The owner ID to create the project under. (Required.) @@ -794,6 +839,33 @@ type CreateRepositoryInput struct { ClientMutationID *String `json:"clientMutationId,omitempty"` } +// CreateSponsorsTierInput is an autogenerated input type of CreateSponsorsTier. +type CreateSponsorsTierInput struct { + // The value of the new tier in US dollars. Valid values: 1-12000. (Required.) + Amount Int `json:"amount"` + // A description of what this tier is, what perks sponsors might receive, what a sponsorship at this tier means for you, etc. (Required.) + Description String `json:"description"` + + // The ID of the user or organization who owns the GitHub Sponsors profile. Defaults to the current user if omitted and sponsorableLogin is not given. (Optional.) + SponsorableID *ID `json:"sponsorableId,omitempty"` + // The username of the user or organization who owns the GitHub Sponsors profile. Defaults to the current user if omitted and sponsorableId is not given. (Optional.) + SponsorableLogin *String `json:"sponsorableLogin,omitempty"` + // Whether sponsorships using this tier should happen monthly/yearly or just once. (Optional.) + IsRecurring *Boolean `json:"isRecurring,omitempty"` + // Optional ID of the private repository that sponsors at this tier should gain read-only access to. Must be owned by an organization. (Optional.) + RepositoryID *ID `json:"repositoryId,omitempty"` + // Optional login of the organization owner of the private repository that sponsors at this tier should gain read-only access to. Necessary if repositoryName is given. Will be ignored if repositoryId is given. (Optional.) + RepositoryOwnerLogin *String `json:"repositoryOwnerLogin,omitempty"` + // Optional name of the private repository that sponsors at this tier should gain read-only access to. Must be owned by an organization. Necessary if repositoryOwnerLogin is given. Will be ignored if repositoryId is given. (Optional.) + RepositoryName *String `json:"repositoryName,omitempty"` + // Optional message new sponsors at this tier will receive. (Optional.) + WelcomeMessage *String `json:"welcomeMessage,omitempty"` + // Whether to make the tier available immediately for sponsors to choose. Defaults to creating a draft tier that will not be publicly visible. (Optional.) + Publish *Boolean `json:"publish,omitempty"` + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + // CreateSponsorshipInput is an autogenerated input type of CreateSponsorship. type CreateSponsorshipInput struct { @@ -1184,6 +1256,15 @@ type FileDeletion struct { Path String `json:"path"` } +// FollowOrganizationInput is an autogenerated input type of FollowOrganization. +type FollowOrganizationInput struct { + // ID of the organization to follow. (Required.) + OrganizationID ID `json:"organizationId"` + + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + // FollowUserInput is an autogenerated input type of FollowUser. type FollowUserInput struct { // ID of the user to follow. (Required.) @@ -1201,6 +1282,30 @@ type GistOrder struct { Direction OrderDirection `json:"direction"` } +// GrantEnterpriseOrganizationsMigratorRoleInput is an autogenerated input type of GrantEnterpriseOrganizationsMigratorRole. +type GrantEnterpriseOrganizationsMigratorRoleInput struct { + // The ID of the enterprise to which all organizations managed by it will be granted the migrator role. (Required.) + EnterpriseID ID `json:"enterpriseId"` + // The login of the user to grant the migrator role. (Required.) + Login String `json:"login"` + + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + +// GrantMigratorRoleInput is an autogenerated input type of GrantMigratorRole. +type GrantMigratorRoleInput struct { + // The ID of the organization that the user/team belongs to. (Required.) + OrganizationID ID `json:"organizationId"` + // The user login or Team slug to grant the migrator role. (Required.) + Actor String `json:"actor"` + // Specifies the type of the actor, can be either USER or TEAM. (Required.) + ActorType ActorType `json:"actorType"` + + // 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.) @@ -1243,8 +1348,10 @@ type IssueFilters struct { Labels *[]String `json:"labels,omitempty"` // List issues where the given name is mentioned in the issue. (Optional.) Mentioned *String `json:"mentioned,omitempty"` - // List issues by given milestone argument. If an string representation of an integer is passed, it should refer to a milestone by its number field. Pass in `null` for issues with no milestone, and `*` for issues that are assigned to any milestone. (Optional.) + // List issues by given milestone argument. If an string representation of an integer is passed, it should refer to a milestone by its database ID. Pass in `null` for issues with no milestone, and `*` for issues that are assigned to any milestone. (Optional.) Milestone *String `json:"milestone,omitempty"` + // List issues by given milestone argument. If an string representation of an integer is passed, it should refer to a milestone by its number field. Pass in `null` for issues with no milestone, and `*` for issues that are assigned to any milestone. (Optional.) + MilestoneNumber *String `json:"milestoneNumber,omitempty"` // List issues that have been updated at or after the given date. (Optional.) Since *DateTime `json:"since,omitempty"` // List issues filtered by the list of states given. (Optional.) @@ -1660,6 +1767,14 @@ type RepositoryInvitationOrder struct { Direction OrderDirection `json:"direction"` } +// RepositoryMigrationOrder represents ordering options for repository migrations. +type RepositoryMigrationOrder struct { + // The field to order repository migrations by. (Required.) + Field RepositoryMigrationOrderField `json:"field"` + // The ordering direction. (Required.) + Direction RepositoryMigrationOrderDirection `json:"direction"` +} + // RepositoryOrder represents ordering options for repository connections. type RepositoryOrder struct { // The field to order repositories by. (Required.) @@ -1712,6 +1827,30 @@ type ResolveReviewThreadInput struct { ClientMutationID *String `json:"clientMutationId,omitempty"` } +// RevokeEnterpriseOrganizationsMigratorRoleInput is an autogenerated input type of RevokeEnterpriseOrganizationsMigratorRole. +type RevokeEnterpriseOrganizationsMigratorRoleInput struct { + // The ID of the enterprise to which all organizations managed by it will be granted the migrator role. (Required.) + EnterpriseID ID `json:"enterpriseId"` + // The login of the user to revoke the migrator role. (Required.) + Login String `json:"login"` + + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + +// RevokeMigratorRoleInput is an autogenerated input type of RevokeMigratorRole. +type RevokeMigratorRoleInput struct { + // The ID of the organization that the user/team belongs to. (Required.) + OrganizationID ID `json:"organizationId"` + // The user login or Team slug to revoke the migrator role from. (Required.) + Actor String `json:"actor"` + // Specifies the type of the actor, can be either USER or TEAM. (Required.) + ActorType ActorType `json:"actorType"` + + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + // SavedReplyOrder represents ordering options for saved reply connections. type SavedReplyOrder struct { // The field to order saved replies by. (Required.) @@ -1858,6 +1997,33 @@ type StarOrder struct { Direction OrderDirection `json:"direction"` } +// StartRepositoryMigrationInput is an autogenerated input type of StartRepositoryMigration. +type StartRepositoryMigrationInput struct { + // The ID of the Octoshift migration source. (Required.) + SourceID ID `json:"sourceId"` + // The ID of the organization that will own the imported repository. (Required.) + OwnerID ID `json:"ownerId"` + // The Octoshift migration source repository URL. (Required.) + SourceRepositoryURL URI `json:"sourceRepositoryUrl"` + // The name of the imported repository. (Required.) + RepositoryName String `json:"repositoryName"` + + // Whether to continue the migration on error. (Optional.) + ContinueOnError *Boolean `json:"continueOnError,omitempty"` + // The signed URL to access the user-uploaded git archive. (Optional.) + GitArchiveURL *String `json:"gitArchiveUrl,omitempty"` + // The signed URL to access the user-uploaded metadata archive. (Optional.) + MetadataArchiveURL *String `json:"metadataArchiveUrl,omitempty"` + // The Octoshift migration source access token. (Optional.) + AccessToken *String `json:"accessToken,omitempty"` + // The GitHub personal access token of the user importing to the target repository. (Optional.) + GitHubPat *String `json:"githubPat,omitempty"` + // Whether to skip migrating releases for the repository. (Optional.) + SkipReleases *Boolean `json:"skipReleases,omitempty"` + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + // SubmitPullRequestReviewInput is an autogenerated input type of SubmitPullRequestReview. type SubmitPullRequestReviewInput struct { // The event to send to the Pull Request Review. (Required.) @@ -1933,6 +2099,15 @@ type UnarchiveRepositoryInput struct { ClientMutationID *String `json:"clientMutationId,omitempty"` } +// UnfollowOrganizationInput is an autogenerated input type of UnfollowOrganization. +type UnfollowOrganizationInput struct { + // ID of the organization to unfollow. (Required.) + OrganizationID ID `json:"organizationId"` + + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + // UnfollowUserInput is an autogenerated input type of UnfollowUser. type UnfollowUserInput struct { // ID of the user to unfollow. (Required.) @@ -2035,6 +2210,8 @@ type UpdateBranchProtectionRuleInput struct { RequiresCommitSignatures *Boolean `json:"requiresCommitSignatures,omitempty"` // Are merge commits prohibited from being pushed to this branch. (Optional.) RequiresLinearHistory *Boolean `json:"requiresLinearHistory,omitempty"` + // Is branch creation a protected operation. (Optional.) + BlocksCreations *Boolean `json:"blocksCreations,omitempty"` // Are force pushes allowed on this branch. (Optional.) AllowsForcePushes *Boolean `json:"allowsForcePushes,omitempty"` // Can this branch be deleted. (Optional.) @@ -2059,7 +2236,7 @@ type UpdateBranchProtectionRuleInput struct { BypassForcePushActorIDs *[]ID `json:"bypassForcePushActorIds,omitempty"` // Is pushing to matching branches restricted. (Optional.) RestrictsPushes *Boolean `json:"restrictsPushes,omitempty"` - // A list of User, Team or App IDs allowed to push to matching branches. (Optional.) + // A list of User, Team, or App IDs allowed to push to matching branches. (Optional.) PushActorIDs *[]ID `json:"pushActorIds,omitempty"` // List of required status check contexts that must pass for commits to be accepted to matching branches. (Optional.) RequiredStatusCheckContexts *[]String `json:"requiredStatusCheckContexts,omitempty"` @@ -2279,6 +2456,19 @@ type UpdateEnterpriseOrganizationProjectsSettingInput struct { ClientMutationID *String `json:"clientMutationId,omitempty"` } +// UpdateEnterpriseOwnerOrganizationRoleInput is an autogenerated input type of UpdateEnterpriseOwnerOrganizationRole. +type UpdateEnterpriseOwnerOrganizationRoleInput struct { + // The ID of the Enterprise which the owner belongs to. (Required.) + EnterpriseID ID `json:"enterpriseId"` + // The ID of the organization for membership change. (Required.) + OrganizationID ID `json:"organizationId"` + // The role to assume in the organization. (Required.) + OrganizationRole RoleInOrganization `json:"organizationRole"` + + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + // UpdateEnterpriseProfileInput is an autogenerated input type of UpdateEnterpriseProfile. type UpdateEnterpriseProfileInput struct { // The Enterprise ID to update. (Required.) @@ -2459,6 +2649,21 @@ type UpdateProjectColumnInput struct { ClientMutationID *String `json:"clientMutationId,omitempty"` } +// UpdateProjectDraftIssueInput is an autogenerated input type of UpdateProjectDraftIssue. +type UpdateProjectDraftIssueInput struct { + // The ID of the draft issue to update. (Required.) + DraftIssueID ID `json:"draftIssueId"` + + // The title of the draft issue. (Optional.) + Title *String `json:"title,omitempty"` + // The body of the draft issue. (Optional.) + Body *String `json:"body,omitempty"` + // The IDs of the assignees of the draft issue. (Optional.) + AssigneeIDs *[]ID `json:"assigneeIds,omitempty"` + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + // UpdateProjectInput is an autogenerated input type of UpdateProject. type UpdateProjectInput struct { // The Project ID to update. (Required.) @@ -2476,17 +2681,36 @@ type UpdateProjectInput struct { ClientMutationID *String `json:"clientMutationId,omitempty"` } +// UpdateProjectNextInput is an autogenerated input type of UpdateProjectNext. +type UpdateProjectNextInput struct { + // The ID of the Project to update. (Required.) + ProjectID ID `json:"projectId"` + + // Set the title of the project. (Optional.) + Title *String `json:"title,omitempty"` + // Set the readme description of the project. (Optional.) + Description *String `json:"description,omitempty"` + // Set the short description of the project. (Optional.) + ShortDescription *String `json:"shortDescription,omitempty"` + // Set the project to closed or open. (Optional.) + Closed *Boolean `json:"closed,omitempty"` + // Set the project to public or private. (Optional.) + Public *Boolean `json:"public,omitempty"` + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + // UpdateProjectNextItemFieldInput is an autogenerated input type of UpdateProjectNextItemField. type UpdateProjectNextItemFieldInput struct { // The ID of the Project. (Required.) ProjectID ID `json:"projectId"` // The id of the item to be updated. (Required.) ItemID ID `json:"itemId"` - // The id of the field to be updated. Only supports custom fields and status for now. (Required.) - FieldID ID `json:"fieldId"` // The value which will be set on the field. (Required.) Value String `json:"value"` + // The id of the field to be updated. (Optional.) + FieldID *ID `json:"fieldId,omitempty"` // A unique identifier for the client performing the mutation. (Optional.) ClientMutationID *String `json:"clientMutationId,omitempty"` } @@ -2647,6 +2871,19 @@ type UpdateTeamDiscussionInput struct { ClientMutationID *String `json:"clientMutationId,omitempty"` } +// UpdateTeamsRepositoryInput is an autogenerated input type of UpdateTeamsRepository. +type UpdateTeamsRepositoryInput struct { + // Repository ID being granted access to. (Required.) + RepositoryID ID `json:"repositoryId"` + // A list of teams being granted access. Limit: 10. (Required.) + TeamIDs []ID `json:"teamIds"` + // Permission that should be granted to the teams. (Required.) + Permission RepositoryPermission `json:"permission"` + + // A unique identifier for the client performing the mutation. (Optional.) + ClientMutationID *String `json:"clientMutationId,omitempty"` +} + // UpdateTopicsInput is an autogenerated input type of UpdateTopics. type UpdateTopicsInput struct { // The Node ID of the repository. (Required.) diff --git a/vendor/modules.txt b/vendor/modules.txt index 98f36e966e..e3f2754e53 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -370,7 +370,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-20220106005112-0707a5a90543 +# github.com/shurcooL/githubv4 v0.0.0-20220520033151-0b4e3294ff00 ## explicit github.com/shurcooL/githubv4 # github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29 diff --git a/website/docs/r/branch_protection.html.markdown b/website/docs/r/branch_protection.html.markdown index be5ee500d9..a2b6d8dddf 100644 --- a/website/docs/r/branch_protection.html.markdown +++ b/website/docs/r/branch_protection.html.markdown @@ -83,6 +83,7 @@ The following arguments are supported: * `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. +* `blocks_creations` - (Optional) Boolean, setting this to `true` to block creating the branch. ### Required Status Checks