|
|
@ -1,5 +1,5 @@ |
|
|
|
//
|
|
|
|
//
|
|
|
|
// Copyright 2017, Sander van Harmelen
|
|
|
|
// Copyright 2021, Sander van Harmelen
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
@ -22,6 +22,7 @@ import ( |
|
|
|
"io" |
|
|
|
"io" |
|
|
|
"io/ioutil" |
|
|
|
"io/ioutil" |
|
|
|
"mime/multipart" |
|
|
|
"mime/multipart" |
|
|
|
|
|
|
|
"net/http" |
|
|
|
"os" |
|
|
|
"os" |
|
|
|
"time" |
|
|
|
"time" |
|
|
|
) |
|
|
|
) |
|
|
@ -38,71 +39,74 @@ type ProjectsService struct { |
|
|
|
//
|
|
|
|
//
|
|
|
|
// GitLab API docs: https://docs.gitlab.com/ce/api/projects.html
|
|
|
|
// GitLab API docs: https://docs.gitlab.com/ce/api/projects.html
|
|
|
|
type Project struct { |
|
|
|
type Project struct { |
|
|
|
ID int `json:"id"` |
|
|
|
ID int `json:"id"` |
|
|
|
Description string `json:"description"` |
|
|
|
Description string `json:"description"` |
|
|
|
DefaultBranch string `json:"default_branch"` |
|
|
|
DefaultBranch string `json:"default_branch"` |
|
|
|
Public bool `json:"public"` |
|
|
|
Public bool `json:"public"` |
|
|
|
Visibility VisibilityValue `json:"visibility"` |
|
|
|
Visibility VisibilityValue `json:"visibility"` |
|
|
|
SSHURLToRepo string `json:"ssh_url_to_repo"` |
|
|
|
SSHURLToRepo string `json:"ssh_url_to_repo"` |
|
|
|
HTTPURLToRepo string `json:"http_url_to_repo"` |
|
|
|
HTTPURLToRepo string `json:"http_url_to_repo"` |
|
|
|
WebURL string `json:"web_url"` |
|
|
|
WebURL string `json:"web_url"` |
|
|
|
ReadmeURL string `json:"readme_url"` |
|
|
|
ReadmeURL string `json:"readme_url"` |
|
|
|
TagList []string `json:"tag_list"` |
|
|
|
TagList []string `json:"tag_list"` |
|
|
|
Owner *User `json:"owner"` |
|
|
|
Owner *User `json:"owner"` |
|
|
|
Name string `json:"name"` |
|
|
|
Name string `json:"name"` |
|
|
|
NameWithNamespace string `json:"name_with_namespace"` |
|
|
|
NameWithNamespace string `json:"name_with_namespace"` |
|
|
|
Path string `json:"path"` |
|
|
|
Path string `json:"path"` |
|
|
|
PathWithNamespace string `json:"path_with_namespace"` |
|
|
|
PathWithNamespace string `json:"path_with_namespace"` |
|
|
|
IssuesEnabled bool `json:"issues_enabled"` |
|
|
|
IssuesEnabled bool `json:"issues_enabled"` |
|
|
|
OpenIssuesCount int `json:"open_issues_count"` |
|
|
|
OpenIssuesCount int `json:"open_issues_count"` |
|
|
|
MergeRequestsEnabled bool `json:"merge_requests_enabled"` |
|
|
|
MergeRequestsEnabled bool `json:"merge_requests_enabled"` |
|
|
|
ApprovalsBeforeMerge int `json:"approvals_before_merge"` |
|
|
|
ApprovalsBeforeMerge int `json:"approvals_before_merge"` |
|
|
|
JobsEnabled bool `json:"jobs_enabled"` |
|
|
|
JobsEnabled bool `json:"jobs_enabled"` |
|
|
|
WikiEnabled bool `json:"wiki_enabled"` |
|
|
|
WikiEnabled bool `json:"wiki_enabled"` |
|
|
|
SnippetsEnabled bool `json:"snippets_enabled"` |
|
|
|
SnippetsEnabled bool `json:"snippets_enabled"` |
|
|
|
ResolveOutdatedDiffDiscussions bool `json:"resolve_outdated_diff_discussions"` |
|
|
|
ResolveOutdatedDiffDiscussions bool `json:"resolve_outdated_diff_discussions"` |
|
|
|
ContainerRegistryEnabled bool `json:"container_registry_enabled"` |
|
|
|
ContainerExpirationPolicy *ContainerExpirationPolicy `json:"container_expiration_policy,omitempty"` |
|
|
|
CreatedAt *time.Time `json:"created_at,omitempty"` |
|
|
|
ContainerRegistryEnabled bool `json:"container_registry_enabled"` |
|
|
|
LastActivityAt *time.Time `json:"last_activity_at,omitempty"` |
|
|
|
CreatedAt *time.Time `json:"created_at,omitempty"` |
|
|
|
CreatorID int `json:"creator_id"` |
|
|
|
LastActivityAt *time.Time `json:"last_activity_at,omitempty"` |
|
|
|
Namespace *ProjectNamespace `json:"namespace"` |
|
|
|
CreatorID int `json:"creator_id"` |
|
|
|
ImportStatus string `json:"import_status"` |
|
|
|
Namespace *ProjectNamespace `json:"namespace"` |
|
|
|
ImportError string `json:"import_error"` |
|
|
|
ImportStatus string `json:"import_status"` |
|
|
|
Permissions *Permissions `json:"permissions"` |
|
|
|
ImportError string `json:"import_error"` |
|
|
|
MarkedForDeletionAt *ISOTime `json:"marked_for_deletion_at"` |
|
|
|
Permissions *Permissions `json:"permissions"` |
|
|
|
Archived bool `json:"archived"` |
|
|
|
MarkedForDeletionAt *ISOTime `json:"marked_for_deletion_at"` |
|
|
|
AvatarURL string `json:"avatar_url"` |
|
|
|
EmptyRepo bool `json:"empty_repo"` |
|
|
|
SharedRunnersEnabled bool `json:"shared_runners_enabled"` |
|
|
|
Archived bool `json:"archived"` |
|
|
|
ForksCount int `json:"forks_count"` |
|
|
|
AvatarURL string `json:"avatar_url"` |
|
|
|
StarCount int `json:"star_count"` |
|
|
|
SharedRunnersEnabled bool `json:"shared_runners_enabled"` |
|
|
|
RunnersToken string `json:"runners_token"` |
|
|
|
ForksCount int `json:"forks_count"` |
|
|
|
PublicBuilds bool `json:"public_builds"` |
|
|
|
StarCount int `json:"star_count"` |
|
|
|
AllowMergeOnSkippedPipeline bool `json:"allow_merge_on_skipped_pipeline"` |
|
|
|
RunnersToken string `json:"runners_token"` |
|
|
|
OnlyAllowMergeIfPipelineSucceeds bool `json:"only_allow_merge_if_pipeline_succeeds"` |
|
|
|
PublicBuilds bool `json:"public_builds"` |
|
|
|
OnlyAllowMergeIfAllDiscussionsAreResolved bool `json:"only_allow_merge_if_all_discussions_are_resolved"` |
|
|
|
AllowMergeOnSkippedPipeline bool `json:"allow_merge_on_skipped_pipeline"` |
|
|
|
RemoveSourceBranchAfterMerge bool `json:"remove_source_branch_after_merge"` |
|
|
|
OnlyAllowMergeIfPipelineSucceeds bool `json:"only_allow_merge_if_pipeline_succeeds"` |
|
|
|
LFSEnabled bool `json:"lfs_enabled"` |
|
|
|
OnlyAllowMergeIfAllDiscussionsAreResolved bool `json:"only_allow_merge_if_all_discussions_are_resolved"` |
|
|
|
RequestAccessEnabled bool `json:"request_access_enabled"` |
|
|
|
RemoveSourceBranchAfterMerge bool `json:"remove_source_branch_after_merge"` |
|
|
|
MergeMethod MergeMethodValue `json:"merge_method"` |
|
|
|
LFSEnabled bool `json:"lfs_enabled"` |
|
|
|
ForkedFromProject *ForkParent `json:"forked_from_project"` |
|
|
|
RequestAccessEnabled bool `json:"request_access_enabled"` |
|
|
|
Mirror bool `json:"mirror"` |
|
|
|
MergeMethod MergeMethodValue `json:"merge_method"` |
|
|
|
MirrorUserID int `json:"mirror_user_id"` |
|
|
|
ForkedFromProject *ForkParent `json:"forked_from_project"` |
|
|
|
MirrorTriggerBuilds bool `json:"mirror_trigger_builds"` |
|
|
|
Mirror bool `json:"mirror"` |
|
|
|
OnlyMirrorProtectedBranches bool `json:"only_mirror_protected_branches"` |
|
|
|
MirrorUserID int `json:"mirror_user_id"` |
|
|
|
MirrorOverwritesDivergedBranches bool `json:"mirror_overwrites_diverged_branches"` |
|
|
|
MirrorTriggerBuilds bool `json:"mirror_trigger_builds"` |
|
|
|
PackagesEnabled bool `json:"packages_enabled"` |
|
|
|
OnlyMirrorProtectedBranches bool `json:"only_mirror_protected_branches"` |
|
|
|
ServiceDeskEnabled bool `json:"service_desk_enabled"` |
|
|
|
MirrorOverwritesDivergedBranches bool `json:"mirror_overwrites_diverged_branches"` |
|
|
|
ServiceDeskAddress string `json:"service_desk_address"` |
|
|
|
PackagesEnabled bool `json:"packages_enabled"` |
|
|
|
IssuesAccessLevel AccessControlValue `json:"issues_access_level"` |
|
|
|
ServiceDeskEnabled bool `json:"service_desk_enabled"` |
|
|
|
RepositoryAccessLevel AccessControlValue `json:"repository_access_level"` |
|
|
|
ServiceDeskAddress string `json:"service_desk_address"` |
|
|
|
MergeRequestsAccessLevel AccessControlValue `json:"merge_requests_access_level"` |
|
|
|
IssuesAccessLevel AccessControlValue `json:"issues_access_level"` |
|
|
|
ForkingAccessLevel AccessControlValue `json:"forking_access_level"` |
|
|
|
RepositoryAccessLevel AccessControlValue `json:"repository_access_level"` |
|
|
|
WikiAccessLevel AccessControlValue `json:"wiki_access_level"` |
|
|
|
MergeRequestsAccessLevel AccessControlValue `json:"merge_requests_access_level"` |
|
|
|
BuildsAccessLevel AccessControlValue `json:"builds_access_level"` |
|
|
|
ForkingAccessLevel AccessControlValue `json:"forking_access_level"` |
|
|
|
SnippetsAccessLevel AccessControlValue `json:"snippets_access_level"` |
|
|
|
WikiAccessLevel AccessControlValue `json:"wiki_access_level"` |
|
|
|
PagesAccessLevel AccessControlValue `json:"pages_access_level"` |
|
|
|
BuildsAccessLevel AccessControlValue `json:"builds_access_level"` |
|
|
|
AutocloseReferencedIssues bool `json:"autoclose_referenced_issues"` |
|
|
|
SnippetsAccessLevel AccessControlValue `json:"snippets_access_level"` |
|
|
|
CIForwardDeploymentEnabled bool `json:"ci_forward_deployment_enabled"` |
|
|
|
PagesAccessLevel AccessControlValue `json:"pages_access_level"` |
|
|
|
|
|
|
|
OperationsAccessLevel AccessControlValue `json:"operations_access_level"` |
|
|
|
|
|
|
|
AutocloseReferencedIssues bool `json:"autoclose_referenced_issues"` |
|
|
|
|
|
|
|
CIForwardDeploymentEnabled bool `json:"ci_forward_deployment_enabled"` |
|
|
|
SharedWithGroups []struct { |
|
|
|
SharedWithGroups []struct { |
|
|
|
GroupID int `json:"group_id"` |
|
|
|
GroupID int `json:"group_id"` |
|
|
|
GroupName string `json:"group_name"` |
|
|
|
GroupName string `json:"group_name"` |
|
|
@ -116,6 +120,17 @@ type Project struct { |
|
|
|
ComplianceFrameworks []string `json:"compliance_frameworks"` |
|
|
|
ComplianceFrameworks []string `json:"compliance_frameworks"` |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ContainerExpirationPolicy represents the container expiration policy.
|
|
|
|
|
|
|
|
type ContainerExpirationPolicy struct { |
|
|
|
|
|
|
|
Cadence string `json:"cadence"` |
|
|
|
|
|
|
|
KeepN int `json:"keep_n"` |
|
|
|
|
|
|
|
OlderThan string `json:"older_than"` |
|
|
|
|
|
|
|
NameRegexDelete string `json:"name_regex_delete"` |
|
|
|
|
|
|
|
NameRegexKeep string `json:"name_regex_keep"` |
|
|
|
|
|
|
|
Enabled bool `json:"enabled"` |
|
|
|
|
|
|
|
NextRunAt *time.Time `json:"next_run_at"` |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Repository represents a repository.
|
|
|
|
// Repository represents a repository.
|
|
|
|
type Repository struct { |
|
|
|
type Repository struct { |
|
|
|
Name string `json:"name"` |
|
|
|
Name string `json:"name"` |
|
|
@ -257,7 +272,7 @@ type ListProjectsOptions struct { |
|
|
|
//
|
|
|
|
//
|
|
|
|
// GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#list-projects
|
|
|
|
// GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#list-projects
|
|
|
|
func (s *ProjectsService) ListProjects(opt *ListProjectsOptions, options ...RequestOptionFunc) ([]*Project, *Response, error) { |
|
|
|
func (s *ProjectsService) ListProjects(opt *ListProjectsOptions, options ...RequestOptionFunc) ([]*Project, *Response, error) { |
|
|
|
req, err := s.client.NewRequest("GET", "projects", opt, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodGet, "projects", opt, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -282,7 +297,7 @@ func (s *ProjectsService) ListUserProjects(uid interface{}, opt *ListProjectsOpt |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("users/%s/projects", user) |
|
|
|
u := fmt.Sprintf("users/%s/projects", user) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("GET", u, opt, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodGet, u, opt, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -325,7 +340,7 @@ func (s *ProjectsService) ListProjectsUsers(pid interface{}, opt *ListProjectUse |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/users", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/users", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("GET", u, opt, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodGet, u, opt, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -354,7 +369,7 @@ func (s *ProjectsService) GetProjectLanguages(pid interface{}, options ...Reques |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/languages", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/languages", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("GET", u, nil, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodGet, u, nil, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -389,7 +404,7 @@ func (s *ProjectsService) GetProject(pid interface{}, opt *GetProjectOptions, op |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("GET", u, opt, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodGet, u, opt, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -450,7 +465,7 @@ func (s *ProjectsService) GetProjectEvents(pid interface{}, opt *GetProjectEvent |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/events", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/events", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("GET", u, opt, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodGet, u, opt, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -468,55 +483,57 @@ func (s *ProjectsService) GetProjectEvents(pid interface{}, opt *GetProjectEvent |
|
|
|
//
|
|
|
|
//
|
|
|
|
// GitLab API docs: https://docs.gitlab.com/ee/api/projects.html#create-project
|
|
|
|
// GitLab API docs: https://docs.gitlab.com/ee/api/projects.html#create-project
|
|
|
|
type CreateProjectOptions struct { |
|
|
|
type CreateProjectOptions struct { |
|
|
|
Name *string `url:"name,omitempty" json:"name,omitempty"` |
|
|
|
Name *string `url:"name,omitempty" json:"name,omitempty"` |
|
|
|
Path *string `url:"path,omitempty" json:"path,omitempty"` |
|
|
|
Path *string `url:"path,omitempty" json:"path,omitempty"` |
|
|
|
NamespaceID *int `url:"namespace_id,omitempty" json:"namespace_id,omitempty"` |
|
|
|
NamespaceID *int `url:"namespace_id,omitempty" json:"namespace_id,omitempty"` |
|
|
|
DefaultBranch *string `url:"default_branch,omitempty" json:"default_branch,omitempty"` |
|
|
|
DefaultBranch *string `url:"default_branch,omitempty" json:"default_branch,omitempty"` |
|
|
|
Description *string `url:"description,omitempty" json:"description,omitempty"` |
|
|
|
Description *string `url:"description,omitempty" json:"description,omitempty"` |
|
|
|
IssuesAccessLevel *AccessControlValue `url:"issues_access_level,omitempty" json:"issues_access_level,omitempty"` |
|
|
|
IssuesAccessLevel *AccessControlValue `url:"issues_access_level,omitempty" json:"issues_access_level,omitempty"` |
|
|
|
RepositoryAccessLevel *AccessControlValue `url:"repository_access_level,omitempty" json:"repository_access_level,omitempty"` |
|
|
|
RepositoryAccessLevel *AccessControlValue `url:"repository_access_level,omitempty" json:"repository_access_level,omitempty"` |
|
|
|
MergeRequestsAccessLevel *AccessControlValue `url:"merge_requests_access_level,omitempty" json:"merge_requests_access_level,omitempty"` |
|
|
|
MergeRequestsAccessLevel *AccessControlValue `url:"merge_requests_access_level,omitempty" json:"merge_requests_access_level,omitempty"` |
|
|
|
ForkingAccessLevel *AccessControlValue `url:"forking_access_level,omitempty" json:"forking_access_level,omitempty"` |
|
|
|
ForkingAccessLevel *AccessControlValue `url:"forking_access_level,omitempty" json:"forking_access_level,omitempty"` |
|
|
|
BuildsAccessLevel *AccessControlValue `url:"builds_access_level,omitempty" json:"builds_access_level,omitempty"` |
|
|
|
BuildsAccessLevel *AccessControlValue `url:"builds_access_level,omitempty" json:"builds_access_level,omitempty"` |
|
|
|
WikiAccessLevel *AccessControlValue `url:"wiki_access_level,omitempty" json:"wiki_access_level,omitempty"` |
|
|
|
WikiAccessLevel *AccessControlValue `url:"wiki_access_level,omitempty" json:"wiki_access_level,omitempty"` |
|
|
|
SnippetsAccessLevel *AccessControlValue `url:"snippets_access_level,omitempty" json:"snippets_access_level,omitempty"` |
|
|
|
SnippetsAccessLevel *AccessControlValue `url:"snippets_access_level,omitempty" json:"snippets_access_level,omitempty"` |
|
|
|
PagesAccessLevel *AccessControlValue `url:"pages_access_level,omitempty" json:"pages_access_level,omitempty"` |
|
|
|
PagesAccessLevel *AccessControlValue `url:"pages_access_level,omitempty" json:"pages_access_level,omitempty"` |
|
|
|
EmailsDisabled *bool `url:"emails_disabled,omitempty" json:"emails_disabled,omitempty"` |
|
|
|
OperationsAccessLevel *AccessControlValue `url:"operations_access_level,omitempty" json:"operations_access_level,omitempty"` |
|
|
|
ResolveOutdatedDiffDiscussions *bool `url:"resolve_outdated_diff_discussions,omitempty" json:"resolve_outdated_diff_discussions,omitempty"` |
|
|
|
EmailsDisabled *bool `url:"emails_disabled,omitempty" json:"emails_disabled,omitempty"` |
|
|
|
ContainerRegistryEnabled *bool `url:"container_registry_enabled,omitempty" json:"container_registry_enabled,omitempty"` |
|
|
|
ResolveOutdatedDiffDiscussions *bool `url:"resolve_outdated_diff_discussions,omitempty" json:"resolve_outdated_diff_discussions,omitempty"` |
|
|
|
SharedRunnersEnabled *bool `url:"shared_runners_enabled,omitempty" json:"shared_runners_enabled,omitempty"` |
|
|
|
ContainerExpirationPolicyAttributes *ContainerExpirationPolicyAttributes `url:"container_expiration_policy_attributes,omitempty" json:"container_expiration_policy_attributes,omitempty"` |
|
|
|
Visibility *VisibilityValue `url:"visibility,omitempty" json:"visibility,omitempty"` |
|
|
|
ContainerRegistryEnabled *bool `url:"container_registry_enabled,omitempty" json:"container_registry_enabled,omitempty"` |
|
|
|
ImportURL *string `url:"import_url,omitempty" json:"import_url,omitempty"` |
|
|
|
SharedRunnersEnabled *bool `url:"shared_runners_enabled,omitempty" json:"shared_runners_enabled,omitempty"` |
|
|
|
PublicBuilds *bool `url:"public_builds,omitempty" json:"public_builds,omitempty"` |
|
|
|
Visibility *VisibilityValue `url:"visibility,omitempty" json:"visibility,omitempty"` |
|
|
|
AllowMergeOnSkippedPipeline *bool `url:"allow_merge_on_skipped_pipeline,omitempty" json:"allow_merge_on_skipped_pipeline,omitempty"` |
|
|
|
ImportURL *string `url:"import_url,omitempty" json:"import_url,omitempty"` |
|
|
|
OnlyAllowMergeIfPipelineSucceeds *bool `url:"only_allow_merge_if_pipeline_succeeds,omitempty" json:"only_allow_merge_if_pipeline_succeeds,omitempty"` |
|
|
|
PublicBuilds *bool `url:"public_builds,omitempty" json:"public_builds,omitempty"` |
|
|
|
OnlyAllowMergeIfAllDiscussionsAreResolved *bool `url:"only_allow_merge_if_all_discussions_are_resolved,omitempty" json:"only_allow_merge_if_all_discussions_are_resolved,omitempty"` |
|
|
|
AllowMergeOnSkippedPipeline *bool `url:"allow_merge_on_skipped_pipeline,omitempty" json:"allow_merge_on_skipped_pipeline,omitempty"` |
|
|
|
MergeMethod *MergeMethodValue `url:"merge_method,omitempty" json:"merge_method,omitempty"` |
|
|
|
OnlyAllowMergeIfPipelineSucceeds *bool `url:"only_allow_merge_if_pipeline_succeeds,omitempty" json:"only_allow_merge_if_pipeline_succeeds,omitempty"` |
|
|
|
RemoveSourceBranchAfterMerge *bool `url:"remove_source_branch_after_merge,omitempty" json:"remove_source_branch_after_merge,omitempty"` |
|
|
|
OnlyAllowMergeIfAllDiscussionsAreResolved *bool `url:"only_allow_merge_if_all_discussions_are_resolved,omitempty" json:"only_allow_merge_if_all_discussions_are_resolved,omitempty"` |
|
|
|
LFSEnabled *bool `url:"lfs_enabled,omitempty" json:"lfs_enabled,omitempty"` |
|
|
|
MergeMethod *MergeMethodValue `url:"merge_method,omitempty" json:"merge_method,omitempty"` |
|
|
|
RequestAccessEnabled *bool `url:"request_access_enabled,omitempty" json:"request_access_enabled,omitempty"` |
|
|
|
RemoveSourceBranchAfterMerge *bool `url:"remove_source_branch_after_merge,omitempty" json:"remove_source_branch_after_merge,omitempty"` |
|
|
|
TagList *[]string `url:"tag_list,omitempty" json:"tag_list,omitempty"` |
|
|
|
LFSEnabled *bool `url:"lfs_enabled,omitempty" json:"lfs_enabled,omitempty"` |
|
|
|
PrintingMergeRequestLinkEnabled *bool `url:"printing_merge_request_link_enabled,omitempty" json:"printing_merge_request_link_enabled,omitempty"` |
|
|
|
RequestAccessEnabled *bool `url:"request_access_enabled,omitempty" json:"request_access_enabled,omitempty"` |
|
|
|
BuildGitStrategy *string `url:"build_git_strategy,omitempty" json:"build_git_strategy,omitempty"` |
|
|
|
TagList *[]string `url:"tag_list,omitempty" json:"tag_list,omitempty"` |
|
|
|
BuildTimeout *int `url:"build_timeout,omitempty" json:"build_timeout,omitempty"` |
|
|
|
PrintingMergeRequestLinkEnabled *bool `url:"printing_merge_request_link_enabled,omitempty" json:"printing_merge_request_link_enabled,omitempty"` |
|
|
|
AutoCancelPendingPipelines *string `url:"auto_cancel_pending_pipelines,omitempty" json:"auto_cancel_pending_pipelines,omitempty"` |
|
|
|
BuildGitStrategy *string `url:"build_git_strategy,omitempty" json:"build_git_strategy,omitempty"` |
|
|
|
BuildCoverageRegex *string `url:"build_coverage_regex,omitempty" json:"build_coverage_regex,omitempty"` |
|
|
|
BuildTimeout *int `url:"build_timeout,omitempty" json:"build_timeout,omitempty"` |
|
|
|
CIConfigPath *string `url:"ci_config_path,omitempty" json:"ci_config_path,omitempty"` |
|
|
|
AutoCancelPendingPipelines *string `url:"auto_cancel_pending_pipelines,omitempty" json:"auto_cancel_pending_pipelines,omitempty"` |
|
|
|
CIForwardDeploymentEnabled *bool `url:"ci_forward_deployment_enabled,omitempty" json:"ci_forward_deployment_enabled,omitempty"` |
|
|
|
BuildCoverageRegex *string `url:"build_coverage_regex,omitempty" json:"build_coverage_regex,omitempty"` |
|
|
|
AutoDevopsEnabled *bool `url:"auto_devops_enabled,omitempty" json:"auto_devops_enabled,omitempty"` |
|
|
|
CIConfigPath *string `url:"ci_config_path,omitempty" json:"ci_config_path,omitempty"` |
|
|
|
AutoDevopsDeployStrategy *string `url:"auto_devops_deploy_strategy,omitempty" json:"auto_devops_deploy_strategy,omitempty"` |
|
|
|
CIForwardDeploymentEnabled *bool `url:"ci_forward_deployment_enabled,omitempty" json:"ci_forward_deployment_enabled,omitempty"` |
|
|
|
ApprovalsBeforeMerge *int `url:"approvals_before_merge,omitempty" json:"approvals_before_merge,omitempty"` |
|
|
|
AutoDevopsEnabled *bool `url:"auto_devops_enabled,omitempty" json:"auto_devops_enabled,omitempty"` |
|
|
|
ExternalAuthorizationClassificationLabel *string `url:"external_authorization_classification_label,omitempty" json:"external_authorization_classification_label,omitempty"` |
|
|
|
AutoDevopsDeployStrategy *string `url:"auto_devops_deploy_strategy,omitempty" json:"auto_devops_deploy_strategy,omitempty"` |
|
|
|
Mirror *bool `url:"mirror,omitempty" json:"mirror,omitempty"` |
|
|
|
ApprovalsBeforeMerge *int `url:"approvals_before_merge,omitempty" json:"approvals_before_merge,omitempty"` |
|
|
|
MirrorTriggerBuilds *bool `url:"mirror_trigger_builds,omitempty" json:"mirror_trigger_builds,omitempty"` |
|
|
|
ExternalAuthorizationClassificationLabel *string `url:"external_authorization_classification_label,omitempty" json:"external_authorization_classification_label,omitempty"` |
|
|
|
InitializeWithReadme *bool `url:"initialize_with_readme,omitempty" json:"initialize_with_readme,omitempty"` |
|
|
|
Mirror *bool `url:"mirror,omitempty" json:"mirror,omitempty"` |
|
|
|
TemplateName *string `url:"template_name,omitempty" json:"template_name,omitempty"` |
|
|
|
MirrorTriggerBuilds *bool `url:"mirror_trigger_builds,omitempty" json:"mirror_trigger_builds,omitempty"` |
|
|
|
TemplateProjectID *int `url:"template_project_id,omitempty" json:"template_project_id,omitempty"` |
|
|
|
InitializeWithReadme *bool `url:"initialize_with_readme,omitempty" json:"initialize_with_readme,omitempty"` |
|
|
|
UseCustomTemplate *bool `url:"use_custom_template,omitempty" json:"use_custom_template,omitempty"` |
|
|
|
TemplateName *string `url:"template_name,omitempty" json:"template_name,omitempty"` |
|
|
|
GroupWithProjectTemplatesID *int `url:"group_with_project_templates_id,omitempty" json:"group_with_project_templates_id,omitempty"` |
|
|
|
TemplateProjectID *int `url:"template_project_id,omitempty" json:"template_project_id,omitempty"` |
|
|
|
PackagesEnabled *bool `url:"packages_enabled,omitempty" json:"packages_enabled,omitempty"` |
|
|
|
UseCustomTemplate *bool `url:"use_custom_template,omitempty" json:"use_custom_template,omitempty"` |
|
|
|
ServiceDeskEnabled *bool `url:"service_desk_enabled,omitempty" json:"service_desk_enabled,omitempty"` |
|
|
|
GroupWithProjectTemplatesID *int `url:"group_with_project_templates_id,omitempty" json:"group_with_project_templates_id,omitempty"` |
|
|
|
AutocloseReferencedIssues *bool `url:"autoclose_referenced_issues,omitempty" json:"autoclose_referenced_issues,omitempty"` |
|
|
|
PackagesEnabled *bool `url:"packages_enabled,omitempty" json:"packages_enabled,omitempty"` |
|
|
|
|
|
|
|
ServiceDeskEnabled *bool `url:"service_desk_enabled,omitempty" json:"service_desk_enabled,omitempty"` |
|
|
|
|
|
|
|
AutocloseReferencedIssues *bool `url:"autoclose_referenced_issues,omitempty" json:"autoclose_referenced_issues,omitempty"` |
|
|
|
|
|
|
|
|
|
|
|
// Deprecated members
|
|
|
|
// Deprecated members
|
|
|
|
IssuesEnabled *bool `url:"issues_enabled,omitempty" json:"issues_enabled,omitempty"` |
|
|
|
IssuesEnabled *bool `url:"issues_enabled,omitempty" json:"issues_enabled,omitempty"` |
|
|
@ -526,11 +543,34 @@ type CreateProjectOptions struct { |
|
|
|
SnippetsEnabled *bool `url:"snippets_enabled,omitempty" json:"snippets_enabled,omitempty"` |
|
|
|
SnippetsEnabled *bool `url:"snippets_enabled,omitempty" json:"snippets_enabled,omitempty"` |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ContainerExpirationPolicyAttributes represents the available container
|
|
|
|
|
|
|
|
// expiration policy attributes.
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// GitLab API docs: https://docs.gitlab.com/ee/api/projects.html#create-project
|
|
|
|
|
|
|
|
type ContainerExpirationPolicyAttributes struct { |
|
|
|
|
|
|
|
Cadence *string `url:"cadence,omitempty" json:"cadence,omitempty"` |
|
|
|
|
|
|
|
KeepN *int `url:"keep_n,omitempty" json:"keep_n,omitempty"` |
|
|
|
|
|
|
|
OlderThan *string `url:"older_than,omitempty" json:"older_than,omitempty"` |
|
|
|
|
|
|
|
NameRegexDelete *string `url:"name_regex_delete,omitempty" json:"name_regex_delete,omitempty"` |
|
|
|
|
|
|
|
NameRegexKeep *string `url:"name_regex_keep,omitempty" json:"name_regex_keep,omitempty"` |
|
|
|
|
|
|
|
Enabled *bool `url:"enabled,omitempty" json:"enabled,omitempty"` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Deprecated members
|
|
|
|
|
|
|
|
NameRegex *string `url:"name_regex,omitempty" json:"name_regex,omitempty"` |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// CreateProject creates a new project owned by the authenticated user.
|
|
|
|
// CreateProject creates a new project owned by the authenticated user.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#create-project
|
|
|
|
// GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#create-project
|
|
|
|
func (s *ProjectsService) CreateProject(opt *CreateProjectOptions, options ...RequestOptionFunc) (*Project, *Response, error) { |
|
|
|
func (s *ProjectsService) CreateProject(opt *CreateProjectOptions, options ...RequestOptionFunc) (*Project, *Response, error) { |
|
|
|
req, err := s.client.NewRequest("POST", "projects", opt, options) |
|
|
|
if opt.ContainerExpirationPolicyAttributes != nil { |
|
|
|
|
|
|
|
// This is needed to satisfy the API. Should be deleted
|
|
|
|
|
|
|
|
// when NameRegex is removed (it's now deprecated).
|
|
|
|
|
|
|
|
opt.ContainerExpirationPolicyAttributes.NameRegex = |
|
|
|
|
|
|
|
opt.ContainerExpirationPolicyAttributes.NameRegexDelete |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest(http.MethodPost, "projects", opt, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -557,9 +597,15 @@ type CreateProjectForUserOptions CreateProjectOptions |
|
|
|
// GitLab API docs:
|
|
|
|
// GitLab API docs:
|
|
|
|
// https://docs.gitlab.com/ce/api/projects.html#create-project-for-user
|
|
|
|
// https://docs.gitlab.com/ce/api/projects.html#create-project-for-user
|
|
|
|
func (s *ProjectsService) CreateProjectForUser(user int, opt *CreateProjectForUserOptions, options ...RequestOptionFunc) (*Project, *Response, error) { |
|
|
|
func (s *ProjectsService) CreateProjectForUser(user int, opt *CreateProjectForUserOptions, options ...RequestOptionFunc) (*Project, *Response, error) { |
|
|
|
u := fmt.Sprintf("projects/user/%d", user) |
|
|
|
if opt.ContainerExpirationPolicyAttributes != nil { |
|
|
|
|
|
|
|
// This is needed to satisfy the API. Should be deleted
|
|
|
|
|
|
|
|
// when NameRegex is removed (it's now deprecated).
|
|
|
|
|
|
|
|
opt.ContainerExpirationPolicyAttributes.NameRegex = |
|
|
|
|
|
|
|
opt.ContainerExpirationPolicyAttributes.NameRegexDelete |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("POST", u, opt, options) |
|
|
|
u := fmt.Sprintf("projects/user/%d", user) |
|
|
|
|
|
|
|
req, err := s.client.NewRequest(http.MethodPost, u, opt, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -577,52 +623,54 @@ func (s *ProjectsService) CreateProjectForUser(user int, opt *CreateProjectForUs |
|
|
|
//
|
|
|
|
//
|
|
|
|
// GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#edit-project
|
|
|
|
// GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#edit-project
|
|
|
|
type EditProjectOptions struct { |
|
|
|
type EditProjectOptions struct { |
|
|
|
Name *string `url:"name,omitempty" json:"name,omitempty"` |
|
|
|
Name *string `url:"name,omitempty" json:"name,omitempty"` |
|
|
|
Path *string `url:"path,omitempty" json:"path,omitempty"` |
|
|
|
Path *string `url:"path,omitempty" json:"path,omitempty"` |
|
|
|
DefaultBranch *string `url:"default_branch,omitempty" json:"default_branch,omitempty"` |
|
|
|
DefaultBranch *string `url:"default_branch,omitempty" json:"default_branch,omitempty"` |
|
|
|
Description *string `url:"description,omitempty" json:"description,omitempty"` |
|
|
|
Description *string `url:"description,omitempty" json:"description,omitempty"` |
|
|
|
IssuesAccessLevel *AccessControlValue `url:"issues_access_level,omitempty" json:"issues_access_level,omitempty"` |
|
|
|
IssuesAccessLevel *AccessControlValue `url:"issues_access_level,omitempty" json:"issues_access_level,omitempty"` |
|
|
|
RepositoryAccessLevel *AccessControlValue `url:"repository_access_level,omitempty" json:"repository_access_level,omitempty"` |
|
|
|
RepositoryAccessLevel *AccessControlValue `url:"repository_access_level,omitempty" json:"repository_access_level,omitempty"` |
|
|
|
MergeRequestsAccessLevel *AccessControlValue `url:"merge_requests_access_level,omitempty" json:"merge_requests_access_level,omitempty"` |
|
|
|
MergeRequestsAccessLevel *AccessControlValue `url:"merge_requests_access_level,omitempty" json:"merge_requests_access_level,omitempty"` |
|
|
|
ForkingAccessLevel *AccessControlValue `url:"forking_access_level,omitempty" json:"forking_access_level,omitempty"` |
|
|
|
ForkingAccessLevel *AccessControlValue `url:"forking_access_level,omitempty" json:"forking_access_level,omitempty"` |
|
|
|
BuildsAccessLevel *AccessControlValue `url:"builds_access_level,omitempty" json:"builds_access_level,omitempty"` |
|
|
|
BuildsAccessLevel *AccessControlValue `url:"builds_access_level,omitempty" json:"builds_access_level,omitempty"` |
|
|
|
WikiAccessLevel *AccessControlValue `url:"wiki_access_level,omitempty" json:"wiki_access_level,omitempty"` |
|
|
|
WikiAccessLevel *AccessControlValue `url:"wiki_access_level,omitempty" json:"wiki_access_level,omitempty"` |
|
|
|
SnippetsAccessLevel *AccessControlValue `url:"snippets_access_level,omitempty" json:"snippets_access_level,omitempty"` |
|
|
|
SnippetsAccessLevel *AccessControlValue `url:"snippets_access_level,omitempty" json:"snippets_access_level,omitempty"` |
|
|
|
PagesAccessLevel *AccessControlValue `url:"pages_access_level,omitempty" json:"pages_access_level,omitempty"` |
|
|
|
PagesAccessLevel *AccessControlValue `url:"pages_access_level,omitempty" json:"pages_access_level,omitempty"` |
|
|
|
EmailsDisabled *bool `url:"emails_disabled,omitempty" json:"emails_disabled,omitempty"` |
|
|
|
OperationsAccessLevel *AccessControlValue `url:"operations_access_level,omitempty" json:"operations_access_level,omitempty"` |
|
|
|
ResolveOutdatedDiffDiscussions *bool `url:"resolve_outdated_diff_discussions,omitempty" json:"resolve_outdated_diff_discussions,omitempty"` |
|
|
|
EmailsDisabled *bool `url:"emails_disabled,omitempty" json:"emails_disabled,omitempty"` |
|
|
|
ContainerRegistryEnabled *bool `url:"container_registry_enabled,omitempty" json:"container_registry_enabled,omitempty"` |
|
|
|
ResolveOutdatedDiffDiscussions *bool `url:"resolve_outdated_diff_discussions,omitempty" json:"resolve_outdated_diff_discussions,omitempty"` |
|
|
|
SharedRunnersEnabled *bool `url:"shared_runners_enabled,omitempty" json:"shared_runners_enabled,omitempty"` |
|
|
|
ContainerExpirationPolicyAttributes *ContainerExpirationPolicyAttributes `url:"container_expiration_policy_attributes,omitempty" json:"container_expiration_policy_attributes,omitempty"` |
|
|
|
Visibility *VisibilityValue `url:"visibility,omitempty" json:"visibility,omitempty"` |
|
|
|
ContainerRegistryEnabled *bool `url:"container_registry_enabled,omitempty" json:"container_registry_enabled,omitempty"` |
|
|
|
ImportURL *string `url:"import_url,omitempty" json:"import_url,omitempty"` |
|
|
|
SharedRunnersEnabled *bool `url:"shared_runners_enabled,omitempty" json:"shared_runners_enabled,omitempty"` |
|
|
|
PublicBuilds *bool `url:"public_builds,omitempty" json:"public_builds,omitempty"` |
|
|
|
Visibility *VisibilityValue `url:"visibility,omitempty" json:"visibility,omitempty"` |
|
|
|
AllowMergeOnSkippedPipeline *bool `url:"allow_merge_on_skipped_pipeline,omitempty" json:"allow_merge_on_skipped_pipeline,omitempty"` |
|
|
|
ImportURL *string `url:"import_url,omitempty" json:"import_url,omitempty"` |
|
|
|
OnlyAllowMergeIfPipelineSucceeds *bool `url:"only_allow_merge_if_pipeline_succeeds,omitempty" json:"only_allow_merge_if_pipeline_succeeds,omitempty"` |
|
|
|
PublicBuilds *bool `url:"public_builds,omitempty" json:"public_builds,omitempty"` |
|
|
|
OnlyAllowMergeIfAllDiscussionsAreResolved *bool `url:"only_allow_merge_if_all_discussions_are_resolved,omitempty" json:"only_allow_merge_if_all_discussions_are_resolved,omitempty"` |
|
|
|
AllowMergeOnSkippedPipeline *bool `url:"allow_merge_on_skipped_pipeline,omitempty" json:"allow_merge_on_skipped_pipeline,omitempty"` |
|
|
|
MergeMethod *MergeMethodValue `url:"merge_method,omitempty" json:"merge_method,omitempty"` |
|
|
|
OnlyAllowMergeIfPipelineSucceeds *bool `url:"only_allow_merge_if_pipeline_succeeds,omitempty" json:"only_allow_merge_if_pipeline_succeeds,omitempty"` |
|
|
|
RemoveSourceBranchAfterMerge *bool `url:"remove_source_branch_after_merge,omitempty" json:"remove_source_branch_after_merge,omitempty"` |
|
|
|
OnlyAllowMergeIfAllDiscussionsAreResolved *bool `url:"only_allow_merge_if_all_discussions_are_resolved,omitempty" json:"only_allow_merge_if_all_discussions_are_resolved,omitempty"` |
|
|
|
LFSEnabled *bool `url:"lfs_enabled,omitempty" json:"lfs_enabled,omitempty"` |
|
|
|
MergeMethod *MergeMethodValue `url:"merge_method,omitempty" json:"merge_method,omitempty"` |
|
|
|
RequestAccessEnabled *bool `url:"request_access_enabled,omitempty" json:"request_access_enabled,omitempty"` |
|
|
|
RemoveSourceBranchAfterMerge *bool `url:"remove_source_branch_after_merge,omitempty" json:"remove_source_branch_after_merge,omitempty"` |
|
|
|
TagList *[]string `url:"tag_list,omitempty" json:"tag_list,omitempty"` |
|
|
|
LFSEnabled *bool `url:"lfs_enabled,omitempty" json:"lfs_enabled,omitempty"` |
|
|
|
BuildGitStrategy *string `url:"build_git_strategy,omitempty" json:"build_git_strategy,omitempty"` |
|
|
|
RequestAccessEnabled *bool `url:"request_access_enabled,omitempty" json:"request_access_enabled,omitempty"` |
|
|
|
BuildTimeout *int `url:"build_timeout,omitempty" json:"build_timeout,omitempty"` |
|
|
|
TagList *[]string `url:"tag_list,omitempty" json:"tag_list,omitempty"` |
|
|
|
AutoCancelPendingPipelines *string `url:"auto_cancel_pending_pipelines,omitempty" json:"auto_cancel_pending_pipelines,omitempty"` |
|
|
|
BuildGitStrategy *string `url:"build_git_strategy,omitempty" json:"build_git_strategy,omitempty"` |
|
|
|
BuildCoverageRegex *string `url:"build_coverage_regex,omitempty" json:"build_coverage_regex,omitempty"` |
|
|
|
BuildTimeout *int `url:"build_timeout,omitempty" json:"build_timeout,omitempty"` |
|
|
|
CIConfigPath *string `url:"ci_config_path,omitempty" json:"ci_config_path,omitempty"` |
|
|
|
AutoCancelPendingPipelines *string `url:"auto_cancel_pending_pipelines,omitempty" json:"auto_cancel_pending_pipelines,omitempty"` |
|
|
|
CIForwardDeploymentEnabled *bool `url:"ci_forward_deployment_enabled,omitempty" json:"ci_forward_deployment_enabled,omitempty"` |
|
|
|
BuildCoverageRegex *string `url:"build_coverage_regex,omitempty" json:"build_coverage_regex,omitempty"` |
|
|
|
CIDefaultGitDepth *int `url:"ci_default_git_depth,omitempty" json:"ci_default_git_depth,omitempty"` |
|
|
|
CIConfigPath *string `url:"ci_config_path,omitempty" json:"ci_config_path,omitempty"` |
|
|
|
AutoDevopsEnabled *bool `url:"auto_devops_enabled,omitempty" json:"auto_devops_enabled,omitempty"` |
|
|
|
CIForwardDeploymentEnabled *bool `url:"ci_forward_deployment_enabled,omitempty" json:"ci_forward_deployment_enabled,omitempty"` |
|
|
|
AutoDevopsDeployStrategy *string `url:"auto_devops_deploy_strategy,omitempty" json:"auto_devops_deploy_strategy,omitempty"` |
|
|
|
CIDefaultGitDepth *int `url:"ci_default_git_depth,omitempty" json:"ci_default_git_depth,omitempty"` |
|
|
|
ApprovalsBeforeMerge *int `url:"approvals_before_merge,omitempty" json:"approvals_before_merge,omitempty"` |
|
|
|
AutoDevopsEnabled *bool `url:"auto_devops_enabled,omitempty" json:"auto_devops_enabled,omitempty"` |
|
|
|
ExternalAuthorizationClassificationLabel *string `url:"external_authorization_classification_label,omitempty" json:"external_authorization_classification_label,omitempty"` |
|
|
|
AutoDevopsDeployStrategy *string `url:"auto_devops_deploy_strategy,omitempty" json:"auto_devops_deploy_strategy,omitempty"` |
|
|
|
Mirror *bool `url:"mirror,omitempty" json:"mirror,omitempty"` |
|
|
|
ApprovalsBeforeMerge *int `url:"approvals_before_merge,omitempty" json:"approvals_before_merge,omitempty"` |
|
|
|
MirrorUserID *int `url:"mirror_user_id,omitempty" json:"mirror_user_id,omitempty"` |
|
|
|
ExternalAuthorizationClassificationLabel *string `url:"external_authorization_classification_label,omitempty" json:"external_authorization_classification_label,omitempty"` |
|
|
|
MirrorTriggerBuilds *bool `url:"mirror_trigger_builds,omitempty" json:"mirror_trigger_builds,omitempty"` |
|
|
|
Mirror *bool `url:"mirror,omitempty" json:"mirror,omitempty"` |
|
|
|
OnlyMirrorProtectedBranches *bool `url:"only_mirror_protected_branches,omitempty" json:"only_mirror_protected_branches,omitempty"` |
|
|
|
MirrorUserID *int `url:"mirror_user_id,omitempty" json:"mirror_user_id,omitempty"` |
|
|
|
MirrorOverwritesDivergedBranches *bool `url:"mirror_overwrites_diverged_branches,omitempty" json:"mirror_overwrites_diverged_branches,omitempty"` |
|
|
|
MirrorTriggerBuilds *bool `url:"mirror_trigger_builds,omitempty" json:"mirror_trigger_builds,omitempty"` |
|
|
|
PackagesEnabled *bool `url:"packages_enabled,omitempty" json:"packages_enabled,omitempty"` |
|
|
|
OnlyMirrorProtectedBranches *bool `url:"only_mirror_protected_branches,omitempty" json:"only_mirror_protected_branches,omitempty"` |
|
|
|
ServiceDeskEnabled *bool `url:"service_desk_enabled,omitempty" json:"service_desk_enabled,omitempty"` |
|
|
|
MirrorOverwritesDivergedBranches *bool `url:"mirror_overwrites_diverged_branches,omitempty" json:"mirror_overwrites_diverged_branches,omitempty"` |
|
|
|
AutocloseReferencedIssues *bool `url:"autoclose_referenced_issues,omitempty" json:"autoclose_referenced_issues,omitempty"` |
|
|
|
PackagesEnabled *bool `url:"packages_enabled,omitempty" json:"packages_enabled,omitempty"` |
|
|
|
|
|
|
|
ServiceDeskEnabled *bool `url:"service_desk_enabled,omitempty" json:"service_desk_enabled,omitempty"` |
|
|
|
|
|
|
|
AutocloseReferencedIssues *bool `url:"autoclose_referenced_issues,omitempty" json:"autoclose_referenced_issues,omitempty"` |
|
|
|
|
|
|
|
|
|
|
|
// Deprecated members
|
|
|
|
// Deprecated members
|
|
|
|
IssuesEnabled *bool `url:"issues_enabled,omitempty" json:"issues_enabled,omitempty"` |
|
|
|
IssuesEnabled *bool `url:"issues_enabled,omitempty" json:"issues_enabled,omitempty"` |
|
|
@ -636,13 +684,20 @@ type EditProjectOptions struct { |
|
|
|
//
|
|
|
|
//
|
|
|
|
// GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#edit-project
|
|
|
|
// GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#edit-project
|
|
|
|
func (s *ProjectsService) EditProject(pid interface{}, opt *EditProjectOptions, options ...RequestOptionFunc) (*Project, *Response, error) { |
|
|
|
func (s *ProjectsService) EditProject(pid interface{}, opt *EditProjectOptions, options ...RequestOptionFunc) (*Project, *Response, error) { |
|
|
|
|
|
|
|
if opt.ContainerExpirationPolicyAttributes != nil { |
|
|
|
|
|
|
|
// This is needed to satisfy the API. Should be deleted
|
|
|
|
|
|
|
|
// when NameRegex is removed (it's now deprecated).
|
|
|
|
|
|
|
|
opt.ContainerExpirationPolicyAttributes.NameRegex = |
|
|
|
|
|
|
|
opt.ContainerExpirationPolicyAttributes.NameRegexDelete |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
project, err := parseID(pid) |
|
|
|
project, err := parseID(pid) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("PUT", u, opt, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodPut, u, opt, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -676,7 +731,7 @@ func (s *ProjectsService) ForkProject(pid interface{}, opt *ForkProjectOptions, |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/fork", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/fork", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("POST", u, opt, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodPost, u, opt, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -701,7 +756,7 @@ func (s *ProjectsService) StarProject(pid interface{}, options ...RequestOptionF |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/star", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/star", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("POST", u, nil, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodPost, u, nil, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -726,7 +781,7 @@ func (s *ProjectsService) UnstarProject(pid interface{}, options ...RequestOptio |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/unstar", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/unstar", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("POST", u, nil, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodPost, u, nil, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -752,7 +807,7 @@ func (s *ProjectsService) ArchiveProject(pid interface{}, options ...RequestOpti |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/archive", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/archive", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("POST", u, nil, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodPost, u, nil, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -778,7 +833,7 @@ func (s *ProjectsService) UnarchiveProject(pid interface{}, options ...RequestOp |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/unarchive", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/unarchive", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("POST", u, nil, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodPost, u, nil, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -803,7 +858,7 @@ func (s *ProjectsService) DeleteProject(pid interface{}, options ...RequestOptio |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("DELETE", u, nil, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -830,7 +885,7 @@ func (s *ProjectsService) ShareProjectWithGroup(pid interface{}, opt *ShareWithG |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/share", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/share", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("POST", u, opt, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodPost, u, opt, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -848,7 +903,7 @@ func (s *ProjectsService) DeleteSharedProjectFromGroup(pid interface{}, groupID |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/share/%d", pathEscape(project), groupID) |
|
|
|
u := fmt.Sprintf("projects/%s/share/%d", pathEscape(project), groupID) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("DELETE", u, nil, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -913,7 +968,7 @@ func (s *ProjectsService) ListProjectHooks(pid interface{}, opt *ListProjectHook |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/hooks", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/hooks", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("GET", u, opt, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodGet, u, opt, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -938,7 +993,7 @@ func (s *ProjectsService) GetProjectHook(pid interface{}, hook int, options ...R |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/hooks/%d", pathEscape(project), hook) |
|
|
|
u := fmt.Sprintf("projects/%s/hooks/%d", pathEscape(project), hook) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("GET", u, nil, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodGet, u, nil, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -985,7 +1040,7 @@ func (s *ProjectsService) AddProjectHook(pid interface{}, opt *AddProjectHookOpt |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/hooks", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/hooks", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("POST", u, opt, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodPost, u, opt, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -1032,7 +1087,7 @@ func (s *ProjectsService) EditProjectHook(pid interface{}, hook int, opt *EditPr |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/hooks/%d", pathEscape(project), hook) |
|
|
|
u := fmt.Sprintf("projects/%s/hooks/%d", pathEscape(project), hook) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("PUT", u, opt, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodPut, u, opt, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -1058,7 +1113,7 @@ func (s *ProjectsService) DeleteProjectHook(pid interface{}, hook int, options . |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/hooks/%d", pathEscape(project), hook) |
|
|
|
u := fmt.Sprintf("projects/%s/hooks/%d", pathEscape(project), hook) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("DELETE", u, nil, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -1086,7 +1141,7 @@ type ProjectForkRelation struct { |
|
|
|
func (s *ProjectsService) CreateProjectForkRelation(pid int, fork int, options ...RequestOptionFunc) (*ProjectForkRelation, *Response, error) { |
|
|
|
func (s *ProjectsService) CreateProjectForkRelation(pid int, fork int, options ...RequestOptionFunc) (*ProjectForkRelation, *Response, error) { |
|
|
|
u := fmt.Sprintf("projects/%d/fork/%d", pid, fork) |
|
|
|
u := fmt.Sprintf("projects/%d/fork/%d", pid, fork) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("POST", u, nil, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodPost, u, nil, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -1107,7 +1162,7 @@ func (s *ProjectsService) CreateProjectForkRelation(pid int, fork int, options . |
|
|
|
func (s *ProjectsService) DeleteProjectForkRelation(pid int, options ...RequestOptionFunc) (*Response, error) { |
|
|
|
func (s *ProjectsService) DeleteProjectForkRelation(pid int, options ...RequestOptionFunc) (*Response, error) { |
|
|
|
u := fmt.Sprintf("projects/%d/fork", pid) |
|
|
|
u := fmt.Sprintf("projects/%d/fork", pid) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("DELETE", u, nil, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -1162,7 +1217,7 @@ func (s *ProjectsService) UploadFile(pid interface{}, file string, options ...Re |
|
|
|
req.Body = ioutil.NopCloser(b) |
|
|
|
req.Body = ioutil.NopCloser(b) |
|
|
|
req.ContentLength = int64(b.Len()) |
|
|
|
req.ContentLength = int64(b.Len()) |
|
|
|
req.Header.Set("Content-Type", w.FormDataContentType()) |
|
|
|
req.Header.Set("Content-Type", w.FormDataContentType()) |
|
|
|
req.Method = "POST" |
|
|
|
req.Method = http.MethodPost |
|
|
|
|
|
|
|
|
|
|
|
uf := &ProjectFile{} |
|
|
|
uf := &ProjectFile{} |
|
|
|
resp, err := s.client.Do(req, uf) |
|
|
|
resp, err := s.client.Do(req, uf) |
|
|
@ -1184,7 +1239,7 @@ func (s *ProjectsService) ListProjectForks(pid interface{}, opt *ListProjectsOpt |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/forks", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/forks", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("GET", u, opt, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodGet, u, opt, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -1230,7 +1285,7 @@ func (s *ProjectsService) GetProjectPushRules(pid interface{}, options ...Reques |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/push_rule", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/push_rule", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("GET", u, nil, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodGet, u, nil, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -1274,7 +1329,7 @@ func (s *ProjectsService) AddProjectPushRule(pid interface{}, opt *AddProjectPus |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/push_rule", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/push_rule", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("POST", u, opt, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodPost, u, opt, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -1318,7 +1373,7 @@ func (s *ProjectsService) EditProjectPushRule(pid interface{}, opt *EditProjectP |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/push_rule", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/push_rule", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("PUT", u, opt, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodPut, u, opt, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -1345,7 +1400,7 @@ func (s *ProjectsService) DeleteProjectPushRule(pid interface{}, options ...Requ |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/push_rule", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/push_rule", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("DELETE", u, nil, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -1378,7 +1433,7 @@ func (s *ProjectsService) GetApprovalConfiguration(pid interface{}, options ...R |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/approvals", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/approvals", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("GET", u, nil, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodGet, u, nil, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -1416,7 +1471,7 @@ func (s *ProjectsService) ChangeApprovalConfiguration(pid interface{}, opt *Chan |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/approvals", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/approvals", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("POST", u, opt, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodPost, u, opt, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -1441,7 +1496,7 @@ func (s *ProjectsService) GetProjectApprovalRules(pid interface{}, options ...Re |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/approval_rules", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/approval_rules", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("GET", u, nil, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodGet, u, nil, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -1479,7 +1534,7 @@ func (s *ProjectsService) CreateProjectApprovalRule(pid interface{}, opt *Create |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/approval_rules", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/approval_rules", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("POST", u, opt, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodPost, u, opt, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -1517,7 +1572,7 @@ func (s *ProjectsService) UpdateProjectApprovalRule(pid interface{}, approvalRul |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/approval_rules/%d", pathEscape(project), approvalRule) |
|
|
|
u := fmt.Sprintf("projects/%s/approval_rules/%d", pathEscape(project), approvalRule) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("PUT", u, opt, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodPut, u, opt, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -1542,7 +1597,7 @@ func (s *ProjectsService) DeleteProjectApprovalRule(pid interface{}, approvalRul |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/approval_rules/%d", pathEscape(project), approvalRule) |
|
|
|
u := fmt.Sprintf("projects/%s/approval_rules/%d", pathEscape(project), approvalRule) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("DELETE", u, nil, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -1571,7 +1626,7 @@ func (s *ProjectsService) ChangeAllowedApprovers(pid interface{}, opt *ChangeAll |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/approvers", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/approvers", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("PUT", u, opt, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodPut, u, opt, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -1596,7 +1651,7 @@ func (s *ProjectsService) StartMirroringProject(pid interface{}, options ...Requ |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/mirror/pull", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/mirror/pull", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("POST", u, nil, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodPost, u, nil, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -1626,7 +1681,7 @@ func (s *ProjectsService) TransferProject(pid interface{}, opt *TransferProjectO |
|
|
|
} |
|
|
|
} |
|
|
|
u := fmt.Sprintf("projects/%s/transfer", pathEscape(project)) |
|
|
|
u := fmt.Sprintf("projects/%s/transfer", pathEscape(project)) |
|
|
|
|
|
|
|
|
|
|
|
req, err := s.client.NewRequest("PUT", u, opt, options) |
|
|
|
req, err := s.client.NewRequest(http.MethodPut, u, opt, options) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
|