@@ -22,42 +22,77 @@ type Permission struct {
22
22
Pull bool `json:"pull"`
23
23
}
24
24
25
+ // InternalTracker represents settings for internal tracker
26
+ type InternalTracker struct {
27
+ // Enable time tracking (Built-in issue tracker)
28
+ EnableTimeTracker bool `json:"enable_time_tracker"`
29
+ // Let only contributors track time (Built-in issue tracker)
30
+ AllowOnlyContributorsToTrackTime bool `json:"allow_only_contributors_to_track_time"`
31
+ // Enable dependencies for issues and pull requests (Built-in issue tracker)
32
+ EnableIssueDependencies bool `json:"enable_issue_dependencies"`
33
+ }
34
+
35
+ // ExternalTracker represents settings for external tracker
36
+ type ExternalTracker struct {
37
+ // URL of external issue tracker.
38
+ ExternalTrackerURL string `json:"external_tracker_url"`
39
+ // External Issue Tracker URL Format. Use the placeholders {user}, {repo} and {index} for the username, repository name and issue index.
40
+ ExternalTrackerFormat string `json:"external_tracker_format"`
41
+ // External Issue Tracker Number Format, either `numeric` or `alphanumeric`
42
+ ExternalTrackerStyle string `json:"external_tracker_style"`
43
+ }
44
+
45
+ // ExternalUncyclo represents setting for external wiki
46
+ type ExternalUncyclo struct {
47
+ // URL of external wiki.
48
+ ExternalUncycloURL string `json:"external_wiki_url"`
49
+ }
50
+
25
51
// Repository represents a repository
26
52
type Repository struct {
27
- ID int64 `json:"id"`
28
- Owner * User `json:"owner"`
29
- Name string `json:"name"`
30
- FullName string `json:"full_name"`
31
- Description string `json:"description"`
32
- Empty bool `json:"empty"`
33
- Private bool `json:"private"`
34
- Fork bool `json:"fork"`
35
- Parent * Repository `json:"parent"`
36
- Mirror bool `json:"mirror"`
37
- Size int `json:"size"`
38
- HTMLURL string `json:"html_url"`
39
- SSHURL string `json:"ssh_url"`
40
- CloneURL string `json:"clone_url"`
41
- OriginalURL string `json:"original_url"`
42
- Website string `json:"website"`
43
- Stars int `json:"stars_count"`
44
- Forks int `json:"forks_count"`
45
- Watchers int `json:"watchers_count"`
46
- OpenIssues int `json:"open_issues_count"`
47
- DefaultBranch string `json:"default_branch"`
48
- Archived bool `json:"archived"`
49
- Created time.Time `json:"created_at"`
50
- Updated time.Time `json:"updated_at"`
51
- Permissions * Permission `json:"permissions,omitempty"`
52
- HasIssues bool `json:"has_issues"`
53
- HasUncyclo bool `json:"has_wiki"`
54
- HasPullRequests bool `json:"has_pull_requests"`
55
- IgnoreWhitespaceConflicts bool `json:"ignore_whitespace_conflicts"`
56
- AllowMerge bool `json:"allow_merge_commits"`
57
- AllowRebase bool `json:"allow_rebase"`
58
- AllowRebaseMerge bool `json:"allow_rebase_explicit"`
59
- AllowSquash bool `json:"allow_squash_merge"`
60
- AvatarURL string `json:"avatar_url"`
53
+ ID int64 `json:"id"`
54
+ Owner * User `json:"owner"`
55
+ Name string `json:"name"`
56
+ FullName string `json:"full_name"`
57
+ Description string `json:"description"`
58
+ Empty bool `json:"empty"`
59
+ Private bool `json:"private"`
60
+ Fork bool `json:"fork"`
61
+ Template bool `json:"template"`
62
+ Parent * Repository `json:"parent"`
63
+ Mirror bool `json:"mirror"`
64
+ Size int `json:"size"`
65
+ HTMLURL string `json:"html_url"`
66
+ SSHURL string `json:"ssh_url"`
67
+ CloneURL string `json:"clone_url"`
68
+ OriginalURL string `json:"original_url"`
69
+ Website string `json:"website"`
70
+ Stars int `json:"stars_count"`
71
+ Forks int `json:"forks_count"`
72
+ Watchers int `json:"watchers_count"`
73
+ OpenIssues int `json:"open_issues_count"`
74
+ OpenPulls int `json:"open_pr_counter"`
75
+ Releases int `json:"release_counter"`
76
+ DefaultBranch string `json:"default_branch"`
77
+ Archived bool `json:"archived"`
78
+ Created time.Time `json:"created_at"`
79
+ Updated time.Time `json:"updated_at"`
80
+ Permissions * Permission `json:"permissions,omitempty"`
81
+ HasIssues bool `json:"has_issues"`
82
+ InternalTracker * InternalTracker `json:"internal_tracker,omitempty"`
83
+ ExternalTracker * ExternalTracker `json:"external_tracker,omitempty"`
84
+ HasUncyclo bool `json:"has_wiki"`
85
+ ExternalUncyclo * ExternalUncyclo `json:"external_wiki,omitempty"`
86
+ HasPullRequests bool `json:"has_pull_requests"`
87
+ HasProjects bool `json:"has_projects"`
88
+ IgnoreWhitespaceConflicts bool `json:"ignore_whitespace_conflicts"`
89
+ AllowMerge bool `json:"allow_merge_commits"`
90
+ AllowRebase bool `json:"allow_rebase"`
91
+ AllowRebaseMerge bool `json:"allow_rebase_explicit"`
92
+ AllowSquash bool `json:"allow_squash_merge"`
93
+ AvatarURL string `json:"avatar_url"`
94
+ Internal bool `json:"internal"`
95
+ MirrorInterval string `json:"mirror_interval"`
61
96
}
62
97
63
98
// RepoType represent repo type
@@ -347,14 +382,24 @@ type EditRepoOption struct {
347
382
// Note: you will get a 422 error if the organization restricts changing repository visibility to organization
348
383
// owners and a non-owner tries to change the value of private.
349
384
Private * bool `json:"private,omitempty"`
385
+ // either `true` to make this repository a template or `false` to make it a normal repository
386
+ Template * bool `json:"template,omitempty"`
350
387
// either `true` to enable issues for this repository or `false` to disable them.
351
388
HasIssues * bool `json:"has_issues,omitempty"`
389
+ // set this structure to configure internal issue tracker (requires has_issues)
390
+ InternalTracker * InternalTracker `json:"internal_tracker,omitempty"`
391
+ // set this structure to use external issue tracker (requires has_issues)
392
+ ExternalTracker * ExternalTracker `json:"external_tracker,omitempty"`
352
393
// either `true` to enable the wiki for this repository or `false` to disable it.
353
394
HasUncyclo * bool `json:"has_wiki,omitempty"`
395
+ // set this structure to use external wiki instead of internal (requires has_wiki)
396
+ ExternalUncyclo * ExternalUncyclo `json:"external_wiki,omitempty"`
354
397
// sets the default branch for this repository.
355
398
DefaultBranch * string `json:"default_branch,omitempty"`
356
399
// either `true` to allow pull requests, or `false` to prevent pull request.
357
400
HasPullRequests * bool `json:"has_pull_requests,omitempty"`
401
+ // either `true` to enable project unit, or `false` to disable them.
402
+ HasProjects * bool `json:"has_projects,omitempty"`
358
403
// either `true` to ignore whitespace for conflicts, or `false` to not ignore whitespace. `has_pull_requests` must be `true`.
359
404
IgnoreWhitespaceConflicts * bool `json:"ignore_whitespace_conflicts,omitempty"`
360
405
// either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. `has_pull_requests` must be `true`.
@@ -367,6 +412,8 @@ type EditRepoOption struct {
367
412
AllowSquash * bool `json:"allow_squash_merge,omitempty"`
368
413
// set to `true` to archive this repository.
369
414
Archived * bool `json:"archived,omitempty"`
415
+ // set to a string like `8h30m0s` to set the mirror interval time
416
+ MirrorInterval * string `json:"mirror_interval,omitempty"`
370
417
}
371
418
372
419
// EditRepo edit the properties of a repository
0 commit comments