Skip to content

Commit 3557ee9

Browse files
feat(generated): Add new classes and fields for API key validation and dsync tokens
1 parent 8757177 commit 3557ee9

52 files changed

Lines changed: 714 additions & 37 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.

.last-synced-sha

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
92db0495807c86fbbc4d45bd266a6c1f5bcbb59c
1+
f908f520f9fcd63dfd42ed35b7f141a65b61609b

.oagen-manifest.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"version": 2,
33
"language": "php",
4-
"generatedAt": "2026-04-28T15:07:27.545Z",
4+
"generatedAt": "2026-04-30T20:02:41.747Z",
55
"files": [
66
"lib/Resource/ActionAuthenticationDenied.php",
77
"lib/Resource/ActionAuthenticationDeniedData.php",
@@ -17,6 +17,8 @@
1717
"lib/Resource/ApiKeyRevokedData.php",
1818
"lib/Resource/ApiKeyRevokedDataOwner.php",
1919
"lib/Resource/ApiKeyValidationResponse.php",
20+
"lib/Resource/ApiKeyValidationResponseApiKey.php",
21+
"lib/Resource/ApiKeyValidationResponseApiKeyOwner.php",
2022
"lib/Resource/ApiKeyWithValue.php",
2123
"lib/Resource/ApiKeyWithValueOwner.php",
2224
"lib/Resource/ApplicationCredentialsListItem.php",
@@ -210,6 +212,10 @@
210212
"lib/Resource/DsyncGroupUserAddedData.php",
211213
"lib/Resource/DsyncGroupUserRemoved.php",
212214
"lib/Resource/DsyncGroupUserRemovedData.php",
215+
"lib/Resource/DsyncTokenCreated.php",
216+
"lib/Resource/DsyncTokenCreatedData.php",
217+
"lib/Resource/DsyncTokenDeleted.php",
218+
"lib/Resource/DsyncTokenDeletedData.php",
213219
"lib/Resource/DsyncUserCreated.php",
214220
"lib/Resource/DsyncUserDeleted.php",
215221
"lib/Resource/DsyncUserUpdated.php",
@@ -433,6 +439,7 @@
433439
"lib/Resource/UserObject.php",
434440
"lib/Resource/UserOrganizationMembership.php",
435441
"lib/Resource/UserOrganizationMembershipBaseListData.php",
442+
"lib/Resource/UserOrganizationMembershipBaseWithUser.php",
436443
"lib/Resource/UserSessionsAuthMethod.php",
437444
"lib/Resource/UserSessionsImpersonator.php",
438445
"lib/Resource/UserSessionsListItem.php",
@@ -518,6 +525,8 @@
518525
"tests/Fixtures/api_key_revoked_data.json",
519526
"tests/Fixtures/api_key_revoked_data_owner.json",
520527
"tests/Fixtures/api_key_validation_response.json",
528+
"tests/Fixtures/api_key_validation_response_api_key.json",
529+
"tests/Fixtures/api_key_validation_response_api_key_owner.json",
521530
"tests/Fixtures/api_key_with_value.json",
522531
"tests/Fixtures/api_key_with_value_owner.json",
523532
"tests/Fixtures/application_credentials_list_item.json",
@@ -684,6 +693,10 @@
684693
"tests/Fixtures/dsync_group_user_added_data.json",
685694
"tests/Fixtures/dsync_group_user_removed.json",
686695
"tests/Fixtures/dsync_group_user_removed_data.json",
696+
"tests/Fixtures/dsync_token_created.json",
697+
"tests/Fixtures/dsync_token_created_data.json",
698+
"tests/Fixtures/dsync_token_deleted.json",
699+
"tests/Fixtures/dsync_token_deleted_data.json",
687700
"tests/Fixtures/dsync_user_created.json",
688701
"tests/Fixtures/dsync_user_deleted.json",
689702
"tests/Fixtures/dsync_user_updated.json",
@@ -781,6 +794,7 @@
781794
"tests/Fixtures/list_user_invite.json",
782795
"tests/Fixtures/list_user_organization_membership.json",
783796
"tests/Fixtures/list_user_organization_membership_base_list_data.json",
797+
"tests/Fixtures/list_user_organization_membership_base_with_user.json",
784798
"tests/Fixtures/list_user_sessions_list_item.json",
785799
"tests/Fixtures/list_webhook_endpoint_json.json",
786800
"tests/Fixtures/magic_auth.json",
@@ -908,6 +922,7 @@
908922
"tests/Fixtures/user_object.json",
909923
"tests/Fixtures/user_organization_membership.json",
910924
"tests/Fixtures/user_organization_membership_base_list_data.json",
925+
"tests/Fixtures/user_organization_membership_base_with_user.json",
911926
"tests/Fixtures/user_sessions_impersonator.json",
912927
"tests/Fixtures/user_sessions_list_item.json",
913928
"tests/Fixtures/user_updated.json",

lib/Resource/ApiKey.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
namespace WorkOS\Resource;
88

9-
/** The API Key object if the value is valid, or `null` if invalid. */
109
readonly class ApiKey implements \JsonSerializable
1110
{
1211
use JsonSerializableTrait;

lib/Resource/ApiKeyCreatedData.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static function fromArray(array $data): self
4141
return new self(
4242
object: $data['object'] ?? 'api_key',
4343
id: $data['id'],
44-
owner: ApiKeyCreatedDataOwner::fromArray($data['owner']),
44+
owner: $data['owner'],
4545
name: $data['name'],
4646
obfuscatedValue: $data['obfuscated_value'],
4747
lastUsedAt: $data['last_used_at'] ?? null,
@@ -56,7 +56,7 @@ public function toArray(): array
5656
return [
5757
'object' => $this->object,
5858
'id' => $this->id,
59-
'owner' => $this->owner->toArray(),
59+
'owner' => $this->owner,
6060
'name' => $this->name,
6161
'obfuscated_value' => $this->obfuscatedValue,
6262
'last_used_at' => $this->lastUsedAt,

lib/Resource/ApiKeyCreatedDataOwner.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
namespace WorkOS\Resource;
88

9-
/** The owner of the API key. */
109
readonly class ApiKeyCreatedDataOwner implements \JsonSerializable
1110
{
1211
use JsonSerializableTrait;

lib/Resource/ApiKeyRevokedData.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static function fromArray(array $data): self
4141
return new self(
4242
object: $data['object'] ?? 'api_key',
4343
id: $data['id'],
44-
owner: ApiKeyRevokedDataOwner::fromArray($data['owner']),
44+
owner: $data['owner'],
4545
name: $data['name'],
4646
obfuscatedValue: $data['obfuscated_value'],
4747
lastUsedAt: $data['last_used_at'] ?? null,
@@ -56,7 +56,7 @@ public function toArray(): array
5656
return [
5757
'object' => $this->object,
5858
'id' => $this->id,
59-
'owner' => $this->owner->toArray(),
59+
'owner' => $this->owner,
6060
'name' => $this->name,
6161
'obfuscated_value' => $this->obfuscatedValue,
6262
'last_used_at' => $this->lastUsedAt,

lib/Resource/ApiKeyRevokedDataOwner.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
namespace WorkOS\Resource;
88

9-
/** The owner of the API key. */
109
readonly class ApiKeyRevokedDataOwner implements \JsonSerializable
1110
{
1211
use JsonSerializableTrait;

lib/Resource/ApiKeyValidationResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
use JsonSerializableTrait;
1212

1313
public function __construct(
14-
public ?ApiKey $apiKey,
14+
public ?ApiKeyValidationResponseApiKey $apiKey,
1515
) {
1616
}
1717

1818
public static function fromArray(array $data): self
1919
{
2020
return new self(
21-
apiKey: isset($data['api_key']) ? ApiKey::fromArray($data['api_key']) : null,
21+
apiKey: isset($data['api_key']) ? ApiKeyValidationResponseApiKey::fromArray($data['api_key']) : null,
2222
);
2323
}
2424

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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+
readonly class ApiKeyValidationResponseApiKey implements \JsonSerializable
10+
{
11+
use JsonSerializableTrait;
12+
13+
public function __construct(
14+
/** Distinguishes the API Key object. */
15+
public string $object,
16+
/** Unique identifier of the API Key. */
17+
public string $id,
18+
/** The entity that owns the API Key. */
19+
public ApiKeyValidationResponseApiKeyOwner $owner,
20+
/** A descriptive name for the API Key. */
21+
public string $name,
22+
/** An obfuscated representation of the API Key value. */
23+
public string $obfuscatedValue,
24+
/** Timestamp of when the API Key was last used. */
25+
public ?\DateTimeImmutable $lastUsedAt,
26+
/**
27+
* The permission slugs assigned to the API Key.
28+
* @var array<string>
29+
*/
30+
public array $permissions,
31+
/** An ISO 8601 timestamp. */
32+
public \DateTimeImmutable $createdAt,
33+
/** An ISO 8601 timestamp. */
34+
public \DateTimeImmutable $updatedAt,
35+
) {
36+
}
37+
38+
public static function fromArray(array $data): self
39+
{
40+
return new self(
41+
object: $data['object'] ?? 'api_key',
42+
id: $data['id'],
43+
owner: ApiKeyValidationResponseApiKeyOwner::fromArray($data['owner']),
44+
name: $data['name'],
45+
obfuscatedValue: $data['obfuscated_value'],
46+
lastUsedAt: isset($data['last_used_at']) ? new \DateTimeImmutable($data['last_used_at']) : null,
47+
permissions: $data['permissions'],
48+
createdAt: new \DateTimeImmutable($data['created_at']),
49+
updatedAt: new \DateTimeImmutable($data['updated_at']),
50+
);
51+
}
52+
53+
public function toArray(): array
54+
{
55+
return [
56+
'object' => $this->object,
57+
'id' => $this->id,
58+
'owner' => $this->owner->toArray(),
59+
'name' => $this->name,
60+
'obfuscated_value' => $this->obfuscatedValue,
61+
'last_used_at' => $this->lastUsedAt?->format(\DateTimeInterface::RFC3339_EXTENDED),
62+
'permissions' => $this->permissions,
63+
'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED),
64+
'updated_at' => $this->updatedAt->format(\DateTimeInterface::RFC3339_EXTENDED),
65+
];
66+
}
67+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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 entity that owns the API Key. */
10+
readonly class ApiKeyValidationResponseApiKeyOwner implements \JsonSerializable
11+
{
12+
use JsonSerializableTrait;
13+
14+
public function __construct(
15+
/** The type of the API Key owner. */
16+
public string $type,
17+
/** Unique identifier of the API Key owner. */
18+
public string $id,
19+
) {
20+
}
21+
22+
public static function fromArray(array $data): self
23+
{
24+
return new self(
25+
type: $data['type'] ?? 'organization',
26+
id: $data['id'],
27+
);
28+
}
29+
30+
public function toArray(): array
31+
{
32+
return [
33+
'type' => $this->type,
34+
'id' => $this->id,
35+
];
36+
}
37+
}

0 commit comments

Comments
 (0)