Skip to content

feat: Add directoryManaged to OrganizationMembership#334

Merged
gjtorikian merged 3 commits intomainfrom
wzahedi/add-directory-managed-to-org-membership
Mar 6, 2026
Merged

feat: Add directoryManaged to OrganizationMembership#334
gjtorikian merged 3 commits intomainfrom
wzahedi/add-directory-managed-to-org-membership

Conversation

@wzahedi
Copy link
Contributor

@wzahedi wzahedi commented Mar 5, 2026

Summary

  • Add directoryManaged to OrganizationMembership resource
  • Update test fixtures

This field indicates whether an organization membership is managed by a directory sync connection.

Test plan

  • Existing tests pass
  • New field is accessible on OrganizationMembership instances

🤖 Generated with Claude Code

@wzahedi wzahedi requested a review from a team as a code owner March 5, 2026 16:13
@wzahedi wzahedi requested a review from marji-workos March 5, 2026 16:13
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 5, 2026

Greptile Summary

This PR adds the directoryManaged boolean field to the OrganizationMembership resource, indicating whether a membership is managed by a directory sync connection. The change is minimal and consistent with how other fields are handled in the SDK.

  • lib/Resource/OrganizationMembership.php: Adds directoryManaged to the PHPDoc @property annotation (typed as bool), RESOURCE_ATTRIBUTES array, and RESPONSE_TO_RESOURCE_KEY map with the correct directory_manageddirectoryManaged snake_case-to-camelCase mapping.
  • tests/WorkOS/UserManagementTest.php: Updates all three test fixtures (organizationMembershipResponseFixture, organizationMembershipListResponseFixture, and organizationMembershipFixture) to include the new field; the existing assertEquals($this->organizationMembershipFixture(), $response->toArray()) assertions now implicitly cover the new field.

Confidence Score: 5/5

  • This PR is safe to merge — it is a purely additive, non-breaking change with appropriate test coverage.
  • The change follows the exact same pattern used for all other fields in OrganizationMembership (PHPDoc + RESOURCE_ATTRIBUTES + RESPONSE_TO_RESOURCE_KEY). All existing tests are updated and the assertEquals checks on toArray() implicitly validate the new field end-to-end.
  • No files require special attention.

Important Files Changed

Filename Overview
lib/Resource/OrganizationMembership.php Adds directoryManaged boolean field to PHPDoc, RESOURCE_ATTRIBUTES, and RESPONSE_TO_RESOURCE_KEY with correct snake_case → camelCase mapping.
tests/WorkOS/UserManagementTest.php Updates three fixtures (response fixture, list response fixture, and expected output fixture) to include the new directory_managed/directoryManaged field; existing assertEquals assertions now implicitly validate the new field.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["API Response\n(snake_case)\ndirectory_managed: bool"] -->|"RESPONSE_TO_RESOURCE_KEY\ndirectory_managed → directoryManaged"| B["BaseWorkOSResource\nconstructFromResponse()"]
    B --> C["OrganizationMembership\n$values['directoryManaged']"]
    C -->|"__get('directoryManaged')"| D["Consumer reads\n$membership->directoryManaged"]
    C -->|"toArray()"| E["Array output\n['directoryManaged' => bool]"]
Loading

Last reviewed commit: 2ec44be

@gjtorikian gjtorikian changed the title Add directoryManaged to OrganizationMembership feat: Add directoryManaged to OrganizationMembership Mar 6, 2026
@gjtorikian gjtorikian requested a review from a team as a code owner March 6, 2026 19:11
@gjtorikian gjtorikian merged commit 1451af1 into main Mar 6, 2026
8 checks passed
@gjtorikian gjtorikian deleted the wzahedi/add-directory-managed-to-org-membership branch March 6, 2026 19:11
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