From 6b4b77607af23d7e17c8a560dd0cbfa706b57c97 Mon Sep 17 00:00:00 2001 From: "workos-sdk-automation[bot]" <255426317+workos-sdk-automation[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2026 20:30:56 +0000 Subject: [PATCH 1/2] chore(generated): regenerate shared files for OrganizationMembership --- .last-synced-sha | 2 +- .../organization_membership.rb | 3 + .../user_organization_membership.rb | 3 + rbi/workos/organization_membership.rbi | 6 + rbi/workos/user_organization_membership.rbi | 6 + test/workos/test_model_round_trip.rb | 189 +++--------------- 6 files changed, 45 insertions(+), 164 deletions(-) diff --git a/.last-synced-sha b/.last-synced-sha index 409f7391..d5b98283 100644 --- a/.last-synced-sha +++ b/.last-synced-sha @@ -1 +1 @@ -b6a68da8bd60c1478e0a86ca97c75448677e8871 +1a2f47b20f63f2c8f0eb56bbd2adb3b5947d693a diff --git a/lib/workos/organization_membership/organization_membership.rb b/lib/workos/organization_membership/organization_membership.rb index e73f24f3..e024c557 100644 --- a/lib/workos/organization_membership/organization_membership.rb +++ b/lib/workos/organization_membership/organization_membership.rb @@ -16,6 +16,7 @@ class OrganizationMembership < WorkOS::Types::BaseModel created_at: :created_at, updated_at: :updated_at, role: :role, + roles: :roles, user: :user }.freeze @@ -31,6 +32,7 @@ class OrganizationMembership < WorkOS::Types::BaseModel :created_at, :updated_at, :role, + :roles, :user def initialize(json) @@ -46,6 +48,7 @@ def initialize(json) @created_at = hash[:created_at] @updated_at = hash[:updated_at] @role = hash[:role] ? WorkOS::SlimRole.new(hash[:role]) : nil + @roles = (hash[:roles] || []).map { |item| item ? WorkOS::SlimRole.new(item) : nil } @user = hash[:user] ? WorkOS::User.new(hash[:user]) : nil end end diff --git a/lib/workos/organization_membership/user_organization_membership.rb b/lib/workos/organization_membership/user_organization_membership.rb index 22a8b2fb..0e213a5a 100644 --- a/lib/workos/organization_membership/user_organization_membership.rb +++ b/lib/workos/organization_membership/user_organization_membership.rb @@ -16,6 +16,7 @@ class UserOrganizationMembership < WorkOS::Types::BaseModel created_at: :created_at, updated_at: :updated_at, role: :role, + roles: :roles, user: :user }.freeze @@ -31,6 +32,7 @@ class UserOrganizationMembership < WorkOS::Types::BaseModel :created_at, :updated_at, :role, + :roles, :user def initialize(json) @@ -46,6 +48,7 @@ def initialize(json) @created_at = hash[:created_at] @updated_at = hash[:updated_at] @role = hash[:role] ? WorkOS::SlimRole.new(hash[:role]) : nil + @roles = (hash[:roles] || []).map { |item| item ? WorkOS::SlimRole.new(item) : nil } @user = hash[:user] ? WorkOS::User.new(hash[:user]) : nil end end diff --git a/rbi/workos/organization_membership.rbi b/rbi/workos/organization_membership.rbi index 90776d84..91551d20 100644 --- a/rbi/workos/organization_membership.rbi +++ b/rbi/workos/organization_membership.rbi @@ -75,6 +75,12 @@ module WorkOS sig { params(value: WorkOS::SlimRole).returns(WorkOS::SlimRole) } def role=(value); end + sig { returns(T::Array[WorkOS::SlimRole]) } + def roles; end + + sig { params(value: T::Array[WorkOS::SlimRole]).returns(T::Array[WorkOS::SlimRole]) } + def roles=(value); end + sig { returns(WorkOS::User) } def user; end diff --git a/rbi/workos/user_organization_membership.rbi b/rbi/workos/user_organization_membership.rbi index 06990a12..8dd1b0eb 100644 --- a/rbi/workos/user_organization_membership.rbi +++ b/rbi/workos/user_organization_membership.rbi @@ -75,6 +75,12 @@ module WorkOS sig { params(value: WorkOS::SlimRole).returns(WorkOS::SlimRole) } def role=(value); end + sig { returns(T::Array[WorkOS::SlimRole]) } + def roles; end + + sig { params(value: T::Array[WorkOS::SlimRole]).returns(T::Array[WorkOS::SlimRole]) } + def roles=(value); end + sig { returns(WorkOS::User) } def user; end diff --git a/test/workos/test_model_round_trip.rb b/test/workos/test_model_round_trip.rb index a05ca447..e78818c3 100644 --- a/test/workos/test_model_round_trip.rb +++ b/test/workos/test_model_round_trip.rb @@ -1099,39 +1099,6 @@ def test_object_metadata_round_trip fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } end - def test_object_summary_round_trip - fixture = { - "id" => "stub", - "name" => "stub", - "updated_at" => nil - } - model = WorkOS::ObjectSummary.new(fixture.to_json) - json = model.to_h - assert_kind_of Hash, json - assert_equal fixture["id"], json[:id] - assert_equal fixture["name"], json[:name] - fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } - end - - def test_object_version_round_trip - fixture = { - "created_at" => "stub", - "current_version" => true, - "etag" => "stub", - "id" => "stub", - "size" => 1 - } - model = WorkOS::ObjectVersion.new(fixture.to_json) - json = model.to_h - assert_kind_of Hash, json - assert_equal fixture["created_at"], json[:created_at] - assert_equal fixture["current_version"], json[:current_version] - assert_equal fixture["etag"], json[:etag] - assert_equal fixture["id"], json[:id] - assert_equal fixture["size"], json[:size] - fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } - end - def test_object_without_value_round_trip fixture = { "id" => "stub", @@ -1926,24 +1893,6 @@ def test_waitlist_user_round_trip fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } end - def test_event_schema_round_trip - fixture = { - "object" => "event", - "id" => "stub", - "event" => "stub", - "data" => {}, - "created_at" => "stub", - "context" => {} - } - model = WorkOS::EventSchema.new(fixture.to_json) - json = model.to_h - assert_kind_of Hash, json - assert_equal fixture["id"], json[:id] - assert_equal fixture["event"], json[:event] - assert_equal fixture["created_at"], json[:created_at] - fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } - end - def test_action_authentication_denied_round_trip fixture = { "object" => "event", @@ -6181,30 +6130,6 @@ def test_waitlist_user_denied_round_trip fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } end - def test_organization_domain_stand_alone_round_trip - fixture = { - "object" => "organization_domain", - "id" => "stub", - "organization_id" => "stub", - "domain" => "stub", - "state" => "stub", - "verification_prefix" => "stub", - "verification_token" => "stub", - "verification_strategy" => "stub", - "created_at" => "stub", - "updated_at" => "stub" - } - model = WorkOS::OrganizationDomainStandAlone.new(fixture.to_json) - json = model.to_h - assert_kind_of Hash, json - assert_equal fixture["id"], json[:id] - assert_equal fixture["organization_id"], json[:organization_id] - assert_equal fixture["domain"], json[:domain] - assert_equal fixture["created_at"], json[:created_at] - assert_equal fixture["updated_at"], json[:updated_at] - fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } - end - def test_flag_round_trip fixture = { "object" => "feature_flag", @@ -6233,32 +6158,6 @@ def test_flag_round_trip fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } end - def test_organization_api_key_round_trip - fixture = { - "object" => "api_key", - "id" => "stub", - "owner" => {}, - "name" => "stub", - "obfuscated_value" => "stub", - "last_used_at" => nil, - "expires_at" => nil, - "permissions" => [], - "created_at" => "stub", - "updated_at" => "stub" - } - model = WorkOS::OrganizationApiKey.new(fixture.to_json) - json = model.to_h - assert_kind_of Hash, json - assert_equal fixture["id"], json[:id] - assert_equal fixture["name"], json[:name] - assert_equal fixture["obfuscated_value"], json[:obfuscated_value] - assert_nil json[:last_used_at] - assert_nil json[:expires_at] - assert_equal fixture["created_at"], json[:created_at] - assert_equal fixture["updated_at"], json[:updated_at] - fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } - end - def test_organization_api_key_with_value_round_trip fixture = { "object" => "api_key", @@ -6595,6 +6494,7 @@ def test_user_organization_membership_round_trip "created_at" => "stub", "updated_at" => "stub", "role" => {}, + "roles" => [], "user" => {} } model = WorkOS::UserOrganizationMembership.new(fixture.to_json) @@ -6938,6 +6838,30 @@ def test_jwt_template_response_round_trip fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } end + def test_organization_domain_round_trip + fixture = { + "object" => "organization_domain", + "id" => "stub", + "organization_id" => "stub", + "domain" => "stub", + "state" => "stub", + "verification_prefix" => "stub", + "verification_token" => "stub", + "verification_strategy" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::OrganizationDomain.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["domain"], json[:domain] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + def test_jwks_response_keys_round_trip fixture = { "alg" => "RS256", @@ -7099,30 +7023,6 @@ def test_audit_log_configuration_log_stream_round_trip fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } end - def test_organization_domain_round_trip - fixture = { - "object" => "organization_domain", - "id" => "stub", - "organization_id" => "stub", - "domain" => "stub", - "state" => "stub", - "verification_prefix" => "stub", - "verification_token" => "stub", - "verification_strategy" => "stub", - "created_at" => "stub", - "updated_at" => "stub" - } - model = WorkOS::OrganizationDomain.new(fixture.to_json) - json = model.to_h - assert_kind_of Hash, json - assert_equal fixture["id"], json[:id] - assert_equal fixture["organization_id"], json[:organization_id] - assert_equal fixture["domain"], json[:domain] - assert_equal fixture["created_at"], json[:created_at] - assert_equal fixture["updated_at"], json[:updated_at] - fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } - end - def test_organization_api_key_with_value_owner_round_trip fixture = { "type" => "organization", @@ -7135,18 +7035,6 @@ def test_organization_api_key_with_value_owner_round_trip fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } end - def test_organization_api_key_owner_round_trip - fixture = { - "type" => "organization", - "id" => "stub" - } - model = WorkOS::OrganizationApiKeyOwner.new(fixture.to_json) - json = model.to_h - assert_kind_of Hash, json - assert_equal fixture["id"], json[:id] - fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } - end - def test_flag_owner_round_trip fixture = { "email" => "stub", @@ -7162,17 +7050,6 @@ def test_flag_owner_round_trip fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } end - def test_event_list_list_metadata_round_trip - fixture = { - "after" => nil - } - model = WorkOS::EventListListMetadata.new(fixture.to_json) - json = model.to_h - assert_kind_of Hash, json - assert_nil json[:after] - fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } - end - def test_directory_user_email_round_trip fixture = { "primary" => true, @@ -7379,21 +7256,6 @@ def test_audit_log_schema_target_round_trip fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } end - def test_authorized_connect_application_list_data_round_trip - fixture = { - "object" => "authorized_connect_application", - "id" => "stub", - "granted_scopes" => [], - "oauth_resource" => "stub", - "application" => {} - } - model = WorkOS::AuthorizedConnectApplicationListData.new(fixture.to_json) - json = model.to_h - assert_kind_of Hash, json - assert_equal fixture["id"], json[:id] - fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } - end - def test_api_key_owner_round_trip fixture = { "type" => "organization", @@ -7831,6 +7693,7 @@ def test_organization_membership_round_trip "created_at" => "stub", "updated_at" => "stub", "role" => {}, + "roles" => [], "user" => {} } model = WorkOS::OrganizationMembership.new(fixture.to_json) From 36d9ee1f6ab16de4d31116b6dd4d386ef580cd55 Mon Sep 17 00:00:00 2001 From: "workos-sdk-automation[bot]" <255426317+workos-sdk-automation[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2026 20:31:00 +0000 Subject: [PATCH 2/2] chore(generated): add release notes fragment --- ...6-25T20-31-00-053f61e91f935b7602605a97e69c6db058ecabed.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changelog-pending/2026-06-25T20-31-00-053f61e91f935b7602605a97e69c6db058ecabed.md diff --git a/.changelog-pending/2026-06-25T20-31-00-053f61e91f935b7602605a97e69c6db058ecabed.md b/.changelog-pending/2026-06-25T20-31-00-053f61e91f935b7602605a97e69c6db058ecabed.md new file mode 100644 index 00000000..7fe3a294 --- /dev/null +++ b/.changelog-pending/2026-06-25T20-31-00-053f61e91f935b7602605a97e69c6db058ecabed.md @@ -0,0 +1,5 @@ +* [#504](https://github.com/workos/workos-ruby/pull/504) fix(generated): regenerate from spec + + **Fixes** + * **[organization_membership](https://workos.com/docs/reference/authkit/organization-membership)**: + * Added `roles` to organization membership models