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
aa5db79a
Commit
aa5db79a
authored
May 24, 2016
by
Sander van Harmelen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #51 from x3ro/archive-unarchive
Add archive/unarchive support
parents
a5f785c2
1c570e60
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
+52
-0
projects.go
projects.go
+52
-0
No files found.
projects.go
View file @
aa5db79a
...
@@ -908,3 +908,55 @@ func (s *ProjectsService) DeleteProjectForkRelation(pid int) (*Response, error)
...
@@ -908,3 +908,55 @@ func (s *ProjectsService) DeleteProjectForkRelation(pid int) (*Response, error)
return
resp
,
err
return
resp
,
err
}
}
// Archives the project if the user is either admin or the project owner
// of this project.
//
// GitLab API docs:
// http://docs.gitlab.com/ce/api/projects.html#archive-a-project
func
(
s
*
ProjectsService
)
ArchiveProject
(
pid
interface
{})
(
*
Project
,
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/archive"
,
url
.
QueryEscape
(
project
))
req
,
err
:=
s
.
client
.
NewRequest
(
"POST"
,
u
,
nil
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
p
:=
new
(
Project
)
resp
,
err
:=
s
.
client
.
Do
(
req
,
p
)
if
err
!=
nil
{
return
nil
,
resp
,
err
}
return
p
,
resp
,
err
}
// Unarchives the project if the user is either admin or the project owner
// of this project.
//
// GitLab API docs:
// http://docs.gitlab.com/ce/api/projects.html#unarchive-a-project
func
(
s
*
ProjectsService
)
UnarchiveProject
(
pid
interface
{})
(
*
Project
,
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/unarchive"
,
url
.
QueryEscape
(
project
))
req
,
err
:=
s
.
client
.
NewRequest
(
"POST"
,
u
,
nil
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
p
:=
new
(
Project
)
resp
,
err
:=
s
.
client
.
Do
(
req
,
p
)
if
err
!=
nil
{
return
nil
,
resp
,
err
}
return
p
,
resp
,
err
}
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