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 GET /organization/:orgId/roles support #338

Merged
merged 2 commits into from
Dec 31, 2024

Conversation

mattgd
Copy link
Contributor

@mattgd mattgd commented Dec 23, 2024

Description

Add GET /organization/:orgId/roles support.

Documentation

Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.

[ ] Yes

If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.

@mattgd mattgd self-assigned this Dec 23, 2024
Copy link

linear bot commented Dec 23, 2024

Comment on lines +200 to +206
WorkOS::Types::ListStruct.new(
data: roles,
list_metadata: {
after: nil,
before: nil,
},
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a bit silly. There's no pagination for this API, so perhaps I should just create a new type. Let me know your thoughts.

Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose you could just return the roles array directly if you don't think it'll ever be a paginated API.

But if there's a chance it'll become paginated later, then returning this at least prevents the need to introduce a breaking change later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Having to introduce a breaking change later is my worry. Pagination doesn't really make sense right now from a product perspective, but I worry if this will change as we see more use cases. I'll leave as-is for now.

@mattgd mattgd requested a review from tribble December 24, 2024 14:37
@mattgd mattgd marked this pull request as ready for review December 24, 2024 14:37
@mattgd mattgd requested review from a team, mthadley and tribble and removed request for tribble and a team December 31, 2024 16:02
Comment on lines +200 to +206
WorkOS::Types::ListStruct.new(
data: roles,
list_metadata: {
after: nil,
before: nil,
},
)
Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose you could just return the roles array directly if you don't think it'll ever be a paginated API.

But if there's a chance it'll become paginated later, then returning this at least prevents the need to introduce a breaking change later.

lib/workos/organizations.rb Outdated Show resolved Hide resolved
@mattgd mattgd merged commit 19e477b into main Dec 31, 2024
4 checks passed
@mattgd mattgd deleted the feature/dsync-2327-add-get-roles-api-to-ruby-sdk branch December 31, 2024 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants