Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Add State to ListProjectAccessTokensOptions #1983

Open
elchenberg opened this issue Aug 8, 2024 · 1 comment
Open

Add State to ListProjectAccessTokensOptions #1983

elchenberg opened this issue Aug 8, 2024 · 1 comment

Comments

@elchenberg
Copy link

GitLab 17.2 added the state attribute to the ListProjectAccessTokens API: https://docs.gitlab.com/ee/api/project_access_tokens.html#list-project-access-tokens

I am not very experienced with Go but since it seems to be a small change I might give it a try and open a pull request if it is okay with you:

diff --git a/project_access_tokens.go b/project_access_tokens.go
index 2d6057e..4191a2d 100644
--- a/project_access_tokens.go
+++ b/project_access_tokens.go
@@ -56,7 +56,11 @@ func (v ProjectAccessToken) String() string {
 //
 // GitLab API docs:
 // https://docs.gitlab.com/ee/api/project_access_tokens.html#list-project-access-tokens
-type ListProjectAccessTokensOptions ListOptions
+type ListProjectAccessTokensOptions struct {
+       ListOptions
+       // Limit results to tokens with specified state. Valid values are active and inactive. By default both states are returned.
+       State *string `url:"state,omitempty" json:"state,omitempty"`
+}
 
 // ListProjectAccessTokens gets a list of all project access tokens in a
 // project.
@svanharmelen
Copy link
Member

Go right ahead and give it a shot. I'm sure it will be fine 👍🏻

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants