Support more options for list PATs#1977
Conversation
personal_access_tokens.go
Outdated
| CreatedAfter *time.Time `url:"created_after,omitempty" json:"created_after,omitempty"` | ||
| CreatedBefore *time.Time `url:"created_before,omitempty" json:"created_before,omitempty"` | ||
| LastUsedAfter *time.Time `url:"last_used_after,omitempty" json:"last_used_after,omitempty"` | ||
| LastUsedBefore *time.Time `url:"last_used_before,omitempty" json:"last_used_before,omitempty"` |
There was a problem hiding this comment.
I guess these *time.Time fields should be *ISOTime looking at the docs. Can you check/confirm?
There was a problem hiding this comment.
I check gitlab api document and confirm that you are right,we need to use *ISOTime instead of *time.Time
I have change the type
personal_access_tokens.go
Outdated
| Revoked *bool `url:"revoked,omitempty" json:"revoked,omitempty"` | ||
| Search *string `url:"search,omitempty" json:"search,omitempty"` | ||
| State *string `url:"state,omitempty" json:"state,omitempty"` | ||
| UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"` |
There was a problem hiding this comment.
Think this should be an interface{} as it can be either a string or an in. Not sure if we have that elsewhere and already have something for that more specific than an interface{}...
There was a problem hiding this comment.
We declare user id as type int in all our sdk golang code. Even through gitlab list PATs api support user id as type string in query string paramers as well, I think it's better to just declare user id as type int.
Supporting type string may increase complexity and inconsistency
In my production environment, hope that we can support more options for list PATs.
I have run my branch in production for a week, and it runs well yet