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

Add State to ListProjectAccessTokensOptions #1983

@elchenberg

Description

@elchenberg

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions