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
a7573fe3
Commit
a7573fe3
authored
Sep 07, 2017
by
Sander van Harmelen
Committed by
GitHub
Sep 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add `expires_at` option (#206)
Fixes #205
parent
307a77e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
groups.go
groups.go
+15
-12
No files found.
groups.go
View file @
a7573fe3
...
...
@@ -237,7 +237,7 @@ func (s *GroupsService) SearchGroup(query string, options ...OptionFunc) ([]*Gro
// GroupMember represents a GitLab group member.
//
// GitLab API docs: https://docs.gitlab.com/ce/api/
group
s.html
// GitLab API docs: https://docs.gitlab.com/ce/api/
member
s.html
type
GroupMember
struct
{
ID
int
`json:"id"`
Username
string
`json:"username"`
...
...
@@ -252,7 +252,7 @@ type GroupMember struct {
// options.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/
groups.html#list-group-members
// https://docs.gitlab.com/ce/api/
members.html#list-all-members-of-a-group-or-project
type
ListGroupMembersOptions
struct
{
ListOptions
}
...
...
@@ -261,7 +261,7 @@ type ListGroupMembersOptions struct {
// user.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/
groups.html#list-group-members
// https://docs.gitlab.com/ce/api/
members.html#list-all-members-of-a-group-or-project
func
(
s
*
GroupsService
)
ListGroupMembers
(
gid
interface
{},
opt
*
ListGroupMembersOptions
,
options
...
OptionFunc
)
([]
*
GroupMember
,
*
Response
,
error
)
{
group
,
err
:=
parseID
(
gid
)
if
err
!=
nil
{
...
...
@@ -319,16 +319,18 @@ func (s *GroupsService) ListGroupProjects(gid interface{}, opt *ListGroupProject
// AddGroupMemberOptions represents the available AddGroupMember() options.
//
// GitLab API docs: https://docs.gitlab.com/ce/api/groups.html#add-group-member
// GitLab API docs:
// https://docs.gitlab.com/ce/api/members.html#add-a-member-to-a-group-or-project
type
AddGroupMemberOptions
struct
{
UserID
*
int
`url:"user_id,omitempty" json:"user_id,omitempty"`
AccessLevel
*
AccessLevelValue
`url:"access_level,omitempty" json:"access_level,omitempty"`
ExpiresAt
*
string
`url:"expires_at,omitempty" json:"expires_at"`
}
// AddGroupMember adds a user to the list of group members.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/
groups.html#list-group-members
// https://docs.gitlab.com/ce/api/
members.html#add-a-member-to-a-group-or-project
func
(
s
*
GroupsService
)
AddGroupMember
(
gid
interface
{},
opt
*
AddGroupMemberOptions
,
options
...
OptionFunc
)
(
*
GroupMember
,
*
Response
,
error
)
{
group
,
err
:=
parseID
(
gid
)
if
err
!=
nil
{
...
...
@@ -350,20 +352,21 @@ func (s *GroupsService) AddGroupMember(gid interface{}, opt *AddGroupMemberOptio
return
g
,
resp
,
err
}
//
UpdateGroupMemberOptions represents the available Update
GroupMember()
//
EditGroupMemberOptions represents the available Edit
GroupMember()
// options.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/
groups.html#edit-group-team-member
type
Update
GroupMemberOptions
struct
{
// https://docs.gitlab.com/ce/api/
members.html#edit-a-member-of-a-group-or-project
type
Edit
GroupMemberOptions
struct
{
AccessLevel
*
AccessLevelValue
`url:"access_level,omitempty" json:"access_level,omitempty"`
ExpiresAt
*
string
`url:"expires_at,omitempty" json:"expires_at"`
}
//
UpdateGroupMember updates a group team member to a specified access level
.
//
EditGroupMember updates a member of a group
.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/
groups.html#list-group-members
func
(
s
*
GroupsService
)
UpdateGroupMember
(
gid
interface
{},
user
int
,
opt
*
Update
GroupMemberOptions
,
options
...
OptionFunc
)
(
*
GroupMember
,
*
Response
,
error
)
{
// https://docs.gitlab.com/ce/api/
members.html#edit-a-member-of-a-group-or-project
func
(
s
*
GroupsService
)
EditGroupMember
(
gid
interface
{},
user
int
,
opt
*
Edit
GroupMemberOptions
,
options
...
OptionFunc
)
(
*
GroupMember
,
*
Response
,
error
)
{
group
,
err
:=
parseID
(
gid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
...
...
@@ -387,7 +390,7 @@ func (s *GroupsService) UpdateGroupMember(gid interface{}, user int, opt *Update
// RemoveGroupMember removes user from user team.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/
groups.html#remove-user-from-user-team
// https://docs.gitlab.com/ce/api/
members.html#remove-a-member-from-a-group-or-project
func
(
s
*
GroupsService
)
RemoveGroupMember
(
gid
interface
{},
user
int
,
options
...
OptionFunc
)
(
*
Response
,
error
)
{
group
,
err
:=
parseID
(
gid
)
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