@@ -23,26 +23,27 @@ type Branch struct {
23
23
24
24
// BranchProtection represents a branch protection for a repository
25
25
type BranchProtection struct {
26
- BranchName string `json:"branch_name"`
27
- EnablePush bool `json:"enable_push"`
28
- EnablePushWhitelist bool `json:"enable_push_whitelist"`
29
- PushWhitelistUsernames []string `json:"push_whitelist_usernames"`
30
- PushWhitelistTeams []string `json:"push_whitelist_teams"`
31
- PushWhitelistDeployKeys bool `json:"push_whitelist_deploy_keys"`
32
- EnableMergeWhitelist bool `json:"enable_merge_whitelist"`
33
- MergeWhitelistUsernames []string `json:"merge_whitelist_usernames"`
34
- MergeWhitelistTeams []string `json:"merge_whitelist_teams"`
35
- EnableStatusCheck bool `json:"enable_status_check"`
36
- StatusCheckContexts []string `json:"status_check_contexts"`
37
- RequiredApprovals int64 `json:"required_approvals"`
38
- EnableApprovalsWhitelist bool `json:"enable_approvals_whitelist"`
39
- ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username"`
40
- ApprovalsWhitelistTeams []string `json:"approvals_whitelist_teams"`
41
- BlockOnRejectedReviews bool `json:"block_on_rejected_reviews"`
42
- BlockOnOutdatedBranch bool `json:"block_on_outdated_branch"`
43
- DismissStaleApprovals bool `json:"dismiss_stale_approvals"`
44
- RequireSignedCommits bool `json:"require_signed_commits"`
45
- ProtectedFilePatterns string `json:"protected_file_patterns"`
26
+ BranchName string `json:"branch_name"`
27
+ EnablePush bool `json:"enable_push"`
28
+ EnablePushWhitelist bool `json:"enable_push_whitelist"`
29
+ PushWhitelistUsernames []string `json:"push_whitelist_usernames"`
30
+ PushWhitelistTeams []string `json:"push_whitelist_teams"`
31
+ PushWhitelistDeployKeys bool `json:"push_whitelist_deploy_keys"`
32
+ EnableMergeWhitelist bool `json:"enable_merge_whitelist"`
33
+ MergeWhitelistUsernames []string `json:"merge_whitelist_usernames"`
34
+ MergeWhitelistTeams []string `json:"merge_whitelist_teams"`
35
+ EnableStatusCheck bool `json:"enable_status_check"`
36
+ StatusCheckContexts []string `json:"status_check_contexts"`
37
+ RequiredApprovals int64 `json:"required_approvals"`
38
+ EnableApprovalsWhitelist bool `json:"enable_approvals_whitelist"`
39
+ ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username"`
40
+ ApprovalsWhitelistTeams []string `json:"approvals_whitelist_teams"`
41
+ BlockOnRejectedReviews bool `json:"block_on_rejected_reviews"`
42
+ BlockOnOfficialReviewRequests bool `json:"block_on_official_review_requests"`
43
+ BlockOnOutdatedBranch bool `json:"block_on_outdated_branch"`
44
+ DismissStaleApprovals bool `json:"dismiss_stale_approvals"`
45
+ RequireSignedCommits bool `json:"require_signed_commits"`
46
+ ProtectedFilePatterns string `json:"protected_file_patterns"`
46
47
// swagger:strfmt date-time
47
48
Created time.Time `json:"created_at"`
48
49
// swagger:strfmt date-time
@@ -51,47 +52,49 @@ type BranchProtection struct {
51
52
52
53
// CreateBranchProtectionOption options for creating a branch protection
53
54
type CreateBranchProtectionOption struct {
54
- BranchName string `json:"branch_name"`
55
- EnablePush bool `json:"enable_push"`
56
- EnablePushWhitelist bool `json:"enable_push_whitelist"`
57
- PushWhitelistUsernames []string `json:"push_whitelist_usernames"`
58
- PushWhitelistTeams []string `json:"push_whitelist_teams"`
59
- PushWhitelistDeployKeys bool `json:"push_whitelist_deploy_keys"`
60
- EnableMergeWhitelist bool `json:"enable_merge_whitelist"`
61
- MergeWhitelistUsernames []string `json:"merge_whitelist_usernames"`
62
- MergeWhitelistTeams []string `json:"merge_whitelist_teams"`
63
- EnableStatusCheck bool `json:"enable_status_check"`
64
- StatusCheckContexts []string `json:"status_check_contexts"`
65
- RequiredApprovals int64 `json:"required_approvals"`
66
- EnableApprovalsWhitelist bool `json:"enable_approvals_whitelist"`
67
- ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username"`
68
- ApprovalsWhitelistTeams []string `json:"approvals_whitelist_teams"`
69
- BlockOnRejectedReviews bool `json:"block_on_rejected_reviews"`
70
- BlockOnOutdatedBranch bool `json:"block_on_outdated_branch"`
71
- DismissStaleApprovals bool `json:"dismiss_stale_approvals"`
72
- RequireSignedCommits bool `json:"require_signed_commits"`
73
- ProtectedFilePatterns string `json:"protected_file_patterns"`
55
+ BranchName string `json:"branch_name"`
56
+ EnablePush bool `json:"enable_push"`
57
+ EnablePushWhitelist bool `json:"enable_push_whitelist"`
58
+ PushWhitelistUsernames []string `json:"push_whitelist_usernames"`
59
+ PushWhitelistTeams []string `json:"push_whitelist_teams"`
60
+ PushWhitelistDeployKeys bool `json:"push_whitelist_deploy_keys"`
61
+ EnableMergeWhitelist bool `json:"enable_merge_whitelist"`
62
+ MergeWhitelistUsernames []string `json:"merge_whitelist_usernames"`
63
+ MergeWhitelistTeams []string `json:"merge_whitelist_teams"`
64
+ EnableStatusCheck bool `json:"enable_status_check"`
65
+ StatusCheckContexts []string `json:"status_check_contexts"`
66
+ RequiredApprovals int64 `json:"required_approvals"`
67
+ EnableApprovalsWhitelist bool `json:"enable_approvals_whitelist"`
68
+ ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username"`
69
+ ApprovalsWhitelistTeams []string `json:"approvals_whitelist_teams"`
70
+ BlockOnRejectedReviews bool `json:"block_on_rejected_reviews"`
71
+ BlockOnOfficialReviewRequests bool `json:"block_on_official_review_requests"`
72
+ BlockOnOutdatedBranch bool `json:"block_on_outdated_branch"`
73
+ DismissStaleApprovals bool `json:"dismiss_stale_approvals"`
74
+ RequireSignedCommits bool `json:"require_signed_commits"`
75
+ ProtectedFilePatterns string `json:"protected_file_patterns"`
74
76
}
75
77
76
78
// EditBranchProtectionOption options for editing a branch protection
77
79
type EditBranchProtectionOption struct {
78
- EnablePush * bool `json:"enable_push"`
79
- EnablePushWhitelist * bool `json:"enable_push_whitelist"`
80
- PushWhitelistUsernames []string `json:"push_whitelist_usernames"`
81
- PushWhitelistTeams []string `json:"push_whitelist_teams"`
82
- PushWhitelistDeployKeys * bool `json:"push_whitelist_deploy_keys"`
83
- EnableMergeWhitelist * bool `json:"enable_merge_whitelist"`
84
- MergeWhitelistUsernames []string `json:"merge_whitelist_usernames"`
85
- MergeWhitelistTeams []string `json:"merge_whitelist_teams"`
86
- EnableStatusCheck * bool `json:"enable_status_check"`
87
- StatusCheckContexts []string `json:"status_check_contexts"`
88
- RequiredApprovals * int64 `json:"required_approvals"`
89
- EnableApprovalsWhitelist * bool `json:"enable_approvals_whitelist"`
90
- ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username"`
91
- ApprovalsWhitelistTeams []string `json:"approvals_whitelist_teams"`
92
- BlockOnRejectedReviews * bool `json:"block_on_rejected_reviews"`
93
- BlockOnOutdatedBranch * bool `json:"block_on_outdated_branch"`
94
- DismissStaleApprovals * bool `json:"dismiss_stale_approvals"`
95
- RequireSignedCommits * bool `json:"require_signed_commits"`
96
- ProtectedFilePatterns * string `json:"protected_file_patterns"`
80
+ EnablePush * bool `json:"enable_push"`
81
+ EnablePushWhitelist * bool `json:"enable_push_whitelist"`
82
+ PushWhitelistUsernames []string `json:"push_whitelist_usernames"`
83
+ PushWhitelistTeams []string `json:"push_whitelist_teams"`
84
+ PushWhitelistDeployKeys * bool `json:"push_whitelist_deploy_keys"`
85
+ EnableMergeWhitelist * bool `json:"enable_merge_whitelist"`
86
+ MergeWhitelistUsernames []string `json:"merge_whitelist_usernames"`
87
+ MergeWhitelistTeams []string `json:"merge_whitelist_teams"`
88
+ EnableStatusCheck * bool `json:"enable_status_check"`
89
+ StatusCheckContexts []string `json:"status_check_contexts"`
90
+ RequiredApprovals * int64 `json:"required_approvals"`
91
+ EnableApprovalsWhitelist * bool `json:"enable_approvals_whitelist"`
92
+ ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username"`
93
+ ApprovalsWhitelistTeams []string `json:"approvals_whitelist_teams"`
94
+ BlockOnRejectedReviews * bool `json:"block_on_rejected_reviews"`
95
+ BlockOnOfficialReviewRequests * bool `json:"block_on_official_review_requests"`
96
+ BlockOnOutdatedBranch * bool `json:"block_on_outdated_branch"`
97
+ DismissStaleApprovals * bool `json:"dismiss_stale_approvals"`
98
+ RequireSignedCommits * bool `json:"require_signed_commits"`
99
+ ProtectedFilePatterns * string `json:"protected_file_patterns"`
97
100
}
0 commit comments