Skip to content

Commit 74d1819

Browse files
committed
feat: add group, pipes, and authorization additive API support
1 parent f4ad142 commit 74d1819

23 files changed

Lines changed: 701 additions & 0 deletions
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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 [access token](https://workos.com/docs/reference/pipes/access-token) object, present when `active` is `true`. */
10+
readonly class DataIntegrationAccessTokenResponseAccessToken implements \JsonSerializable
11+
{
12+
use JsonSerializableTrait;
13+
14+
public function __construct(
15+
/** Distinguishes the access token object. */
16+
public string $object,
17+
/** The OAuth access token for the connected integration. */
18+
public string $accessToken,
19+
/** The ISO-8601 formatted timestamp indicating when the access token expires. */
20+
public ?string $expiresAt,
21+
/**
22+
* The scopes granted to the access token.
23+
* @var array<string>
24+
*/
25+
public array $scopes,
26+
/**
27+
* If the integration has requested scopes that aren't present on the access token, they're listed here.
28+
* @var array<string>
29+
*/
30+
public array $missingScopes,
31+
) {
32+
}
33+
34+
public static function fromArray(array $data): self
35+
{
36+
return new self(
37+
object: $data['object'],
38+
accessToken: $data['access_token'],
39+
expiresAt: $data['expires_at'] ?? null,
40+
scopes: $data['scopes'],
41+
missingScopes: $data['missing_scopes'],
42+
);
43+
}
44+
45+
public function toArray(): array
46+
{
47+
return [
48+
'object' => $this->object,
49+
'access_token' => $this->accessToken,
50+
'expires_at' => $this->expiresAt,
51+
'scopes' => $this->scopes,
52+
'missing_scopes' => $this->missingScopes,
53+
];
54+
}
55+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
enum DataIntegrationAccessTokenResponseError: string
10+
{
11+
case NeedsReauthorization = 'needs_reauthorization';
12+
case NotInstalled = 'not_installed';
13+
}

lib/Resource/Group.php

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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 Group implements \JsonSerializable
10+
{
11+
use JsonSerializableTrait;
12+
13+
public function __construct(
14+
/** The Group object. */
15+
public string $object,
16+
/** The unique ID of the Group. */
17+
public string $id,
18+
/** The ID of the Organization the Group belongs to. */
19+
public string $organizationId,
20+
/** The name of the Group. */
21+
public string $name,
22+
/** An optional description of the Group. */
23+
public ?string $description,
24+
/** An ISO 8601 timestamp. */
25+
public \DateTimeImmutable $createdAt,
26+
/** An ISO 8601 timestamp. */
27+
public \DateTimeImmutable $updatedAt,
28+
) {
29+
}
30+
31+
public static function fromArray(array $data): self
32+
{
33+
return new self(
34+
object: $data['object'],
35+
id: $data['id'],
36+
organizationId: $data['organization_id'],
37+
name: $data['name'],
38+
description: $data['description'] ?? null,
39+
createdAt: new \DateTimeImmutable($data['created_at']),
40+
updatedAt: new \DateTimeImmutable($data['updated_at']),
41+
);
42+
}
43+
44+
public function toArray(): array
45+
{
46+
return [
47+
'object' => $this->object,
48+
'id' => $this->id,
49+
'organization_id' => $this->organizationId,
50+
'name' => $this->name,
51+
'description' => $this->description,
52+
'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED),
53+
'updated_at' => $this->updatedAt->format(\DateTimeInterface::RFC3339_EXTENDED),
54+
];
55+
}
56+
}

lib/Resource/GroupCreated.php

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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 GroupCreated implements \JsonSerializable
10+
{
11+
use JsonSerializableTrait;
12+
13+
public function __construct(
14+
/** Unique identifier for the event. */
15+
public string $id,
16+
public string $event,
17+
/** The event payload. */
18+
public Group $data,
19+
/** An ISO 8601 timestamp. */
20+
public \DateTimeImmutable $createdAt,
21+
/** Distinguishes the Event object. */
22+
public string $object,
23+
public ?EventContext $context = null,
24+
) {
25+
}
26+
27+
public static function fromArray(array $data): self
28+
{
29+
return new self(
30+
id: $data['id'],
31+
event: $data['event'],
32+
data: Group::fromArray($data['data']),
33+
createdAt: new \DateTimeImmutable($data['created_at']),
34+
object: $data['object'],
35+
context: isset($data['context']) ? EventContext::fromArray($data['context']) : null,
36+
);
37+
}
38+
39+
public function toArray(): array
40+
{
41+
return [
42+
'id' => $this->id,
43+
'event' => $this->event,
44+
'data' => $this->data->toArray(),
45+
'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED),
46+
'object' => $this->object,
47+
'context' => $this->context?->toArray(),
48+
];
49+
}
50+
}

lib/Resource/GroupDeleted.php

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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 GroupDeleted implements \JsonSerializable
10+
{
11+
use JsonSerializableTrait;
12+
13+
public function __construct(
14+
/** Unique identifier for the event. */
15+
public string $id,
16+
public string $event,
17+
/** The event payload. */
18+
public Group $data,
19+
/** An ISO 8601 timestamp. */
20+
public \DateTimeImmutable $createdAt,
21+
/** Distinguishes the Event object. */
22+
public string $object,
23+
public ?EventContext $context = null,
24+
) {
25+
}
26+
27+
public static function fromArray(array $data): self
28+
{
29+
return new self(
30+
id: $data['id'],
31+
event: $data['event'],
32+
data: Group::fromArray($data['data']),
33+
createdAt: new \DateTimeImmutable($data['created_at']),
34+
object: $data['object'],
35+
context: isset($data['context']) ? EventContext::fromArray($data['context']) : null,
36+
);
37+
}
38+
39+
public function toArray(): array
40+
{
41+
return [
42+
'id' => $this->id,
43+
'event' => $this->event,
44+
'data' => $this->data->toArray(),
45+
'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED),
46+
'object' => $this->object,
47+
'context' => $this->context?->toArray(),
48+
];
49+
}
50+
}

lib/Resource/GroupMemberAdded.php

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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 GroupMemberAdded implements \JsonSerializable
10+
{
11+
use JsonSerializableTrait;
12+
13+
public function __construct(
14+
/** Unique identifier for the event. */
15+
public string $id,
16+
public string $event,
17+
/** The event payload. */
18+
public GroupMemberAddedData $data,
19+
/** An ISO 8601 timestamp. */
20+
public \DateTimeImmutable $createdAt,
21+
/** Distinguishes the Event object. */
22+
public string $object,
23+
public ?EventContext $context = null,
24+
) {
25+
}
26+
27+
public static function fromArray(array $data): self
28+
{
29+
return new self(
30+
id: $data['id'],
31+
event: $data['event'],
32+
data: GroupMemberAddedData::fromArray($data['data']),
33+
createdAt: new \DateTimeImmutable($data['created_at']),
34+
object: $data['object'],
35+
context: isset($data['context']) ? EventContext::fromArray($data['context']) : null,
36+
);
37+
}
38+
39+
public function toArray(): array
40+
{
41+
return [
42+
'id' => $this->id,
43+
'event' => $this->event,
44+
'data' => $this->data->toArray(),
45+
'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED),
46+
'object' => $this->object,
47+
'context' => $this->context?->toArray(),
48+
];
49+
}
50+
}
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 event payload. */
10+
readonly class GroupMemberAddedData implements \JsonSerializable
11+
{
12+
use JsonSerializableTrait;
13+
14+
public function __construct(
15+
/** The ID of the Group. */
16+
public string $groupId,
17+
/** The ID of the OrganizationMembership. */
18+
public string $organizationMembershipId,
19+
) {
20+
}
21+
22+
public static function fromArray(array $data): self
23+
{
24+
return new self(
25+
groupId: $data['group_id'],
26+
organizationMembershipId: $data['organization_membership_id'],
27+
);
28+
}
29+
30+
public function toArray(): array
31+
{
32+
return [
33+
'group_id' => $this->groupId,
34+
'organization_membership_id' => $this->organizationMembershipId,
35+
];
36+
}
37+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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 GroupMemberRemoved implements \JsonSerializable
10+
{
11+
use JsonSerializableTrait;
12+
13+
public function __construct(
14+
/** Unique identifier for the event. */
15+
public string $id,
16+
public string $event,
17+
/** The event payload. */
18+
public GroupMemberRemovedData $data,
19+
/** An ISO 8601 timestamp. */
20+
public \DateTimeImmutable $createdAt,
21+
/** Distinguishes the Event object. */
22+
public string $object,
23+
public ?EventContext $context = null,
24+
) {
25+
}
26+
27+
public static function fromArray(array $data): self
28+
{
29+
return new self(
30+
id: $data['id'],
31+
event: $data['event'],
32+
data: GroupMemberRemovedData::fromArray($data['data']),
33+
createdAt: new \DateTimeImmutable($data['created_at']),
34+
object: $data['object'],
35+
context: isset($data['context']) ? EventContext::fromArray($data['context']) : null,
36+
);
37+
}
38+
39+
public function toArray(): array
40+
{
41+
return [
42+
'id' => $this->id,
43+
'event' => $this->event,
44+
'data' => $this->data->toArray(),
45+
'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED),
46+
'object' => $this->object,
47+
'context' => $this->context?->toArray(),
48+
];
49+
}
50+
}

0 commit comments

Comments
 (0)