@ -23,26 +23,27 @@ type Branch struct {
// BranchProtection represents a branch protection for a repository
type BranchProtection struct {
BranchName string ` json:"branch_name" `
EnablePush bool ` json:"enable_push" `
EnablePushWhitelist bool ` json:"enable_push_whitelist" `
PushWhitelistUsernames [ ] string ` json:"push_whitelist_usernames" `
PushWhitelistTeams [ ] string ` json:"push_whitelist_teams" `
PushWhitelistDeployKeys bool ` json:"push_whitelist_deploy_keys" `
EnableMergeWhitelist bool ` json:"enable_merge_whitelist" `
MergeWhitelistUsernames [ ] string ` json:"merge_whitelist_usernames" `
MergeWhitelistTeams [ ] string ` json:"merge_whitelist_teams" `
EnableStatusCheck bool ` json:"enable_status_check" `
StatusCheckContexts [ ] string ` json:"status_check_contexts" `
RequiredApprovals int64 ` json:"required_approvals" `
EnableApprovalsWhitelist bool ` json:"enable_approvals_whitelist" `
ApprovalsWhitelistUsernames [ ] string ` json:"approvals_whitelist_username" `
ApprovalsWhitelistTeams [ ] string ` json:"approvals_whitelist_teams" `
BlockOnRejectedReviews bool ` json:"block_on_rejected_reviews" `
BlockOnOutdatedBranch bool ` json:"block_on_outdated_branch" `
DismissStaleApprovals bool ` json:"dismiss_stale_approvals" `
RequireSignedCommits bool ` json:"require_signed_commits" `
ProtectedFilePatterns string ` json:"protected_file_patterns" `
BranchName string ` json:"branch_name" `
EnablePush bool ` json:"enable_push" `
EnablePushWhitelist bool ` json:"enable_push_whitelist" `
PushWhitelistUsernames [ ] string ` json:"push_whitelist_usernames" `
PushWhitelistTeams [ ] string ` json:"push_whitelist_teams" `
PushWhitelistDeployKeys bool ` json:"push_whitelist_deploy_keys" `
EnableMergeWhitelist bool ` json:"enable_merge_whitelist" `
MergeWhitelistUsernames [ ] string ` json:"merge_whitelist_usernames" `
MergeWhitelistTeams [ ] string ` json:"merge_whitelist_teams" `
EnableStatusCheck bool ` json:"enable_status_check" `
StatusCheckContexts [ ] string ` json:"status_check_contexts" `
RequiredApprovals int64 ` json:"required_approvals" `
EnableApprovalsWhitelist bool ` json:"enable_approvals_whitelist" `
ApprovalsWhitelistUsernames [ ] string ` json:"approvals_whitelist_username" `
ApprovalsWhitelistTeams [ ] string ` json:"approvals_whitelist_teams" `
BlockOnRejectedReviews bool ` json:"block_on_rejected_reviews" `
BlockOnOfficialReviewRequests bool ` json:"block_on_official_review_requests" `
BlockOnOutdatedBranch bool ` json:"block_on_outdated_branch" `
DismissStaleApprovals bool ` json:"dismiss_stale_approvals" `
RequireSignedCommits bool ` json:"require_signed_commits" `
ProtectedFilePatterns string ` json:"protected_file_patterns" `
// swagger:strfmt date-time
Created time . Time ` json:"created_at" `
// swagger:strfmt date-time
@ -51,47 +52,49 @@ type BranchProtection struct {
// CreateBranchProtectionOption options for creating a branch protection
type CreateBranchProtectionOption struct {
BranchName string ` json:"branch_name" `
EnablePush bool ` json:"enable_push" `
EnablePushWhitelist bool ` json:"enable_push_whitelist" `
PushWhitelistUsernames [ ] string ` json:"push_whitelist_usernames" `
PushWhitelistTeams [ ] string ` json:"push_whitelist_teams" `
PushWhitelistDeployKeys bool ` json:"push_whitelist_deploy_keys" `
EnableMergeWhitelist bool ` json:"enable_merge_whitelist" `
MergeWhitelistUsernames [ ] string ` json:"merge_whitelist_usernames" `
MergeWhitelistTeams [ ] string ` json:"merge_whitelist_teams" `
EnableStatusCheck bool ` json:"enable_status_check" `
StatusCheckContexts [ ] string ` json:"status_check_contexts" `
RequiredApprovals int64 ` json:"required_approvals" `
EnableApprovalsWhitelist bool ` json:"enable_approvals_whitelist" `
ApprovalsWhitelistUsernames [ ] string ` json:"approvals_whitelist_username" `
ApprovalsWhitelistTeams [ ] string ` json:"approvals_whitelist_teams" `
BlockOnRejectedReviews bool ` json:"block_on_rejected_reviews" `
BlockOnOutdatedBranch bool ` json:"block_on_outdated_branch" `
DismissStaleApprovals bool ` json:"dismiss_stale_approvals" `
RequireSignedCommits bool ` json:"require_signed_commits" `
ProtectedFilePatterns string ` json:"protected_file_patterns" `
BranchName string ` json:"branch_name" `
EnablePush bool ` json:"enable_push" `
EnablePushWhitelist bool ` json:"enable_push_whitelist" `
PushWhitelistUsernames [ ] string ` json:"push_whitelist_usernames" `
PushWhitelistTeams [ ] string ` json:"push_whitelist_teams" `
PushWhitelistDeployKeys bool ` json:"push_whitelist_deploy_keys" `
EnableMergeWhitelist bool ` json:"enable_merge_whitelist" `
MergeWhitelistUsernames [ ] string ` json:"merge_whitelist_usernames" `
MergeWhitelistTeams [ ] string ` json:"merge_whitelist_teams" `
EnableStatusCheck bool ` json:"enable_status_check" `
StatusCheckContexts [ ] string ` json:"status_check_contexts" `
RequiredApprovals int64 ` json:"required_approvals" `
EnableApprovalsWhitelist bool ` json:"enable_approvals_whitelist" `
ApprovalsWhitelistUsernames [ ] string ` json:"approvals_whitelist_username" `
ApprovalsWhitelistTeams [ ] string ` json:"approvals_whitelist_teams" `
BlockOnRejectedReviews bool ` json:"block_on_rejected_reviews" `
BlockOnOfficialReviewRequests bool ` json:"block_on_official_review_requests" `
BlockOnOutdatedBranch bool ` json:"block_on_outdated_branch" `
DismissStaleApprovals bool ` json:"dismiss_stale_approvals" `
RequireSignedCommits bool ` json:"require_signed_commits" `
ProtectedFilePatterns string ` json:"protected_file_patterns" `
}
// EditBranchProtectionOption options for editing a branch protection
type EditBranchProtectionOption struct {
EnablePush * bool ` json:"enable_push" `
EnablePushWhitelist * bool ` json:"enable_push_whitelist" `
PushWhitelistUsernames [ ] string ` json:"push_whitelist_usernames" `
PushWhitelistTeams [ ] string ` json:"push_whitelist_teams" `
PushWhitelistDeployKeys * bool ` json:"push_whitelist_deploy_keys" `
EnableMergeWhitelist * bool ` json:"enable_merge_whitelist" `
MergeWhitelistUsernames [ ] string ` json:"merge_whitelist_usernames" `
MergeWhitelistTeams [ ] string ` json:"merge_whitelist_teams" `
EnableStatusCheck * bool ` json:"enable_status_check" `
StatusCheckContexts [ ] string ` json:"status_check_contexts" `
RequiredApprovals * int64 ` json:"required_approvals" `
EnableApprovalsWhitelist * bool ` json:"enable_approvals_whitelist" `
ApprovalsWhitelistUsernames [ ] string ` json:"approvals_whitelist_username" `
ApprovalsWhitelistTeams [ ] string ` json:"approvals_whitelist_teams" `
BlockOnRejectedReviews * bool ` json:"block_on_rejected_reviews" `
BlockOnOutdatedBranch * bool ` json:"block_on_outdated_branch" `
DismissStaleApprovals * bool ` json:"dismiss_stale_approvals" `
RequireSignedCommits * bool ` json:"require_signed_commits" `
ProtectedFilePatterns * string ` json:"protected_file_patterns" `
EnablePush * bool ` json:"enable_push" `
EnablePushWhitelist * bool ` json:"enable_push_whitelist" `
PushWhitelistUsernames [ ] string ` json:"push_whitelist_usernames" `
PushWhitelistTeams [ ] string ` json:"push_whitelist_teams" `
PushWhitelistDeployKeys * bool ` json:"push_whitelist_deploy_keys" `
EnableMergeWhitelist * bool ` json:"enable_merge_whitelist" `
MergeWhitelistUsernames [ ] string ` json:"merge_whitelist_usernames" `
MergeWhitelistTeams [ ] string ` json:"merge_whitelist_teams" `
EnableStatusCheck * bool ` json:"enable_status_check" `
StatusCheckContexts [ ] string ` json:"status_check_contexts" `
RequiredApprovals * int64 ` json:"required_approvals" `
EnableApprovalsWhitelist * bool ` json:"enable_approvals_whitelist" `
ApprovalsWhitelistUsernames [ ] string ` json:"approvals_whitelist_username" `
ApprovalsWhitelistTeams [ ] string ` json:"approvals_whitelist_teams" `
BlockOnRejectedReviews * bool ` json:"block_on_rejected_reviews" `
BlockOnOfficialReviewRequests * bool ` json:"block_on_official_review_requests" `
BlockOnOutdatedBranch * bool ` json:"block_on_outdated_branch" `
DismissStaleApprovals * bool ` json:"dismiss_stale_approvals" `
RequireSignedCommits * bool ` json:"require_signed_commits" `
ProtectedFilePatterns * string ` json:"protected_file_patterns" `
}