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
2 changes: 1 addition & 1 deletion .last-synced-sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
92db0495807c86fbbc4d45bd266a6c1f5bcbb59c
ff939ff075453287993e1e6182f1d6f23c67ab80
61 changes: 46 additions & 15 deletions .oagen-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 2,
"language": "php",
"generatedAt": "2026-04-28T15:07:27.545Z",
"generatedAt": "2026-05-03T22:57:49.369Z",
"files": [
"lib/Resource/ActionAuthenticationDenied.php",
"lib/Resource/ActionAuthenticationDeniedData.php",
Expand All @@ -17,8 +17,6 @@
"lib/Resource/ApiKeyRevokedData.php",
"lib/Resource/ApiKeyRevokedDataOwner.php",
"lib/Resource/ApiKeyValidationResponse.php",
"lib/Resource/ApiKeyWithValue.php",
"lib/Resource/ApiKeyWithValueOwner.php",
"lib/Resource/ApplicationCredentialsListItem.php",
"lib/Resource/AssignRole.php",
"lib/Resource/AuditLogActionJson.php",
Expand Down Expand Up @@ -162,6 +160,7 @@
"lib/Resource/CreateRedirectUri.php",
"lib/Resource/CreateRole.php",
"lib/Resource/CreateUser.php",
"lib/Resource/CreateUserApiKey.php",
"lib/Resource/CreateUserInviteOptions.php",
"lib/Resource/CreateUserInviteOptionsLocale.php",
"lib/Resource/CreateUserOrganizationMembership.php",
Expand Down Expand Up @@ -298,6 +297,10 @@
"lib/Resource/MagicAuthCreatedData.php",
"lib/Resource/NewConnectApplicationSecret.php",
"lib/Resource/Organization.php",
"lib/Resource/OrganizationApiKey.php",
"lib/Resource/OrganizationApiKeyOwner.php",
"lib/Resource/OrganizationApiKeyWithValue.php",
"lib/Resource/OrganizationApiKeyWithValueOwner.php",
"lib/Resource/OrganizationCreated.php",
"lib/Resource/OrganizationCreatedData.php",
"lib/Resource/OrganizationCreatedDataDomain.php",
Expand Down Expand Up @@ -418,6 +421,10 @@
"lib/Resource/UpdateUserOrganizationMembership.php",
"lib/Resource/UpdateWebhookEndpoint.php",
"lib/Resource/User.php",
"lib/Resource/UserApiKey.php",
"lib/Resource/UserApiKeyOwner.php",
"lib/Resource/UserApiKeyWithValue.php",
"lib/Resource/UserApiKeyWithValueOwner.php",
"lib/Resource/UserAuthenticationFactorEnrollResponse.php",
"lib/Resource/UserConsentOption.php",
"lib/Resource/UserConsentOptionChoice.php",
Expand All @@ -439,9 +446,11 @@
"lib/Resource/UserSessionsStatus.php",
"lib/Resource/UserUpdated.php",
"lib/Resource/ValidateApiKey.php",
"lib/Resource/VaultByokKeyDeleted.php",
"lib/Resource/VaultByokKeyDeletedData.php",
"lib/Resource/VaultByokKeyDeletedDataKeyProvider.php",
"lib/Resource/VaultByokKeyVerificationCompleted.php",
"lib/Resource/VaultByokKeyVerificationCompletedData.php",
"lib/Resource/VaultByokKeyVerificationCompletedDataKeyProvider.php",
"lib/Resource/VaultDataCreated.php",
"lib/Resource/VaultDataCreatedData.php",
"lib/Resource/VaultDataDeleted.php",
Expand Down Expand Up @@ -518,8 +527,6 @@
"tests/Fixtures/api_key_revoked_data.json",
"tests/Fixtures/api_key_revoked_data_owner.json",
"tests/Fixtures/api_key_validation_response.json",
"tests/Fixtures/api_key_with_value.json",
"tests/Fixtures/api_key_with_value_owner.json",
"tests/Fixtures/application_credentials_list_item.json",
"tests/Fixtures/assign_role.json",
"tests/Fixtures/audit_log_action_json.json",
Expand Down Expand Up @@ -646,6 +653,7 @@
"tests/Fixtures/create_redirect_uri.json",
"tests/Fixtures/create_role.json",
"tests/Fixtures/create_user.json",
"tests/Fixtures/create_user_api_key.json",
"tests/Fixtures/create_user_invite_options.json",
"tests/Fixtures/create_user_organization_membership.json",
"tests/Fixtures/create_webhook_endpoint.json",
Expand Down Expand Up @@ -760,7 +768,6 @@
"tests/Fixtures/jwks_response.json",
"tests/Fixtures/jwks_response_keys.json",
"tests/Fixtures/jwt_template_response.json",
"tests/Fixtures/list_api_key.json",
"tests/Fixtures/list_audit_log_action_json.json",
"tests/Fixtures/list_audit_log_schema_json.json",
"tests/Fixtures/list_authentication_factor.json",
Expand All @@ -776,8 +783,10 @@
"tests/Fixtures/list_flag.json",
"tests/Fixtures/list_group.json",
"tests/Fixtures/list_organization.json",
"tests/Fixtures/list_organization_api_key.json",
"tests/Fixtures/list_role_assignment.json",
"tests/Fixtures/list_user.json",
"tests/Fixtures/list_user_api_key.json",
"tests/Fixtures/list_user_invite.json",
"tests/Fixtures/list_user_organization_membership.json",
"tests/Fixtures/list_user_organization_membership_base_list_data.json",
Expand All @@ -790,6 +799,10 @@
"tests/Fixtures/mfa_totp_session_authenticate_request.json",
"tests/Fixtures/new_connect_application_secret.json",
"tests/Fixtures/organization.json",
"tests/Fixtures/organization_api_key.json",
"tests/Fixtures/organization_api_key_owner.json",
"tests/Fixtures/organization_api_key_with_value.json",
"tests/Fixtures/organization_api_key_with_value_owner.json",
"tests/Fixtures/organization_created.json",
"tests/Fixtures/organization_created_data.json",
"tests/Fixtures/organization_created_data_domain.json",
Expand Down Expand Up @@ -897,6 +910,10 @@
"tests/Fixtures/update_user_organization_membership.json",
"tests/Fixtures/update_webhook_endpoint.json",
"tests/Fixtures/user.json",
"tests/Fixtures/user_api_key.json",
"tests/Fixtures/user_api_key_owner.json",
"tests/Fixtures/user_api_key_with_value.json",
"tests/Fixtures/user_api_key_with_value_owner.json",
"tests/Fixtures/user_authentication_factor_enroll_response.json",
"tests/Fixtures/user_consent_option.json",
"tests/Fixtures/user_consent_option_choice.json",
Expand All @@ -912,6 +929,8 @@
"tests/Fixtures/user_sessions_list_item.json",
"tests/Fixtures/user_updated.json",
"tests/Fixtures/validate_api_key.json",
"tests/Fixtures/vault_byok_key_deleted.json",
"tests/Fixtures/vault_byok_key_deleted_data.json",
"tests/Fixtures/vault_byok_key_verification_completed.json",
"tests/Fixtures/vault_byok_key_verification_completed_data.json",
"tests/Fixtures/vault_data_created.json",
Expand Down Expand Up @@ -962,14 +981,6 @@
"tests/Service/WidgetsTest.php"
],
"operations": {
"POST /api_keys/validations": {
"sdkMethod": "createValidation",
"service": "apiKeys"
},
"DELETE /api_keys/{id}": {
"sdkMethod": "deleteApiKey",
"service": "apiKeys"
},
"POST /auth/challenges/{id}/verify": {
"sdkMethod": "verifyChallenge",
"service": "multiFactorAuth"
Expand Down Expand Up @@ -1506,6 +1517,10 @@
"sdkMethod": "revokeInvitation",
"service": "userManagement"
},
"GET /user_management/jwt_template": {
"sdkMethod": "listJWTTemplate",
"service": "userManagement"
},
"PUT /user_management/jwt_template": {
"sdkMethod": "updateJWTTemplate",
"service": "userManagement"
Expand Down Expand Up @@ -1606,6 +1621,22 @@
"sdkMethod": "createToken",
"service": "widgets"
},
"POST /api_keys/validations": {
"sdkMethod": "createValidation",
"service": "apiKeys"
},
"DELETE /api_keys/{id}": {
"sdkMethod": "deleteApiKey",
"service": "apiKeys"
},
"GET /user_management/users/{userId}/api_keys": {
"sdkMethod": "listUserApiKeys",
"service": "userManagement"
},
"POST /user_management/users/{userId}/api_keys": {
"sdkMethod": "createUserApiKey",
"service": "userManagement"
},
"GET /audit_logs/actions": {
"sdkMethod": "listActions",
"service": "auditLogs"
Expand Down
1 change: 0 additions & 1 deletion lib/Resource/ApiKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

namespace WorkOS\Resource;

/** The API Key object if the value is valid, or `null` if invalid. */
readonly class ApiKey implements \JsonSerializable
{
use JsonSerializableTrait;
Expand Down
1 change: 0 additions & 1 deletion lib/Resource/ApiKeyCreatedDataOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

namespace WorkOS\Resource;

/** The owner of the API key. */
readonly class ApiKeyCreatedDataOwner implements \JsonSerializable
{
use JsonSerializableTrait;
Expand Down
1 change: 0 additions & 1 deletion lib/Resource/ApiKeyOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

namespace WorkOS\Resource;

/** The entity that owns the API Key. */
readonly class ApiKeyOwner implements \JsonSerializable
{
use JsonSerializableTrait;
Expand Down
1 change: 0 additions & 1 deletion lib/Resource/ApiKeyRevokedDataOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

namespace WorkOS\Resource;

/** The owner of the API key. */
readonly class ApiKeyRevokedDataOwner implements \JsonSerializable
{
use JsonSerializableTrait;
Expand Down
43 changes: 43 additions & 0 deletions lib/Resource/CreateUserApiKey.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

declare(strict_types=1);

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

namespace WorkOS\Resource;

readonly class CreateUserApiKey implements \JsonSerializable
{
use JsonSerializableTrait;

public function __construct(
/** A descriptive name for the API key. */
public string $name,
/** The ID of the organization the user API key is associated with. The user must have an active membership in this organization. */
public string $organizationId,
/**
* The permission slugs to assign to the API key. Each permission must be enabled for user API keys.
* @var array<string>|null
*/
public ?array $permissions = null,
) {
}

public static function fromArray(array $data): self
{
return new self(
name: $data['name'],
organizationId: $data['organization_id'],
permissions: $data['permissions'] ?? null,
);
}

public function toArray(): array
{
return [
'name' => $this->name,
'organization_id' => $this->organizationId,
'permissions' => $this->permissions,
];
}
}
Comment on lines +1 to +43
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.

P2 CreateUserApiKey model is never referenced by the service layer

CreateUserApiKey is generated as a DTO for the create-user-API-key request payload, but UserManagement::createUserApiKey() builds the request body inline with an array_filter([...]) call rather than using this model. The model is dead code from the service's perspective — no SDK method constructs or accepts a CreateUserApiKey instance. If intended only for consumers who want a typed serialization object, it should be consistent with how createOrganizationApiKey is handled (which also has no corresponding model). Worth flagging to the spec/generator team for alignment.

4 changes: 4 additions & 0 deletions lib/Resource/DirectoryUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public function __construct(
public ?string $firstName = null,
/** The last name of the user. */
public ?string $lastName = null,
/** The full name of the user. */
public ?string $name = null,
/**
* A list of email addresses for the user.
* @var array<\WorkOS\Resource\DirectoryUserEmail>|null
Expand Down Expand Up @@ -85,6 +87,7 @@ public static function fromArray(array $data): self
updatedAt: new \DateTimeImmutable($data['updated_at']),
firstName: $data['first_name'] ?? null,
lastName: $data['last_name'] ?? null,
name: $data['name'] ?? null,
emails: isset($data['emails']) ? array_map(fn ($item) => DirectoryUserEmail::fromArray($item), $data['emails']) : null,
jobTitle: $data['job_title'] ?? null,
username: $data['username'] ?? null,
Expand All @@ -109,6 +112,7 @@ public function toArray(): array
'updated_at' => $this->updatedAt->format(\DateTimeInterface::RFC3339_EXTENDED),
'first_name' => $this->firstName,
'last_name' => $this->lastName,
'name' => $this->name,
'emails' => $this->emails !== null ? array_map(fn ($item) => $item->toArray(), $this->emails) : null,
'job_title' => $this->jobTitle,
'username' => $this->username,
Expand Down
6 changes: 5 additions & 1 deletion lib/Resource/DirectoryUserWithGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct(
/** An ISO 8601 timestamp. */
public \DateTimeImmutable $updatedAt,
/**
* The directory groups the user belongs to. Use the List Directory Groups endpoint with a user filter instead.
* The directory groups the user belongs to. Deprecated: starting May 1, 2026, this field returns an empty array by default for newly created teams. Existing teams currently depending on this field should migrate to the new access pattern for better throughput performance — the field is unbounded by user, so users with many group memberships produce large, slow response payloads. Use the List Directory Groups endpoint with a `user` filter to fetch a user's group memberships.
* @var array<\WorkOS\Resource\DirectoryGroup>
* @deprecated
*/
Expand All @@ -50,6 +50,8 @@ public function __construct(
public ?string $firstName = null,
/** The last name of the user. */
public ?string $lastName = null,
/** The full name of the user. */
public ?string $name = null,
/**
* A list of email addresses for the user.
* @var array<\WorkOS\Resource\DirectoryUserWithGroupsEmail>|null
Expand Down Expand Up @@ -92,6 +94,7 @@ public static function fromArray(array $data): self
groups: array_map(fn ($item) => DirectoryGroup::fromArray($item), $data['groups']),
firstName: $data['first_name'] ?? null,
lastName: $data['last_name'] ?? null,
name: $data['name'] ?? null,
emails: isset($data['emails']) ? array_map(fn ($item) => DirectoryUserWithGroupsEmail::fromArray($item), $data['emails']) : null,
jobTitle: $data['job_title'] ?? null,
username: $data['username'] ?? null,
Expand All @@ -117,6 +120,7 @@ public function toArray(): array
'groups' => array_map(fn ($item) => $item->toArray(), $this->groups),
'first_name' => $this->firstName,
'last_name' => $this->lastName,
'name' => $this->name,
'emails' => $this->emails !== null ? array_map(fn ($item) => $item->toArray(), $this->emails) : null,
'job_title' => $this->jobTitle,
'username' => $this->username,
Expand Down
4 changes: 4 additions & 0 deletions lib/Resource/DsyncUserUpdatedData.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public function __construct(
public ?string $firstName = null,
/** The last name of the user. */
public ?string $lastName = null,
/** The full name of the user. */
public ?string $name = null,
/**
* A list of email addresses for the user.
* @var array<\WorkOS\Resource\DsyncUserUpdatedDataEmail>|null
Expand Down Expand Up @@ -88,6 +90,7 @@ public static function fromArray(array $data): self
updatedAt: new \DateTimeImmutable($data['updated_at']),
firstName: $data['first_name'] ?? null,
lastName: $data['last_name'] ?? null,
name: $data['name'] ?? null,
emails: isset($data['emails']) ? array_map(fn ($item) => DsyncUserUpdatedDataEmail::fromArray($item), $data['emails']) : null,
jobTitle: $data['job_title'] ?? null,
username: $data['username'] ?? null,
Expand All @@ -113,6 +116,7 @@ public function toArray(): array
'updated_at' => $this->updatedAt->format(\DateTimeInterface::RFC3339_EXTENDED),
'first_name' => $this->firstName,
'last_name' => $this->lastName,
'name' => $this->name,
'emails' => $this->emails !== null ? array_map(fn ($item) => $item->toArray(), $this->emails) : null,
'job_title' => $this->jobTitle,
'username' => $this->username,
Expand Down
1 change: 1 addition & 0 deletions lib/Resource/EventContextActorSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ enum EventContextActorSource: string
{
case Api = 'api';
case Dashboard = 'dashboard';
case AdminPortal = 'admin_portal';
case System = 'system';
}
Loading
Loading