Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
go-gitlab
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
go-gitlab
Commits
0d95cf7f
Commit
0d95cf7f
authored
May 18, 2017
by
Sander van Harmelen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the project creation options
parent
09e3beda
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
53 deletions
+22
-53
projects.go
projects.go
+22
-53
No files found.
projects.go
View file @
0d95cf7f
...
@@ -273,24 +273,25 @@ func (s *ProjectsService) GetProjectEvents(pid interface{}, opt *GetProjectEvent
...
@@ -273,24 +273,25 @@ func (s *ProjectsService) GetProjectEvents(pid interface{}, opt *GetProjectEvent
//
//
// 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
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"`
DefaultBranch
*
string
`url:"default_branch,omitempty" json:"default_branch,omitempty"`
Description
*
string
`url:"description,omitempty" json:"description,omitempty"`
NamespaceID
*
int
`url:"namespace_id,omitempty" json:"namespace_id,omitempty"`
IssuesEnabled
*
bool
`url:"issues_enabled,omitempty" json:"issues_enabled,omitempty"`
Description
*
string
`url:"description,omitempty" json:"description,omitempty"`
MergeRequestsEnabled
*
bool
`url:"merge_requests_enabled,omitempty" json:"merge_requests_enabled,omitempty"`
IssuesEnabled
*
bool
`url:"issues_enabled,omitempty" json:"issues_enabled,omitempty"`
BuildsEnabled
*
bool
`url:"builds_enabled,omitempty" json:"builds_enabled,omitempty"`
MergeRequestsEnabled
*
bool
`url:"merge_requests_enabled,omitempty" json:"merge_requests_enabled,omitempty"`
WikiEnabled
*
bool
`url:"wiki_enabled,omitempty" json:"wiki_enabled,omitempty"`
JobsEnabled
*
bool
`url:"jobs_enabled,omitempty" json:"jobs_enabled,omitempty"`
SnippetsEnabled
*
bool
`url:"snippets_enabled,omitempty" json:"snippets_enabled,omitempty"`
WikiEnabled
*
bool
`url:"wiki_enabled,omitempty" json:"wiki_enabled,omitempty"`
ContainerRegistryEnabled
*
bool
`url:"container_registry_enabled,omitempty" json:"container_registry_enabled,omitempty"`
SnippetsEnabled
*
bool
`url:"snippets_enabled,omitempty" json:"snippets_enabled,omitempty"`
SharedRunnersEnabled
*
bool
`url:"shared_runners_enabled,omitempty" json:"shared_runners_enabled,omitempty"`
ContainerRegistryEnabled
*
bool
`url:"container_registry_enabled,omitempty" json:"container_registry_enabled,omitempty"`
Public
*
bool
`url:"public,omitempty" json:"public,omitempty"`
SharedRunnersEnabled
*
bool
`url:"shared_runners_enabled,omitempty" json:"shared_runners_enabled,omitempty"`
VisibilityLevel
*
VisibilityLevelValue
`url:"visibility,omitempty" json:"visibility,omitempty"`
Visibility
*
VisibilityLevelValue
`url:"visibility,omitempty" json:"visibility,omitempty"`
ImportURL
*
string
`url:"import_url,omitempty" json:"import_url,omitempty"`
ImportURL
*
string
`url:"import_url,omitempty" json:"import_url,omitempty"`
PublicBuilds
*
bool
`url:"public_builds,omitempty" json:"public_builds,omitempty"`
PublicJobs
*
bool
`url:"public_jobs,omitempty" json:"public_jobs,omitempty"`
OnlyAllowMergeIfBuildSucceeds
*
bool
`url:"only_allow_merge_if_build_succeeds,omitempty" json:"only_allow_merge_if_build_succeeds,omitempty"`
OnlyAllowMergeIfPipelineSucceeds
*
bool
`url:"only_allow_merge_if_pipeline_succeeds,omitempty" json:"only_allow_merge_if_pipeline_succeeds,omitempty"`
LFSEnabled
*
bool
`url:"lfs_enabled,omitempty" json:"lfs_enabled,omitempty"`
OnlyAllowMergeIfAllDiscussionsAreResolved
*
bool
`url:"only_allow_merge_if_all_discussions_are_resolved,omitempty" json:"only_allow_merge_if_all_discussions_are_resolved,omitempty"`
RequestAccessEnabled
*
bool
`url:"request_access_enabled,omitempty" json:"request_access_enabled,omitempty"`
LFSEnabled
*
bool
`url:"lfs_enabled,omitempty" json:"lfs_enabled,omitempty"`
RequestAccessEnabled
*
bool
`url:"request_access_enabled,omitempty" json:"request_access_enabled,omitempty"`
}
}
// CreateProject creates a new project owned by the authenticated user.
// CreateProject creates a new project owned by the authenticated user.
...
@@ -343,18 +344,7 @@ func (s *ProjectsService) ShareProjectWithGroup(pid interface{}, opt *ShareWithG
...
@@ -343,18 +344,7 @@ func (s *ProjectsService) ShareProjectWithGroup(pid interface{}, opt *ShareWithG
//
//
// 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
type
CreateProjectForUserOptions
struct
{
type
CreateProjectForUserOptions
CreateProjectOptions
Name
*
string
`url:"name,omitempty" json:"name,omitempty"`
Description
*
string
`url:"description,omitempty" json:"description,omitempty"`
DefaultBranch
*
string
`url:"default_branch,omitempty" json:"default_branch,omitempty"`
IssuesEnabled
*
bool
`url:"issues_enabled,omitempty" json:"issues_enabled,omitempty"`
MergeRequestsEnabled
*
bool
`url:"merge_requests_enabled,omitempty" json:"merge_requests_enabled,omitempty"`
WikiEnabled
*
bool
`url:"wiki_enabled,omitempty" json:"wiki_enabled,omitempty"`
SnippetsEnabled
*
bool
`url:"snippets_enabled,omitempty" json:"snippets_enabled,omitempty"`
Public
*
bool
`url:"public,omitempty" json:"public,omitempty"`
VisibilityLevel
*
VisibilityLevelValue
`url:"visibility,omitempty" json:"visibility,omitempty"`
ImportURL
*
string
`url:"import_url,omitempty" json:"import_url,omitempty"`
}
// CreateProjectForUser creates a new project owned by the specified user.
// CreateProjectForUser creates a new project owned by the specified user.
// Available only for admins.
// Available only for admins.
...
@@ -381,28 +371,7 @@ func (s *ProjectsService) CreateProjectForUser(user int, opt *CreateProjectForUs
...
@@ -381,28 +371,7 @@ func (s *ProjectsService) CreateProjectForUser(user int, opt *CreateProjectForUs
// EditProjectOptions represents the available EditProject() options.
// EditProjectOptions represents the available EditProject() options.
//
//
// 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
CreateProjectOptions
Name
*
string
`url:"name,omitempty" json:"name,omitempty"`
Path
*
string
`url:"path,omitempty" json:"path,omitempty"`
Description
*
string
`url:"description,omitempty" json:"description,omitempty"`
DefaultBranch
*
string
`url:"default_branch,omitempty" json:"default_branch,omitempty"`
IssuesEnabled
*
bool
`url:"issues_enabled,omitempty" json:"issues_enabled,omitempty"`
MergeRequestsEnabled
*
bool
`url:"merge_requests_enabled,omitempty" json:"merge_requests_enabled,omitempty"`
ApprovalsBeforeMerge
*
int
`url:"approvals_before_merge,omitempty" json:"approvals_before_merge,omitempty"`
BuildsEnabled
*
bool
`url:"builds_enabled,omitempty" json:"builds_enabled,omitempty"`
WikiEnabled
*
bool
`url:"wiki_enabled,omitempty" json:"wiki_enabled,omitempty"`
SnippetsEnabled
*
bool
`url:"snippets_enabled,omitempty" json:"snippets_enabled,omitempty"`
ContainerRegistryEnabled
*
bool
`url:"container_registry_enabled,omitempty" json:"container_registry_enabled,omitempty"`
SharedRunnersEnabled
*
bool
`url:"shared_runners_enabled,omitempty" json:"shared_runners_enabled,omitempty"`
Public
*
bool
`url:"public,omitempty" json:"public,omitempty"`
VisibilityLevel
*
VisibilityLevelValue
`url:"visibility,omitempty" json:"visibility,omitempty"`
ImportURL
*
bool
`url:"import_url,omitempty" json:"import_url,omitempty"`
PublicBuilds
*
bool
`url:"public_builds,omitempty" json:"public_builds,omitempty"`
OnlyAllowMergeIfBuildSucceeds
*
bool
`url:"only_allow_merge_if_build_succeeds,omitempty" json:"only_allow_merge_if_build_succeeds,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"`
RequestAccessEnabled
*
bool
`url:"request_access_enabled,omitempty" json:"request_access_enabled,omitempty"`
}
// EditProject updates an existing project.
// EditProject updates an existing project.
//
//
...
@@ -437,7 +406,7 @@ func (s *ProjectsService) ForkProject(pid interface{}, options ...OptionFunc) (*
...
@@ -437,7 +406,7 @@ func (s *ProjectsService) ForkProject(pid interface{}, options ...OptionFunc) (*
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
nil
,
err
return
nil
,
nil
,
err
}
}
u
:=
fmt
.
Sprintf
(
"projects/
fork/%s
"
,
url
.
QueryEscape
(
project
))
u
:=
fmt
.
Sprintf
(
"projects/
%s/fork
"
,
url
.
QueryEscape
(
project
))
req
,
err
:=
s
.
client
.
NewRequest
(
"POST"
,
u
,
nil
,
options
)
req
,
err
:=
s
.
client
.
NewRequest
(
"POST"
,
u
,
nil
,
options
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment