Skip to content
Merged
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
55 changes: 55 additions & 0 deletions lib/Resource/DataIntegrationAccessTokenResponseAccessToken.php
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
Comment on lines +1 to +10
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.

P1 New nested types never wired into parent class

DataIntegrationAccessTokenResponse (the class actually returned by Pipes::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 from DataIntegrationAccessTokenResponse, so callers still cannot access the access token, active flag, or error from the API response. The original "data was missing" bug is not fixed.

{
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,
];
}
}
13 changes: 13 additions & 0 deletions lib/Resource/DataIntegrationAccessTokenResponseError.php
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';
}
56 changes: 56 additions & 0 deletions lib/Resource/Group.php
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),
];
}
}
50 changes: 50 additions & 0 deletions lib/Resource/GroupCreated.php
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(),
];
}
}
50 changes: 50 additions & 0 deletions lib/Resource/GroupDeleted.php
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(),
];
}
}
50 changes: 50 additions & 0 deletions lib/Resource/GroupMemberAdded.php
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(),
];
}
}
37 changes: 37 additions & 0 deletions lib/Resource/GroupMemberAddedData.php
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,
];
}
}
50 changes: 50 additions & 0 deletions lib/Resource/GroupMemberRemoved.php
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(),
];
}
}
Loading
Loading