Skip to content

Commit d8a3804

Browse files
feat(generated): regenerate from spec (5 changes) (#397)
Co-authored-by: workos-sdk-automation[bot] <255426317+workos-sdk-automation[bot]@users.noreply.github.com> Co-authored-by: Garen J. Torikian <gjtorikian@users.noreply.github.com>
1 parent 79fc78c commit d8a3804

68 files changed

Lines changed: 778 additions & 156 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
- [#397](https://github.com/workos/workos-php/pull/397) feat(generated)!: regenerate from spec (5 changes)
2+
3+
**⚠️ Breaking**
4+
- **[api_keys](https://workos.com/docs/reference/authkit/api-keys)**:
5+
- Made `expires_at` required in API key models
6+
- **[directory_sync](https://workos.com/docs/reference/directory-sync)**:
7+
- Removed model `DsyncDeactivated`
8+
- Removed model `DsyncDeactivatedData`
9+
- Removed model `DsyncDeactivatedDataDomain`
10+
- Removed enum `DsyncDeactivatedDataType`
11+
- Removed enum `DsyncDeactivatedDataState`
12+
- **[radar](https://workos.com/docs/reference/radar)**:
13+
- Removed `domain_sign_up_rate_limit` from `RadarStandaloneResponseControl`
14+
- **[user_management](https://workos.com/docs/reference/authkit/user)**:
15+
- Removed `return_to` from `RevokeSession`
16+
17+
**Features**
18+
- **[api_keys](https://workos.com/docs/reference/authkit/api-keys)**:
19+
- Added model `ExpireApiKey`
20+
- Added model `ApiKeyUpdated`
21+
- Added model `ApiKeyUpdatedData`
22+
- Added model `ApiKeyUpdatedDataOwner`
23+
- Added model `UserApiKeyUpdatedDataOwner`
24+
- Added model `ApiKeyUpdatedDataPreviousAttribute`
25+
- Added endpoint `POST /api_keys/{id}/expire`
26+
- **[audit_logs](https://workos.com/docs/reference/audit-logs)**:
27+
- Added `Snowflake` to `AuditLogConfigurationLogStreamType`
28+
- **[connect](https://workos.com/docs/reference/workos-connect/standalone)**:
29+
- Added `name` to `UserObject`
30+
- **[directory_sync](https://workos.com/docs/reference/directory-sync)**:
31+
- Added model `DsyncTokenCreated`
32+
- Added model `DsyncTokenCreatedData`
33+
- Added model `DsyncTokenRevoked`
34+
- Added model `DsyncTokenRevokedData`
35+
- **[user_management](https://workos.com/docs/reference/authkit/user)**:
36+
- Added `name` to user management models
37+
- **[webhooks](https://workos.com/docs/reference/webhooks)**:
38+
- Added `api_key.updated` to `CreateWebhookEndpointEvents`
39+
- Added `api_key.updated` to `UpdateWebhookEndpointEvents`

.last-synced-sha

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cb6857d51b453e3cbdb5bf3647d3ca229dd8af65
1+
d8c5a7de598792b1cee18d4a9842825110e5c74a

.oagen-manifest.json

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"version": 2,
33
"language": "php",
4-
"generatedAt": "2026-05-28T14:19:36.431Z",
4+
"generatedAt": "2026-06-03T19:19:56.689Z",
55
"files": [
66
"lib/Resource/ActionAuthenticationDenied.php",
77
"lib/Resource/ActionAuthenticationDeniedData.php",
@@ -17,6 +17,10 @@
1717
"lib/Resource/ApiKeyRevoked.php",
1818
"lib/Resource/ApiKeyRevokedData.php",
1919
"lib/Resource/ApiKeyRevokedDataOwner.php",
20+
"lib/Resource/ApiKeyUpdated.php",
21+
"lib/Resource/ApiKeyUpdatedData.php",
22+
"lib/Resource/ApiKeyUpdatedDataOwner.php",
23+
"lib/Resource/ApiKeyUpdatedDataPreviousAttribute.php",
2024
"lib/Resource/ApiKeyValidationResponse.php",
2125
"lib/Resource/ApplicationCredentialsListItem.php",
2226
"lib/Resource/AssignRole.php",
@@ -205,9 +209,6 @@
205209
"lib/Resource/DsyncActivated.php",
206210
"lib/Resource/DsyncActivatedData.php",
207211
"lib/Resource/DsyncActivatedDataDomain.php",
208-
"lib/Resource/DsyncDeactivated.php",
209-
"lib/Resource/DsyncDeactivatedData.php",
210-
"lib/Resource/DsyncDeactivatedDataDomain.php",
211212
"lib/Resource/DsyncDeleted.php",
212213
"lib/Resource/DsyncDeletedData.php",
213214
"lib/Resource/DsyncDeletedDataState.php",
@@ -220,6 +221,10 @@
220221
"lib/Resource/DsyncGroupUserAddedData.php",
221222
"lib/Resource/DsyncGroupUserRemoved.php",
222223
"lib/Resource/DsyncGroupUserRemovedData.php",
224+
"lib/Resource/DsyncTokenCreated.php",
225+
"lib/Resource/DsyncTokenCreatedData.php",
226+
"lib/Resource/DsyncTokenRevoked.php",
227+
"lib/Resource/DsyncTokenRevokedData.php",
223228
"lib/Resource/DsyncUserCreated.php",
224229
"lib/Resource/DsyncUserDeleted.php",
225230
"lib/Resource/DsyncUserUpdated.php",
@@ -240,6 +245,7 @@
240245
"lib/Resource/EventContextGoogleAnalyticsSession.php",
241246
"lib/Resource/EventListListMetadata.php",
242247
"lib/Resource/EventSchema.php",
248+
"lib/Resource/ExpireApiKey.php",
243249
"lib/Resource/ExternalAuthCompleteResponse.php",
244250
"lib/Resource/FeatureFlag.php",
245251
"lib/Resource/FeatureFlagOwner.php",
@@ -447,6 +453,7 @@
447453
"lib/Resource/UserApiKeyCreatedDataOwner.php",
448454
"lib/Resource/UserApiKeyOwner.php",
449455
"lib/Resource/UserApiKeyRevokedDataOwner.php",
456+
"lib/Resource/UserApiKeyUpdatedDataOwner.php",
450457
"lib/Resource/UserApiKeyWithValue.php",
451458
"lib/Resource/UserApiKeyWithValueOwner.php",
452459
"lib/Resource/UserAuthenticationFactorEnrollResponse.php",
@@ -556,6 +563,10 @@
556563
"tests/Fixtures/api_key_revoked.json",
557564
"tests/Fixtures/api_key_revoked_data.json",
558565
"tests/Fixtures/api_key_revoked_data_owner.json",
566+
"tests/Fixtures/api_key_updated.json",
567+
"tests/Fixtures/api_key_updated_data.json",
568+
"tests/Fixtures/api_key_updated_data_owner.json",
569+
"tests/Fixtures/api_key_updated_data_previous_attribute.json",
559570
"tests/Fixtures/api_key_validation_response.json",
560571
"tests/Fixtures/application_credentials_list_item.json",
561572
"tests/Fixtures/assign_role.json",
@@ -718,9 +729,6 @@
718729
"tests/Fixtures/dsync_activated.json",
719730
"tests/Fixtures/dsync_activated_data.json",
720731
"tests/Fixtures/dsync_activated_data_domain.json",
721-
"tests/Fixtures/dsync_deactivated.json",
722-
"tests/Fixtures/dsync_deactivated_data.json",
723-
"tests/Fixtures/dsync_deactivated_data_domain.json",
724732
"tests/Fixtures/dsync_deleted.json",
725733
"tests/Fixtures/dsync_deleted_data.json",
726734
"tests/Fixtures/dsync_group_created.json",
@@ -731,6 +739,10 @@
731739
"tests/Fixtures/dsync_group_user_added_data.json",
732740
"tests/Fixtures/dsync_group_user_removed.json",
733741
"tests/Fixtures/dsync_group_user_removed_data.json",
742+
"tests/Fixtures/dsync_token_created.json",
743+
"tests/Fixtures/dsync_token_created_data.json",
744+
"tests/Fixtures/dsync_token_revoked.json",
745+
"tests/Fixtures/dsync_token_revoked_data.json",
734746
"tests/Fixtures/dsync_user_created.json",
735747
"tests/Fixtures/dsync_user_deleted.json",
736748
"tests/Fixtures/dsync_user_updated.json",
@@ -750,6 +762,7 @@
750762
"tests/Fixtures/event_context_google_analytics_session.json",
751763
"tests/Fixtures/event_list_list_metadata.json",
752764
"tests/Fixtures/event_schema.json",
765+
"tests/Fixtures/expire_api_key.json",
753766
"tests/Fixtures/external_auth_complete_response.json",
754767
"tests/Fixtures/feature_flag.json",
755768
"tests/Fixtures/feature_flag_owner.json",
@@ -964,6 +977,7 @@
964977
"tests/Fixtures/user_api_key_created_data_owner.json",
965978
"tests/Fixtures/user_api_key_owner.json",
966979
"tests/Fixtures/user_api_key_revoked_data_owner.json",
980+
"tests/Fixtures/user_api_key_updated_data_owner.json",
967981
"tests/Fixtures/user_api_key_with_value.json",
968982
"tests/Fixtures/user_api_key_with_value_owner.json",
969983
"tests/Fixtures/user_authentication_factor_enroll_response.json",
@@ -1737,6 +1751,10 @@
17371751
"sdkMethod": "deleteApiKey",
17381752
"service": "apiKeys"
17391753
},
1754+
"POST /api_keys/{id}/expire": {
1755+
"sdkMethod": "createApiKeyExpire",
1756+
"service": "apiKeys"
1757+
},
17401758
"GET /user_management/users/{userId}/api_keys": {
17411759
"sdkMethod": "listUserApiKeys",
17421760
"service": "userManagement"

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44
},
55
"[json]": {
66
"editor.defaultFormatter": "vscode.json-language-features"
7+
},
8+
"[markdown]": {
9+
"editor.defaultFormatter": "esbenp.prettier-vscode"
710
}
811
}

lib/Resource/ApiKeyCreatedData.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ public function __construct(
2424
public string $obfuscatedValue,
2525
/** The timestamp when the API key was last used. */
2626
public ?string $lastUsedAt,
27+
/** Timestamp when the API Key expires. Null means the key does not expire. */
28+
public ?\DateTimeImmutable $expiresAt,
2729
/**
2830
* The permissions granted to the API key.
2931
* @var array<string>
@@ -33,8 +35,6 @@ public function __construct(
3335
public string $createdAt,
3436
/** The timestamp when the API key was last updated. */
3537
public string $updatedAt,
36-
/** Timestamp when the API Key expires. Null means the key does not expire. */
37-
public ?\DateTimeImmutable $expiresAt = null,
3838
) {
3939
}
4040

@@ -49,10 +49,10 @@ public static function fromArray(array $data): self
4949
name: $data['name'],
5050
obfuscatedValue: $data['obfuscated_value'],
5151
lastUsedAt: $data['last_used_at'] ?? null,
52+
expiresAt: isset($data['expires_at']) ? new \DateTimeImmutable($data['expires_at']) : null,
5253
permissions: $data['permissions'],
5354
createdAt: $data['created_at'],
5455
updatedAt: $data['updated_at'],
55-
expiresAt: isset($data['expires_at']) ? new \DateTimeImmutable($data['expires_at']) : null,
5656
);
5757
}
5858

@@ -65,10 +65,10 @@ public function toArray(): array
6565
'name' => $this->name,
6666
'obfuscated_value' => $this->obfuscatedValue,
6767
'last_used_at' => $this->lastUsedAt,
68+
'expires_at' => $this->expiresAt?->format(\DateTimeInterface::RFC3339_EXTENDED),
6869
'permissions' => $this->permissions,
6970
'created_at' => $this->createdAt,
7071
'updated_at' => $this->updatedAt,
71-
'expires_at' => $this->expiresAt?->format(\DateTimeInterface::RFC3339_EXTENDED),
7272
];
7373
}
7474
}

lib/Resource/ApiKeyRevokedData.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ public function __construct(
2424
public string $obfuscatedValue,
2525
/** The timestamp when the API key was last used. */
2626
public ?string $lastUsedAt,
27+
/** Timestamp when the API Key expires. Null means the key does not expire. */
28+
public ?\DateTimeImmutable $expiresAt,
2729
/**
2830
* The permissions granted to the API key.
2931
* @var array<string>
@@ -33,8 +35,6 @@ public function __construct(
3335
public string $createdAt,
3436
/** The timestamp when the API key was last updated. */
3537
public string $updatedAt,
36-
/** Timestamp when the API Key expires. Null means the key does not expire. */
37-
public ?\DateTimeImmutable $expiresAt = null,
3838
) {
3939
}
4040

@@ -49,10 +49,10 @@ public static function fromArray(array $data): self
4949
name: $data['name'],
5050
obfuscatedValue: $data['obfuscated_value'],
5151
lastUsedAt: $data['last_used_at'] ?? null,
52+
expiresAt: isset($data['expires_at']) ? new \DateTimeImmutable($data['expires_at']) : null,
5253
permissions: $data['permissions'],
5354
createdAt: $data['created_at'],
5455
updatedAt: $data['updated_at'],
55-
expiresAt: isset($data['expires_at']) ? new \DateTimeImmutable($data['expires_at']) : null,
5656
);
5757
}
5858

@@ -65,10 +65,10 @@ public function toArray(): array
6565
'name' => $this->name,
6666
'obfuscated_value' => $this->obfuscatedValue,
6767
'last_used_at' => $this->lastUsedAt,
68+
'expires_at' => $this->expiresAt?->format(\DateTimeInterface::RFC3339_EXTENDED),
6869
'permissions' => $this->permissions,
6970
'created_at' => $this->createdAt,
7071
'updated_at' => $this->updatedAt,
71-
'expires_at' => $this->expiresAt?->format(\DateTimeInterface::RFC3339_EXTENDED),
7272
];
7373
}
7474
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace WorkOS\Resource;
88

9-
readonly class DsyncDeactivated implements \JsonSerializable
9+
readonly class ApiKeyUpdated implements \JsonSerializable
1010
{
1111
use JsonSerializableTrait;
1212

@@ -17,7 +17,7 @@ public function __construct(
1717
public string $id,
1818
public string $event,
1919
/** The event payload. */
20-
public DsyncDeactivatedData $data,
20+
public ApiKeyUpdatedData $data,
2121
/** An ISO 8601 timestamp. */
2222
public \DateTimeImmutable $createdAt,
2323
public ?EventContext $context = null,
@@ -29,8 +29,8 @@ public static function fromArray(array $data): self
2929
return new self(
3030
object: $data['object'] ?? 'event',
3131
id: $data['id'],
32-
event: $data['event'] ?? 'dsync.deactivated',
33-
data: DsyncDeactivatedData::fromArray($data['data']),
32+
event: $data['event'] ?? 'api_key.updated',
33+
data: ApiKeyUpdatedData::fromArray($data['data']),
3434
createdAt: new \DateTimeImmutable($data['created_at']),
3535
context: isset($data['context']) ? EventContext::fromArray($data['context']) : null,
3636
);

lib/Resource/ApiKeyUpdatedData.php

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
// This file is auto-generated by oagen. Do not edit.
6+
7+
namespace WorkOS\Resource;
8+
9+
/** The event payload. */
10+
readonly class ApiKeyUpdatedData implements \JsonSerializable
11+
{
12+
use JsonSerializableTrait;
13+
14+
public function __construct(
15+
/** Distinguishes the API key object. */
16+
public string $object,
17+
/** Unique identifier of the API key. */
18+
public string $id,
19+
/** The owner of the API key. */
20+
public ApiKeyUpdatedDataOwner|UserApiKeyUpdatedDataOwner $owner,
21+
/** The name of the API key. */
22+
public string $name,
23+
/** The obfuscated value of the API key. */
24+
public string $obfuscatedValue,
25+
/** The timestamp when the API key was last used. */
26+
public ?string $lastUsedAt,
27+
/** Timestamp when the API Key expires. Null means the key does not expire. */
28+
public ?\DateTimeImmutable $expiresAt,
29+
/**
30+
* The permissions granted to the API key.
31+
* @var array<string>
32+
*/
33+
public array $permissions,
34+
/** The timestamp when the API key was created. */
35+
public string $createdAt,
36+
/** The timestamp when the API key was last updated. */
37+
public string $updatedAt,
38+
/** Previous API key attributes before the update. */
39+
public ApiKeyUpdatedDataPreviousAttribute $previousAttributes,
40+
) {
41+
}
42+
43+
public static function fromArray(array $data): self
44+
{
45+
return new self(
46+
object: $data['object'] ?? 'api_key',
47+
id: $data['id'],
48+
owner: match ($data['owner']['type'] ?? null) {
49+
'organization' => ApiKeyUpdatedDataOwner::fromArray($data['owner']), 'user' => UserApiKeyUpdatedDataOwner::fromArray($data['owner']), default => throw new \UnexpectedValueException(sprintf('Unknown type: %s', json_encode($data['owner']['type'] ?? null)))
50+
},
51+
name: $data['name'],
52+
obfuscatedValue: $data['obfuscated_value'],
53+
lastUsedAt: $data['last_used_at'] ?? null,
54+
expiresAt: isset($data['expires_at']) ? new \DateTimeImmutable($data['expires_at']) : null,
55+
permissions: $data['permissions'],
56+
createdAt: $data['created_at'],
57+
updatedAt: $data['updated_at'],
58+
previousAttributes: ApiKeyUpdatedDataPreviousAttribute::fromArray($data['previous_attributes']),
59+
);
60+
}
61+
62+
public function toArray(): array
63+
{
64+
return [
65+
'object' => $this->object,
66+
'id' => $this->id,
67+
'owner' => $this->owner->toArray(),
68+
'name' => $this->name,
69+
'obfuscated_value' => $this->obfuscatedValue,
70+
'last_used_at' => $this->lastUsedAt,
71+
'expires_at' => $this->expiresAt?->format(\DateTimeInterface::RFC3339_EXTENDED),
72+
'permissions' => $this->permissions,
73+
'created_at' => $this->createdAt,
74+
'updated_at' => $this->updatedAt,
75+
'previous_attributes' => $this->previousAttributes->toArray(),
76+
];
77+
}
78+
}

0 commit comments

Comments
 (0)