Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants