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

Support more options for list PATs #1977

Merged
merged 5 commits into from
Aug 8, 2024
Merged

Support more options for list PATs #1977

merged 5 commits into from
Aug 8, 2024

Conversation

hjweddie
Copy link
Contributor

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

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"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess these *time.Time fields should be *ISOTime looking at the docs. Can you check/confirm?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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{}...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

@svanharmelen svanharmelen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take it, thanks!

@svanharmelen svanharmelen merged commit 19fbf97 into xanzy:main Aug 8, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants