Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
* [#489](https://github.com/workos/workos-ruby/pull/489) Update generated SDK code

**⚠️ Breaking**
* **authorization:** Remove search param from listResources operation
* Removed optional `search` parameter from `list_resources` method
* This is a breaking change as the parameter is no longer available for resource filtering

**Features**
* **authorization:** Add filtering parameters to role assignment operations
* Added `resource_id`, `resource_external_id`, `resource_type_slug` optional parameters to `list_role_assignments`
* Added `role_slug` optional parameter to `list_role_assignments_for_resource_by_external_id`
* Added `role_slug` optional parameter to `list_role_assignments_for_resource`
* **organization_membership:** Extract organization membership methods to dedicated service
* Created new `OrganizationMembershipService` with all organization membership operations
* Moved `list_organization_memberships`, `create_organization_membership`, `get_organization_membership`, `update_organization_membership`, `delete_organization_membership`, `deactivate_organization_membership`, `reactivate_organization_membership` from `UserManagement` to `OrganizationMembershipService`
* Moved `list_organization_membership_groups` from `UserManagementOrganizationMembershipGroups` to `OrganizationMembershipService`
* Updated client to expose `organization_membership` method instead of `user_management_organization_membership_groups`
2 changes: 1 addition & 1 deletion .last-synced-sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a10d9ecb766d2dd996aecb19aa9c801d78bb7c26
13aaa9a125fc87d1ed23acd5ef740382510296be
56 changes: 28 additions & 28 deletions .oagen-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 2,
"language": "ruby",
"generatedAt": "2026-05-06T22:30:35.198Z",
"generatedAt": "2026-05-20T20:29:03.170Z",
"files": [
"lib/workos.rb",
"lib/workos/admin_portal.rb",
Expand All @@ -27,17 +27,17 @@
"lib/workos/api_keys/organization_api_key_with_value_owner.rb",
"lib/workos/api_keys/validate_api_key.rb",
"lib/workos/audit_logs.rb",
"lib/workos/audit_logs/audit_log_action_json.rb",
"lib/workos/audit_logs/audit_log_action.rb",
"lib/workos/audit_logs/audit_log_event.rb",
"lib/workos/audit_logs/audit_log_event_actor.rb",
"lib/workos/audit_logs/audit_log_event_context.rb",
"lib/workos/audit_logs/audit_log_event_create_response.rb",
"lib/workos/audit_logs/audit_log_event_ingestion.rb",
"lib/workos/audit_logs/audit_log_event_target.rb",
"lib/workos/audit_logs/audit_log_export.rb",
"lib/workos/audit_logs/audit_log_export_creation.rb",
"lib/workos/audit_logs/audit_log_export_json.rb",
"lib/workos/audit_logs/audit_log_schema.rb",
"lib/workos/audit_logs/audit_log_schema_actor.rb",
"lib/workos/audit_logs/audit_log_schema_dto.rb",
"lib/workos/audit_logs/audit_log_schema_json.rb",
"lib/workos/audit_logs/audit_log_schema_json_actor.rb",
"lib/workos/audit_logs/audit_log_schema_json_target.rb",
Expand Down Expand Up @@ -197,10 +197,15 @@
"lib/workos/organization_domains/organization_domain_verification_failed_data_organization_domain.rb",
"lib/workos/organization_domains/organization_domain_verified.rb",
"lib/workos/organization_domains/organization_domain_verified_data.rb",
"lib/workos/organization_membership/create_user_organization_membership.rb",
"lib/workos/organization_membership/organization_membership.rb",
"lib/workos/organization_membership/update_user_organization_membership.rb",
"lib/workos/organization_membership/user_organization_membership.rb",
"lib/workos/organization_membership_service.rb",
"lib/workos/organizations.rb",
"lib/workos/organizations/audit_log_configuration.rb",
"lib/workos/organizations/audit_log_configuration_log_stream.rb",
"lib/workos/organizations/audit_logs_retention_json.rb",
"lib/workos/organizations/audit_logs_retention.rb",
"lib/workos/organizations/organization.rb",
"lib/workos/organizations/organization_created.rb",
"lib/workos/organizations/organization_created_data.rb",
Expand Down Expand Up @@ -288,7 +293,7 @@
"lib/workos/types/audit_log_configuration_log_stream_state.rb",
"lib/workos/types/audit_log_configuration_log_stream_type.rb",
"lib/workos/types/audit_log_configuration_state.rb",
"lib/workos/types/audit_log_export_json_state.rb",
"lib/workos/types/audit_log_export_state.rb",
"lib/workos/types/authenticate_response_authentication_method.rb",
"lib/workos/types/authentication_factor_enrolled_type.rb",
"lib/workos/types/authentication_factor_type.rb",
Expand Down Expand Up @@ -405,7 +410,7 @@
"lib/workos/types/vault_metadata_read_data_actor_source.rb",
"lib/workos/types/vault_names_listed_data_actor_source.rb",
"lib/workos/types/waitlist_user_state.rb",
"lib/workos/types/webhook_endpoint_json_status.rb",
"lib/workos/types/webhook_endpoint_status.rb",
"lib/workos/types/widget_session_token_scopes.rb",
"lib/workos/user_management.rb",
"lib/workos/user_management/action_authentication_denied.rb",
Expand Down Expand Up @@ -473,7 +478,6 @@
"lib/workos/user_management/create_user.rb",
"lib/workos/user_management/create_user_api_key.rb",
"lib/workos/user_management/create_user_invite_options.rb",
"lib/workos/user_management/create_user_organization_membership.rb",
"lib/workos/user_management/device_authorization_response.rb",
"lib/workos/user_management/device_code_session_authenticate_request.rb",
"lib/workos/user_management/email_change.rb",
Expand All @@ -500,7 +504,6 @@
"lib/workos/user_management/magic_auth_created.rb",
"lib/workos/user_management/magic_auth_created_data.rb",
"lib/workos/user_management/mfa_totp_session_authenticate_request.rb",
"lib/workos/user_management/organization_membership.rb",
"lib/workos/user_management/organization_selection_session_authenticate_request.rb",
"lib/workos/user_management/password_reset.rb",
"lib/workos/user_management/password_reset_created.rb",
Expand All @@ -524,7 +527,6 @@
"lib/workos/user_management/sso_device_authorization_request.rb",
"lib/workos/user_management/update_jwt_template.rb",
"lib/workos/user_management/update_user.rb",
"lib/workos/user_management/update_user_organization_membership.rb",
"lib/workos/user_management/user.rb",
"lib/workos/user_management/user_api_key.rb",
"lib/workos/user_management/user_api_key_created_data_owner.rb",
Expand All @@ -536,13 +538,11 @@
"lib/workos/user_management/user_deleted.rb",
"lib/workos/user_management/user_identities_get_item.rb",
"lib/workos/user_management/user_invite.rb",
"lib/workos/user_management/user_organization_membership.rb",
"lib/workos/user_management/user_sessions_impersonator.rb",
"lib/workos/user_management/user_sessions_list_item.rb",
"lib/workos/user_management/user_updated.rb",
"lib/workos/user_management/verify_email_address.rb",
"lib/workos/user_management/verify_email_response.rb",
"lib/workos/user_management_organization_membership_groups.rb",
"lib/workos/vault/vault_byok_key_deleted.rb",
"lib/workos/vault/vault_byok_key_deleted_data.rb",
"lib/workos/vault/vault_byok_key_verification_completed.rb",
Expand All @@ -568,7 +568,7 @@
"lib/workos/webhooks.rb",
"lib/workos/webhooks/create_webhook_endpoint.rb",
"lib/workos/webhooks/update_webhook_endpoint.rb",
"lib/workos/webhooks/webhook_endpoint_json.rb",
"lib/workos/webhooks/webhook_endpoint.rb",
"lib/workos/widgets.rb",
"lib/workos/widgets/widget_session_token.rb",
"lib/workos/widgets/widget_session_token_response.rb",
Expand All @@ -590,7 +590,7 @@
"rbi/workos/api_keys.rbi",
"rbi/workos/application_credentials_list_item.rbi",
"rbi/workos/assign_role.rbi",
"rbi/workos/audit_log_action_json.rbi",
"rbi/workos/audit_log_action.rbi",
"rbi/workos/audit_log_configuration.rbi",
"rbi/workos/audit_log_configuration_log_stream.rbi",
"rbi/workos/audit_log_event.rbi",
Expand All @@ -599,16 +599,16 @@
"rbi/workos/audit_log_event_create_response.rbi",
"rbi/workos/audit_log_event_ingestion.rbi",
"rbi/workos/audit_log_event_target.rbi",
"rbi/workos/audit_log_export.rbi",
"rbi/workos/audit_log_export_creation.rbi",
"rbi/workos/audit_log_export_json.rbi",
"rbi/workos/audit_log_schema.rbi",
"rbi/workos/audit_log_schema_actor.rbi",
"rbi/workos/audit_log_schema_dto.rbi",
"rbi/workos/audit_log_schema_json.rbi",
"rbi/workos/audit_log_schema_json_actor.rbi",
"rbi/workos/audit_log_schema_json_target.rbi",
"rbi/workos/audit_log_schema_target.rbi",
"rbi/workos/audit_logs.rbi",
"rbi/workos/audit_logs_retention_json.rbi",
"rbi/workos/audit_logs_retention.rbi",
"rbi/workos/authenticate_response.rbi",
"rbi/workos/authenticate_response_impersonator.rbi",
"rbi/workos/authenticate_response_oauth_token.rbi",
Expand Down Expand Up @@ -876,6 +876,7 @@
"rbi/workos/organization_membership_created_data.rbi",
"rbi/workos/organization_membership_deleted.rbi",
"rbi/workos/organization_membership_deleted_data.rbi",
"rbi/workos/organization_membership_service.rbi",
"rbi/workos/organization_membership_updated.rbi",
"rbi/workos/organization_membership_updated_data.rbi",
"rbi/workos/organization_role_created.rbi",
Expand Down Expand Up @@ -974,7 +975,6 @@
"rbi/workos/user_invite.rbi",
"rbi/workos/user_management.rbi",
"rbi/workos/user_management_login_request.rbi",
"rbi/workos/user_management_organization_membership_groups.rbi",
"rbi/workos/user_object.rbi",
"rbi/workos/user_organization_membership.rbi",
"rbi/workos/user_organization_membership_base_list_data.rbi",
Expand Down Expand Up @@ -1012,7 +1012,7 @@
"rbi/workos/waitlist_user_approved.rbi",
"rbi/workos/waitlist_user_created.rbi",
"rbi/workos/waitlist_user_denied.rbi",
"rbi/workos/webhook_endpoint_json.rbi",
"rbi/workos/webhook_endpoint.rbi",
"rbi/workos/webhooks.rbi",
"rbi/workos/widget_session_token.rbi",
"rbi/workos/widget_session_token_response.rbi",
Expand All @@ -1029,12 +1029,12 @@
"test/workos/test_model_round_trip.rb",
"test/workos/test_multi_factor_auth.rb",
"test/workos/test_organization_domains.rb",
"test/workos/test_organization_membership_service.rb",
"test/workos/test_organizations.rb",
"test/workos/test_pipes.rb",
"test/workos/test_radar.rb",
"test/workos/test_sso.rb",
"test/workos/test_user_management.rb",
"test/workos/test_user_management_organization_membership_groups.rb",
"test/workos/test_webhooks.rb",
"test/workos/test_widgets.rb"
],
Expand Down Expand Up @@ -1641,35 +1641,35 @@
},
"GET /user_management/organization_memberships": {
"sdkMethod": "list_organization_memberships",
"service": "user_management"
"service": "organization_membership"
},
"POST /user_management/organization_memberships": {
"sdkMethod": "create_organization_membership",
"service": "user_management"
"service": "organization_membership"
},
"GET /user_management/organization_memberships/{id}": {
"sdkMethod": "get_organization_membership",
"service": "user_management"
"service": "organization_membership"
},
"PUT /user_management/organization_memberships/{id}": {
"sdkMethod": "update_organization_membership",
"service": "user_management"
"service": "organization_membership"
},
"DELETE /user_management/organization_memberships/{id}": {
"sdkMethod": "delete_organization_membership",
"service": "user_management"
"service": "organization_membership"
},
"PUT /user_management/organization_memberships/{id}/deactivate": {
"sdkMethod": "deactivate_organization_membership",
"service": "user_management"
"service": "organization_membership"
},
"PUT /user_management/organization_memberships/{id}/reactivate": {
"sdkMethod": "reactivate_organization_membership",
"service": "user_management"
"service": "organization_membership"
},
"GET /user_management/organization_memberships/{omId}/groups": {
"sdkMethod": "list_organization_membership_groups",
"service": "user_management_organization_membership_groups"
"service": "organization_membership"
},
"POST /user_management/redirect_uris": {
"sdkMethod": "create_redirect_uri",
Expand Down
1 change: 1 addition & 0 deletions lib/workos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module WorkOS
loader.collapse("#{__dir__}/workos/groups")
loader.collapse("#{__dir__}/workos/multi_factor_auth")
loader.collapse("#{__dir__}/workos/organization_domains")
loader.collapse("#{__dir__}/workos/organization_membership")
loader.collapse("#{__dir__}/workos/organizations")
loader.collapse("#{__dir__}/workos/pipes")
loader.collapse("#{__dir__}/workos/radar")
Expand Down
20 changes: 10 additions & 10 deletions lib/workos/audit_logs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def initialize(client)
# Get Retention
# @param id [String] Unique identifier of the Organization.
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
# @return [WorkOS::AuditLogsRetentionJson]
# @return [WorkOS::AuditLogsRetention]
def get_organization_audit_logs_retention(
id:,
request_options: {}
Expand All @@ -24,7 +24,7 @@ def get_organization_audit_logs_retention(
auth: true,
request_options: request_options
)
result = WorkOS::AuditLogsRetentionJson.new(response.body)
result = WorkOS::AuditLogsRetention.new(response.body)
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
result
end
Expand All @@ -33,7 +33,7 @@ def get_organization_audit_logs_retention(
# @param id [String] Unique identifier of the Organization.
# @param retention_period_in_days [Integer] The number of days Audit Log events will be retained. Valid values are `30` and `365`.
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
# @return [WorkOS::AuditLogsRetentionJson]
# @return [WorkOS::AuditLogsRetention]
def update_organization_audit_logs_retention(
id:,
retention_period_in_days:,
Expand All @@ -49,7 +49,7 @@ def update_organization_audit_logs_retention(
body: body,
request_options: request_options
)
result = WorkOS::AuditLogsRetentionJson.new(response.body)
result = WorkOS::AuditLogsRetention.new(response.body)
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
result
end
Expand All @@ -60,7 +60,7 @@ def update_organization_audit_logs_retention(
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time.
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
# @return [WorkOS::Types::ListStruct<WorkOS::AuditLogActionJson>]
# @return [WorkOS::Types::ListStruct<WorkOS::AuditLogAction>]
def list_actions(
before: nil,
after: nil,
Expand Down Expand Up @@ -92,7 +92,7 @@ def list_actions(
}
WorkOS::Types::ListStruct.from_response(
response,
model: WorkOS::AuditLogActionJson,
model: WorkOS::AuditLogAction,
filters: {before: before, limit: limit, order: order},
fetch_next: fetch_next
)
Expand Down Expand Up @@ -212,7 +212,7 @@ def create_event(
# @param actor_ids [Array<String>, nil] List of actor IDs to filter against.
# @param targets [Array<String>, nil] List of target types to filter against.
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
# @return [WorkOS::AuditLogExportJson]
# @return [WorkOS::AuditLogExport]
def create_export(
organization_id:,
range_start:,
Expand Down Expand Up @@ -241,15 +241,15 @@ def create_export(
body: body,
request_options: request_options
)
result = WorkOS::AuditLogExportJson.new(response.body)
result = WorkOS::AuditLogExport.new(response.body)
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
result
end

# Get Export
# @param audit_log_export_id [String] The unique ID of the Audit Log Export.
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
# @return [WorkOS::AuditLogExportJson]
# @return [WorkOS::AuditLogExport]
def get_export(
audit_log_export_id:,
request_options: {}
Expand All @@ -260,7 +260,7 @@ def get_export(
auth: true,
request_options: request_options
)
result = WorkOS::AuditLogExportJson.new(response.body)
result = WorkOS::AuditLogExport.new(response.body)
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
result
end
Expand Down
11 changes: 3 additions & 8 deletions lib/workos/audit_logs/audit_log_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@

# This file is auto-generated by oagen. Do not edit.

require "json"

module WorkOS
class AuditLogAction
include HashProvider

class AuditLogAction < WorkOS::Types::BaseModel
HASH_ATTRS = {
object: :object,
name: :name,
Expand All @@ -24,11 +20,10 @@ class AuditLogAction
:updated_at

def initialize(json)
hash = json.is_a?(Hash) ? json : JSON.parse(json, symbolize_names: true)
hash = hash.transform_keys(&:to_sym) if hash.keys.first.is_a?(String)
hash = self.class.normalize(json)
@object = hash[:object]
@name = hash[:name]
@schema = hash[:schema] ? WorkOS::AuditLogSchema.new(hash[:schema]) : nil
@schema = hash[:schema] ? WorkOS::AuditLogSchemaJson.new(hash[:schema]) : nil
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Wrong schema class after rename

The old code referenced WorkOS::AuditLogSchema, which was renamed to WorkOS::AuditLogSchemaDto in this PR. The updated code should use WorkOS::AuditLogSchemaDto, but instead it now references WorkOS::AuditLogSchemaJson — a separate, pre-existing class with a different field set (object, version, actor, targets, metadata, created_at) vs. what AuditLogSchemaDto exposes (actor, targets, metadata). Any caller reading AuditLogAction#schema will receive the wrong object type, and typed code relying on the .rbi annotation will break at runtime.

Suggested change
@schema = hash[:schema] ? WorkOS::AuditLogSchemaJson.new(hash[:schema]) : nil
@schema = hash[:schema] ? WorkOS::AuditLogSchemaDto.new(hash[:schema]) : nil

@created_at = hash[:created_at]
@updated_at = hash[:updated_at]
end
Expand Down
Loading