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
ed88abbf
Unverified
Commit
ed88abbf
authored
Feb 01, 2019
by
Sander van Harmelen
Committed by
GitHub
Feb 01, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #557 from csquire/groups-custom-attributes
Add custom attributes to groups, users and projects apis
parents
cd1e3f03
a944b54e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
51 deletions
+57
-51
groups.go
groups.go
+10
-8
projects.go
projects.go
+5
-3
users.go
users.go
+42
-40
No files found.
groups.go
View file @
ed88abbf
...
@@ -47,6 +47,7 @@ type Group struct {
...
@@ -47,6 +47,7 @@ type Group struct {
ParentID
int
`json:"parent_id"`
ParentID
int
`json:"parent_id"`
Projects
[]
*
Project
`json:"projects"`
Projects
[]
*
Project
`json:"projects"`
Statistics
*
StorageStatistics
`json:"statistics"`
Statistics
*
StorageStatistics
`json:"statistics"`
CustomAttributes
[]
*
CustomAttribute
`json:"custom_attributes"`
}
}
// ListGroupsOptions represents the available ListGroups() options.
// ListGroupsOptions represents the available ListGroups() options.
...
@@ -54,14 +55,15 @@ type Group struct {
...
@@ -54,14 +55,15 @@ type Group struct {
// GitLab API docs: https://docs.gitlab.com/ce/api/groups.html#list-project-groups
// GitLab API docs: https://docs.gitlab.com/ce/api/groups.html#list-project-groups
type
ListGroupsOptions
struct
{
type
ListGroupsOptions
struct
{
ListOptions
ListOptions
AllAvailable
*
bool
`url:"all_available,omitempty" json:"all_available,omitempty"`
AllAvailable
*
bool
`url:"all_available,omitempty" json:"all_available,omitempty"`
MinAccessLevel
*
AccessLevelValue
`url:"min_access_level,omitempty" json:"min_access_level,omitempty"`
MinAccessLevel
*
AccessLevelValue
`url:"min_access_level,omitempty" json:"min_access_level,omitempty"`
OrderBy
*
string
`url:"order_by,omitempty" json:"order_by,omitempty"`
OrderBy
*
string
`url:"order_by,omitempty" json:"order_by,omitempty"`
Owned
*
bool
`url:"owned,omitempty" json:"owned,omitempty"`
Owned
*
bool
`url:"owned,omitempty" json:"owned,omitempty"`
Search
*
string
`url:"search,omitempty" json:"search,omitempty"`
Search
*
string
`url:"search,omitempty" json:"search,omitempty"`
SkipGroups
[]
int
`url:"skip_groups,omitempty" json:"skip_groups,omitempty"`
SkipGroups
[]
int
`url:"skip_groups,omitempty" json:"skip_groups,omitempty"`
Sort
*
string
`url:"sort,omitempty" json:"sort,omitempty"`
Sort
*
string
`url:"sort,omitempty" json:"sort,omitempty"`
Statistics
*
bool
`url:"statistics,omitempty" json:"statistics,omitempty"`
Statistics
*
bool
`url:"statistics,omitempty" json:"statistics,omitempty"`
WithCustomAttributes
*
bool
`url:"with_custom_attributes,omitempty" json:"with_custom_attributes,omitempty"`
}
}
// ListGroups gets a list of groups (as user: my groups, as admin: all groups).
// ListGroups gets a list of groups (as user: my groups, as admin: all groups).
...
...
projects.go
View file @
ed88abbf
...
@@ -86,9 +86,10 @@ type Project struct {
...
@@ -86,9 +86,10 @@ type Project struct {
GroupName
string
`json:"group_name"`
GroupName
string
`json:"group_name"`
GroupAccessLevel
int
`json:"group_access_level"`
GroupAccessLevel
int
`json:"group_access_level"`
}
`json:"shared_with_groups"`
}
`json:"shared_with_groups"`
Statistics
*
ProjectStatistics
`json:"statistics"`
Statistics
*
ProjectStatistics
`json:"statistics"`
Links
*
Links
`json:"_links,omitempty"`
Links
*
Links
`json:"_links,omitempty"`
CIConfigPath
*
string
`json:"ci_config_path"`
CIConfigPath
*
string
`json:"ci_config_path"`
CustomAttributes
[]
*
CustomAttribute
`json:"custom_attributes"`
}
}
// Repository represents a repository.
// Repository represents a repository.
...
@@ -195,6 +196,7 @@ type ListProjectsOptions struct {
...
@@ -195,6 +196,7 @@ type ListProjectsOptions struct {
WithIssuesEnabled
*
bool
`url:"with_issues_enabled,omitempty" json:"with_issues_enabled,omitempty"`
WithIssuesEnabled
*
bool
`url:"with_issues_enabled,omitempty" json:"with_issues_enabled,omitempty"`
WithMergeRequestsEnabled
*
bool
`url:"with_merge_requests_enabled,omitempty" json:"with_merge_requests_enabled,omitempty"`
WithMergeRequestsEnabled
*
bool
`url:"with_merge_requests_enabled,omitempty" json:"with_merge_requests_enabled,omitempty"`
MinAccessLevel
*
AccessLevelValue
`url:"min_access_level,omitempty" json:"min_access_level,omitempty"`
MinAccessLevel
*
AccessLevelValue
`url:"min_access_level,omitempty" json:"min_access_level,omitempty"`
WithCustomAttributes
*
bool
`url:"with_custom_attributes,omitempty" json:"with_custom_attributes,omitempty"`
}
}
// ListProjects gets a list of projects accessible by the authenticated user.
// ListProjects gets a list of projects accessible by the authenticated user.
...
...
users.go
View file @
ed88abbf
...
@@ -34,38 +34,39 @@ type UsersService struct {
...
@@ -34,38 +34,39 @@ type UsersService struct {
//
//
// GitLab API docs: https://docs.gitlab.com/ee/api/users.html
// GitLab API docs: https://docs.gitlab.com/ee/api/users.html
type
User
struct
{
type
User
struct
{
ID
int
`json:"id"`
ID
int
`json:"id"`
Username
string
`json:"username"`
Username
string
`json:"username"`
Email
string
`json:"email"`
Email
string
`json:"email"`
Name
string
`json:"name"`
Name
string
`json:"name"`
State
string
`json:"state"`
State
string
`json:"state"`
CreatedAt
*
time
.
Time
`json:"created_at"`
CreatedAt
*
time
.
Time
`json:"created_at"`
Bio
string
`json:"bio"`
Bio
string
`json:"bio"`
Location
string
`json:"location"`
Location
string
`json:"location"`
PublicEmail
string
`json:"public_email"`
PublicEmail
string
`json:"public_email"`
Skype
string
`json:"skype"`
Skype
string
`json:"skype"`
Linkedin
string
`json:"linkedin"`
Linkedin
string
`json:"linkedin"`
Twitter
string
`json:"twitter"`
Twitter
string
`json:"twitter"`
WebsiteURL
string
`json:"website_url"`
WebsiteURL
string
`json:"website_url"`
Organization
string
`json:"organization"`
Organization
string
`json:"organization"`
ExternUID
string
`json:"extern_uid"`
ExternUID
string
`json:"extern_uid"`
Provider
string
`json:"provider"`
Provider
string
`json:"provider"`
ThemeID
int
`json:"theme_id"`
ThemeID
int
`json:"theme_id"`
LastActivityOn
*
ISOTime
`json:"last_activity_on"`
LastActivityOn
*
ISOTime
`json:"last_activity_on"`
ColorSchemeID
int
`json:"color_scheme_id"`
ColorSchemeID
int
`json:"color_scheme_id"`
IsAdmin
bool
`json:"is_admin"`
IsAdmin
bool
`json:"is_admin"`
AvatarURL
string
`json:"avatar_url"`
AvatarURL
string
`json:"avatar_url"`
CanCreateGroup
bool
`json:"can_create_group"`
CanCreateGroup
bool
`json:"can_create_group"`
CanCreateProject
bool
`json:"can_create_project"`
CanCreateProject
bool
`json:"can_create_project"`
ProjectsLimit
int
`json:"projects_limit"`
ProjectsLimit
int
`json:"projects_limit"`
CurrentSignInAt
*
time
.
Time
`json:"current_sign_in_at"`
CurrentSignInAt
*
time
.
Time
`json:"current_sign_in_at"`
LastSignInAt
*
time
.
Time
`json:"last_sign_in_at"`
LastSignInAt
*
time
.
Time
`json:"last_sign_in_at"`
ConfirmedAt
*
time
.
Time
`json:"confirmed_at"`
ConfirmedAt
*
time
.
Time
`json:"confirmed_at"`
TwoFactorEnabled
bool
`json:"two_factor_enabled"`
TwoFactorEnabled
bool
`json:"two_factor_enabled"`
Identities
[]
*
UserIdentity
`json:"identities"`
Identities
[]
*
UserIdentity
`json:"identities"`
External
bool
`json:"external"`
External
bool
`json:"external"`
PrivateProfile
bool
`json:"private_profile"`
PrivateProfile
bool
`json:"private_profile"`
SharedRunnersMinutesLimit
int
`json:"shared_runners_minutes_limit"`
SharedRunnersMinutesLimit
int
`json:"shared_runners_minutes_limit"`
CustomAttributes
[]
*
CustomAttribute
`json:"custom_attributes"`
}
}
// UserIdentity represents a user identity.
// UserIdentity represents a user identity.
...
@@ -83,14 +84,15 @@ type ListUsersOptions struct {
...
@@ -83,14 +84,15 @@ type ListUsersOptions struct {
Blocked
*
bool
`url:"blocked,omitempty" json:"blocked,omitempty"`
Blocked
*
bool
`url:"blocked,omitempty" json:"blocked,omitempty"`
// The options below are only available for admins.
// The options below are only available for admins.
Search
*
string
`url:"search,omitempty" json:"search,omitempty"`
Search
*
string
`url:"search,omitempty" json:"search,omitempty"`
Username
*
string
`url:"username,omitempty" json:"username,omitempty"`
Username
*
string
`url:"username,omitempty" json:"username,omitempty"`
ExternalUID
*
string
`url:"extern_uid,omitempty" json:"extern_uid,omitempty"`
ExternalUID
*
string
`url:"extern_uid,omitempty" json:"extern_uid,omitempty"`
Provider
*
string
`url:"provider,omitempty" json:"provider,omitempty"`
Provider
*
string
`url:"provider,omitempty" json:"provider,omitempty"`
CreatedBefore
*
time
.
Time
`url:"created_before,omitempty" json:"created_before,omitempty"`
CreatedBefore
*
time
.
Time
`url:"created_before,omitempty" json:"created_before,omitempty"`
CreatedAfter
*
time
.
Time
`url:"created_after,omitempty" json:"created_after,omitempty"`
CreatedAfter
*
time
.
Time
`url:"created_after,omitempty" json:"created_after,omitempty"`
OrderBy
*
string
`url:"order_by,omitempty" json:"order_by,omitempty"`
OrderBy
*
string
`url:"order_by,omitempty" json:"order_by,omitempty"`
Sort
*
string
`url:"sort,omitempty" json:"sort,omitempty"`
Sort
*
string
`url:"sort,omitempty" json:"sort,omitempty"`
WithCustomAttributes
*
bool
`url:"with_custom_attributes,omitempty" json:"with_custom_attributes,omitempty"`
}
}
// ListUsers gets a list of users.
// ListUsers gets a list of users.
...
...
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