-
Notifications
You must be signed in to change notification settings - Fork 18
feat: add group, pipes, and authorization additive API support #367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
lib/Resource/DataIntegrationAccessTokenResponseAccessToken.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| // This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| namespace WorkOS\Resource; | ||
|
|
||
| /** The [access token](https://workos.com/docs/reference/pipes/access-token) object, present when `active` is `true`. */ | ||
| readonly class DataIntegrationAccessTokenResponseAccessToken implements \JsonSerializable | ||
| { | ||
| use JsonSerializableTrait; | ||
|
|
||
| public function __construct( | ||
| /** Distinguishes the access token object. */ | ||
| public string $object, | ||
| /** The OAuth access token for the connected integration. */ | ||
| public string $accessToken, | ||
| /** The ISO-8601 formatted timestamp indicating when the access token expires. */ | ||
| public ?string $expiresAt, | ||
| /** | ||
| * The scopes granted to the access token. | ||
| * @var array<string> | ||
| */ | ||
| public array $scopes, | ||
| /** | ||
| * If the integration has requested scopes that aren't present on the access token, they're listed here. | ||
| * @var array<string> | ||
| */ | ||
| public array $missingScopes, | ||
| ) { | ||
| } | ||
|
|
||
| public static function fromArray(array $data): self | ||
| { | ||
| return new self( | ||
| object: $data['object'], | ||
| accessToken: $data['access_token'], | ||
| expiresAt: $data['expires_at'] ?? null, | ||
| scopes: $data['scopes'], | ||
| missingScopes: $data['missing_scopes'], | ||
| ); | ||
| } | ||
|
|
||
| public function toArray(): array | ||
| { | ||
| return [ | ||
| 'object' => $this->object, | ||
| 'access_token' => $this->accessToken, | ||
| 'expires_at' => $this->expiresAt, | ||
| 'scopes' => $this->scopes, | ||
| 'missing_scopes' => $this->missingScopes, | ||
| ]; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| // This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| namespace WorkOS\Resource; | ||
|
|
||
| enum DataIntegrationAccessTokenResponseError: string | ||
| { | ||
| case NeedsReauthorization = 'needs_reauthorization'; | ||
| case NotInstalled = 'not_installed'; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| // This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| namespace WorkOS\Resource; | ||
|
|
||
| readonly class Group implements \JsonSerializable | ||
| { | ||
| use JsonSerializableTrait; | ||
|
|
||
| public function __construct( | ||
| /** The Group object. */ | ||
| public string $object, | ||
| /** The unique ID of the Group. */ | ||
| public string $id, | ||
| /** The ID of the Organization the Group belongs to. */ | ||
| public string $organizationId, | ||
| /** The name of the Group. */ | ||
| public string $name, | ||
| /** An optional description of the Group. */ | ||
| public ?string $description, | ||
| /** An ISO 8601 timestamp. */ | ||
| public \DateTimeImmutable $createdAt, | ||
| /** An ISO 8601 timestamp. */ | ||
| public \DateTimeImmutable $updatedAt, | ||
| ) { | ||
| } | ||
|
|
||
| public static function fromArray(array $data): self | ||
| { | ||
| return new self( | ||
| object: $data['object'], | ||
| id: $data['id'], | ||
| organizationId: $data['organization_id'], | ||
| name: $data['name'], | ||
| description: $data['description'] ?? null, | ||
| createdAt: new \DateTimeImmutable($data['created_at']), | ||
| updatedAt: new \DateTimeImmutable($data['updated_at']), | ||
| ); | ||
| } | ||
|
|
||
| public function toArray(): array | ||
| { | ||
| return [ | ||
| 'object' => $this->object, | ||
| 'id' => $this->id, | ||
| 'organization_id' => $this->organizationId, | ||
| 'name' => $this->name, | ||
| 'description' => $this->description, | ||
| 'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED), | ||
| 'updated_at' => $this->updatedAt->format(\DateTimeInterface::RFC3339_EXTENDED), | ||
| ]; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| // This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| namespace WorkOS\Resource; | ||
|
|
||
| readonly class GroupCreated implements \JsonSerializable | ||
| { | ||
| use JsonSerializableTrait; | ||
|
|
||
| public function __construct( | ||
| /** Unique identifier for the event. */ | ||
| public string $id, | ||
| public string $event, | ||
| /** The event payload. */ | ||
| public Group $data, | ||
| /** An ISO 8601 timestamp. */ | ||
| public \DateTimeImmutable $createdAt, | ||
| /** Distinguishes the Event object. */ | ||
| public string $object, | ||
| public ?EventContext $context = null, | ||
| ) { | ||
| } | ||
|
|
||
| public static function fromArray(array $data): self | ||
| { | ||
| return new self( | ||
| id: $data['id'], | ||
| event: $data['event'], | ||
| data: Group::fromArray($data['data']), | ||
| createdAt: new \DateTimeImmutable($data['created_at']), | ||
| object: $data['object'], | ||
| context: isset($data['context']) ? EventContext::fromArray($data['context']) : null, | ||
| ); | ||
| } | ||
|
|
||
| public function toArray(): array | ||
| { | ||
| return [ | ||
| 'id' => $this->id, | ||
| 'event' => $this->event, | ||
| 'data' => $this->data->toArray(), | ||
| 'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED), | ||
| 'object' => $this->object, | ||
| 'context' => $this->context?->toArray(), | ||
| ]; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| // This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| namespace WorkOS\Resource; | ||
|
|
||
| readonly class GroupDeleted implements \JsonSerializable | ||
| { | ||
| use JsonSerializableTrait; | ||
|
|
||
| public function __construct( | ||
| /** Unique identifier for the event. */ | ||
| public string $id, | ||
| public string $event, | ||
| /** The event payload. */ | ||
| public Group $data, | ||
| /** An ISO 8601 timestamp. */ | ||
| public \DateTimeImmutable $createdAt, | ||
| /** Distinguishes the Event object. */ | ||
| public string $object, | ||
| public ?EventContext $context = null, | ||
| ) { | ||
| } | ||
|
|
||
| public static function fromArray(array $data): self | ||
| { | ||
| return new self( | ||
| id: $data['id'], | ||
| event: $data['event'], | ||
| data: Group::fromArray($data['data']), | ||
| createdAt: new \DateTimeImmutable($data['created_at']), | ||
| object: $data['object'], | ||
| context: isset($data['context']) ? EventContext::fromArray($data['context']) : null, | ||
| ); | ||
| } | ||
|
|
||
| public function toArray(): array | ||
| { | ||
| return [ | ||
| 'id' => $this->id, | ||
| 'event' => $this->event, | ||
| 'data' => $this->data->toArray(), | ||
| 'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED), | ||
| 'object' => $this->object, | ||
| 'context' => $this->context?->toArray(), | ||
| ]; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| // This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| namespace WorkOS\Resource; | ||
|
|
||
| readonly class GroupMemberAdded implements \JsonSerializable | ||
| { | ||
| use JsonSerializableTrait; | ||
|
|
||
| public function __construct( | ||
| /** Unique identifier for the event. */ | ||
| public string $id, | ||
| public string $event, | ||
| /** The event payload. */ | ||
| public GroupMemberAddedData $data, | ||
| /** An ISO 8601 timestamp. */ | ||
| public \DateTimeImmutable $createdAt, | ||
| /** Distinguishes the Event object. */ | ||
| public string $object, | ||
| public ?EventContext $context = null, | ||
| ) { | ||
| } | ||
|
|
||
| public static function fromArray(array $data): self | ||
| { | ||
| return new self( | ||
| id: $data['id'], | ||
| event: $data['event'], | ||
| data: GroupMemberAddedData::fromArray($data['data']), | ||
| createdAt: new \DateTimeImmutable($data['created_at']), | ||
| object: $data['object'], | ||
| context: isset($data['context']) ? EventContext::fromArray($data['context']) : null, | ||
| ); | ||
| } | ||
|
|
||
| public function toArray(): array | ||
| { | ||
| return [ | ||
| 'id' => $this->id, | ||
| 'event' => $this->event, | ||
| 'data' => $this->data->toArray(), | ||
| 'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED), | ||
| 'object' => $this->object, | ||
| 'context' => $this->context?->toArray(), | ||
| ]; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| // This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| namespace WorkOS\Resource; | ||
|
|
||
| /** The event payload. */ | ||
| readonly class GroupMemberAddedData implements \JsonSerializable | ||
| { | ||
| use JsonSerializableTrait; | ||
|
|
||
| public function __construct( | ||
| /** The ID of the Group. */ | ||
| public string $groupId, | ||
| /** The ID of the OrganizationMembership. */ | ||
| public string $organizationMembershipId, | ||
| ) { | ||
| } | ||
|
|
||
| public static function fromArray(array $data): self | ||
| { | ||
| return new self( | ||
| groupId: $data['group_id'], | ||
| organizationMembershipId: $data['organization_membership_id'], | ||
| ); | ||
| } | ||
|
|
||
| public function toArray(): array | ||
| { | ||
| return [ | ||
| 'group_id' => $this->groupId, | ||
| 'organization_membership_id' => $this->organizationMembershipId, | ||
| ]; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| // This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| namespace WorkOS\Resource; | ||
|
|
||
| readonly class GroupMemberRemoved implements \JsonSerializable | ||
| { | ||
| use JsonSerializableTrait; | ||
|
|
||
| public function __construct( | ||
| /** Unique identifier for the event. */ | ||
| public string $id, | ||
| public string $event, | ||
| /** The event payload. */ | ||
| public GroupMemberRemovedData $data, | ||
| /** An ISO 8601 timestamp. */ | ||
| public \DateTimeImmutable $createdAt, | ||
| /** Distinguishes the Event object. */ | ||
| public string $object, | ||
| public ?EventContext $context = null, | ||
| ) { | ||
| } | ||
|
|
||
| public static function fromArray(array $data): self | ||
| { | ||
| return new self( | ||
| id: $data['id'], | ||
| event: $data['event'], | ||
| data: GroupMemberRemovedData::fromArray($data['data']), | ||
| createdAt: new \DateTimeImmutable($data['created_at']), | ||
| object: $data['object'], | ||
| context: isset($data['context']) ? EventContext::fromArray($data['context']) : null, | ||
| ); | ||
| } | ||
|
|
||
| public function toArray(): array | ||
| { | ||
| return [ | ||
| 'id' => $this->id, | ||
| 'event' => $this->event, | ||
| 'data' => $this->data->toArray(), | ||
| 'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED), | ||
| 'object' => $this->object, | ||
| 'context' => $this->context?->toArray(), | ||
| ]; | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DataIntegrationAccessTokenResponse(the class actually returned byPipes::createDataIntegrationToken) is still completely empty — it has no constructor properties and deserializes nothing. The two new classes added in this PR (DataIntegrationAccessTokenResponseAccessToken,DataIntegrationAccessTokenResponseError) exist in isolation but are never referenced fromDataIntegrationAccessTokenResponse, so callers still cannot access the access token,activeflag, or error from the API response. The original "data was missing" bug is not fixed.