Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
* [#450](https://github.com/workos/workos-php/pull/450) feat(generated): regenerate from spec (1 change)

**⚠️ Breaking**
* **[pipes](https://workos.com/docs/reference/pipes)**:
* Removed model `AddDataIntegrationsUpsertApiKeyRequest`
* Removed model `AddDataIntegrationsUpsertClientCredentialsRequest`
* Removed enum `AddDataIntegrationsUpsertApiKeyRequestConnectionOwner`
* Removed enum `AddDataIntegrationsUpsertClientCredentialsRequestConnectionOwner`

**Features**
* **[pipes](https://workos.com/docs/reference/pipes)**:
* Added model `DataIntegrationsCreateApiKeyConnectionRequest`
* Added model `DataIntegrationsCreateClientCredentialsConnectionRequest`
* Added enum `DataIntegrationsCreateApiKeyConnectionRequestConnectionOwner`
* Added enum `DataIntegrationsCreateClientCredentialsConnectionRequestConnectionOwner`
* Added endpoint `POST /data-integrations/{slug}/api-key`
* Added endpoint `POST /data-integrations/{slug}/client-credentials`
* Added `config` to `DataIntegrationVendedCredential`
* Added model `DataIntegrationVendedCredential`
* Added model `CreateOrganizationConnectedAccount`
* Added model `CreateConnectedAccount`
* Added model `AddDataIntegrationsUpsertApiKeyRequest`
* Added model `ReauthorizeDataIntegrationsUpsertApiKeyRequest`
* Added model `DataIntegrationsUpsertApiKeyRequest2`
* Added model `AddDataIntegrationsUpsertClientCredentialsRequest`
* Added model `ReauthorizeDataIntegrationsUpsertClientCredentialsRequest`
* Added model `DataIntegrationsUpsertClientCredentialsRequest2`
* Added enum `CreateOrganizationConnectedAccountState`
* Added enum `CreateConnectedAccountState`
* Added enum `AddDataIntegrationsUpsertApiKeyRequestConnectionOwner`
* Added enum `ReauthorizeDataIntegrationsUpsertApiKeyRequestConnectionOwner`
* Added enum `DataIntegrationsUpsertApiKeyRequest2ConnectionOwner`
* Added enum `AddDataIntegrationsUpsertClientCredentialsRequestConnectionOwner`
* Added enum `ReauthorizeDataIntegrationsUpsertClientCredentialsRequestConnectionOwner`
* Added enum `DataIntegrationsUpsertClientCredentialsRequest2ConnectionOwner`
* Added parameter `OrganizationsDataProviders.updateOrganizationDataInstallation.connection_intent`
* Added parameter `UserManagementDataProviders.updateUserDataInstallation.connection_intent`
* Added model `OrganizationConnectedAccount`
* Added enum `OrganizationConnectedAccountState`

**Fixes**
* **[pipes](https://workos.com/docs/reference/pipes)**:
* Changed request body for `Pipes.upsertApiKey`
* Changed request body for `Pipes.upsertClientCredentials`
* Changed errors for endpoint `POST /organizations/{organization_id}/connected_accounts/{slug}`
* Changed errors for endpoint `POST /user_management/users/{user_id}/connected_accounts/{slug}`
* Changed the type of `DataIntegrationCredentialsResponse.credential`
* Removed `connected_account_id` from `DataIntegrationsUpsertApiKeyRequest`
* Removed `connected_account_id` from `DataIntegrationsUpsertClientCredentialsRequest`
* Changed request body of `OrganizationsDataProviders.createOrganizationDataInstallation` from `OrganizationConnectedAccount` to `CreateOrganizationConnectedAccount`
* Changed request body of `UserManagementDataProviders.createUserDataInstallation` from `ConnectedAccountInput` to `CreateConnectedAccount`
* Changed request body of `OrganizationsDataProviders.createOrganizationDataInstallation` from `ConnectedAccountInput` to `OrganizationConnectedAccount`
* Changed request body of `OrganizationsDataProviders.updateOrganizationDataInstallation` from `ConnectedAccountInput` to `OrganizationConnectedAccount`
* Changed errors for endpoint `PUT /organizations/{organization_id}/connected_accounts/{slug}`
2 changes: 1 addition & 1 deletion .last-synced-sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6f037208ce812063908f97744b4aaf4fdf570351
e8f39fdd452f5ebca8bcdad9b8436f2bfb1d3ed7
28 changes: 28 additions & 0 deletions .oagen-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@
"lib/Resource/CreateAuthorizationPermission.php",
"lib/Resource/CreateAuthorizationResource.php",
"lib/Resource/CreateCORSOrigin.php",
"lib/Resource/CreateConnectedAccount.php",
"lib/Resource/CreateConnection.php",
"lib/Resource/CreateConnectionAttributeMaps.php",
"lib/Resource/CreateConnectionKeyPair.php",
Expand All @@ -256,6 +257,7 @@
"lib/Resource/CreateOAuthApplication.php",
"lib/Resource/CreateObjectRequest.php",
"lib/Resource/CreateOrganizationApiKey.php",
"lib/Resource/CreateOrganizationConnectedAccount.php",
"lib/Resource/CreateOrganizationDomain.php",
"lib/Resource/CreateOrganizationRole.php",
"lib/Resource/CreatePasswordReset.php",
Expand Down Expand Up @@ -294,14 +296,19 @@
"lib/Resource/DataIntegrationCustomProvider.php",
"lib/Resource/DataIntegrationInstallation.php",
"lib/Resource/DataIntegrationState.php",
"lib/Resource/DataIntegrationVendedCredential.php",
"lib/Resource/DataIntegrationsCreateApiKeyConnectionRequest.php",
"lib/Resource/DataIntegrationsCreateClientCredentialsConnectionRequest.php",
"lib/Resource/DataIntegrationsGetDataIntegrationAuthorizeUrlRequest.php",
"lib/Resource/DataIntegrationsGetUserTokenRequest.php",
"lib/Resource/DataIntegrationsListResponse.php",
"lib/Resource/DataIntegrationsListResponseData.php",
"lib/Resource/DataIntegrationsListResponseDataConnectedAccount.php",
"lib/Resource/DataIntegrationsListResponseDataOwnership.php",
"lib/Resource/DataIntegrationsUpsertApiKeyRequest.php",
"lib/Resource/DataIntegrationsUpsertApiKeyRequest2.php",
"lib/Resource/DataIntegrationsUpsertClientCredentialsRequest.php",
"lib/Resource/DataIntegrationsUpsertClientCredentialsRequest2.php",
"lib/Resource/DataIntegrationsVendCredentialsRequest.php",
"lib/Resource/DecryptRequest.php",
"lib/Resource/DecryptResponse.php",
Expand Down Expand Up @@ -447,6 +454,7 @@
"lib/Resource/OrganizationApiKeyWithValue.php",
"lib/Resource/OrganizationApiKeyWithValueOwner.php",
"lib/Resource/OrganizationAuthorizedConnectApplicationListData.php",
"lib/Resource/OrganizationConnectedAccount.php",
"lib/Resource/OrganizationCreated.php",
"lib/Resource/OrganizationCreatedData.php",
"lib/Resource/OrganizationCreatedDataDomain.php",
Expand Down Expand Up @@ -544,6 +552,8 @@
"lib/Resource/RadarStandaloneResponseVerdict.php",
"lib/Resource/RadarStandaloneUpdateRadarAttemptRequest.php",
"lib/Resource/RadarStandaloneUpdateRadarListRequest.php",
"lib/Resource/ReauthorizeDataIntegrationsUpsertApiKeyRequest.php",
"lib/Resource/ReauthorizeDataIntegrationsUpsertClientCredentialsRequest.php",
"lib/Resource/RedirectUri.php",
"lib/Resource/RedirectUriInput.php",
"lib/Resource/RefreshTokenSessionAuthenticateRequest.php",
Expand Down Expand Up @@ -944,6 +954,7 @@
"tests/Fixtures/create_authkit_oauth_resource.json",
"tests/Fixtures/create_authorization_permission.json",
"tests/Fixtures/create_authorization_resource.json",
"tests/Fixtures/create_connected_account.json",
"tests/Fixtures/create_connection.json",
"tests/Fixtures/create_connection_attribute_maps.json",
"tests/Fixtures/create_connection_key_pair.json",
Expand All @@ -963,6 +974,7 @@
"tests/Fixtures/create_oauth_application.json",
"tests/Fixtures/create_object_request.json",
"tests/Fixtures/create_organization_api_key.json",
"tests/Fixtures/create_organization_connected_account.json",
"tests/Fixtures/create_organization_domain.json",
"tests/Fixtures/create_organization_role.json",
"tests/Fixtures/create_password_reset.json",
Expand Down Expand Up @@ -991,13 +1003,18 @@
"tests/Fixtures/data_integration_credentials_response_credential.json",
"tests/Fixtures/data_integration_custom_provider.json",
"tests/Fixtures/data_integration_installation.json",
"tests/Fixtures/data_integration_vended_credential.json",
"tests/Fixtures/data_integrations_create_api_key_connection_request.json",
"tests/Fixtures/data_integrations_create_client_credentials_connection_request.json",
"tests/Fixtures/data_integrations_get_data_integration_authorize_url_request.json",
"tests/Fixtures/data_integrations_get_user_token_request.json",
"tests/Fixtures/data_integrations_list_response.json",
"tests/Fixtures/data_integrations_list_response_data.json",
"tests/Fixtures/data_integrations_list_response_data_connected_account.json",
"tests/Fixtures/data_integrations_upsert_api_key_request.json",
"tests/Fixtures/data_integrations_upsert_api_key_request_2.json",
"tests/Fixtures/data_integrations_upsert_client_credentials_request.json",
"tests/Fixtures/data_integrations_upsert_client_credentials_request_2.json",
"tests/Fixtures/data_integrations_vend_credentials_request.json",
"tests/Fixtures/decrypt_request.json",
"tests/Fixtures/decrypt_response.json",
Expand Down Expand Up @@ -1167,6 +1184,7 @@
"tests/Fixtures/organization_api_key_with_value.json",
"tests/Fixtures/organization_api_key_with_value_owner.json",
"tests/Fixtures/organization_authorized_connect_application_list_data.json",
"tests/Fixtures/organization_connected_account.json",
"tests/Fixtures/organization_created.json",
"tests/Fixtures/organization_created_data.json",
"tests/Fixtures/organization_created_data_domain.json",
Expand Down Expand Up @@ -1248,6 +1266,8 @@
"tests/Fixtures/radar_standalone_response.json",
"tests/Fixtures/radar_standalone_update_radar_attempt_request.json",
"tests/Fixtures/radar_standalone_update_radar_list_request.json",
"tests/Fixtures/reauthorize_data_integrations_upsert_api_key_request.json",
"tests/Fixtures/reauthorize_data_integrations_upsert_client_credentials_request.json",
"tests/Fixtures/redirect_uri.json",
"tests/Fixtures/redirect_uri_input.json",
"tests/Fixtures/refresh_token_session_authenticate_request.json",
Expand Down Expand Up @@ -2447,6 +2467,14 @@
"GET /audit_logs/exports/{auditLogExportId}": {
"sdkMethod": "getExport",
"service": "auditLogs"
},
"POST /data-integrations/{slug}/api-key": {
"sdkMethod": "createDataIntegrationApiKey",
"service": "pipes"
},
"POST /data-integrations/{slug}/client-credentials": {
"sdkMethod": "createDataIntegrationClientCredential",
"service": "pipes"
}
}
}
55 changes: 55 additions & 0 deletions lib/Resource/CreateConnectedAccount.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;

readonly class CreateConnectedAccount implements \JsonSerializable
{
use JsonSerializableTrait;

public function __construct(
/** The OAuth access token for the connected account. */
public ?string $accessToken = null,
/** The OAuth refresh token for the connected account. */
public ?string $refreshToken = null,
/** The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire. */
public ?\DateTimeImmutable $expiresAt = null,
/**
* The OAuth scopes granted for this connection.
* @var array<string>|null
*/
public ?array $scopes = null,
/** Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided. */
public ?PipeConnectedAccountState $state = null,
/** Set to `add` to create another connected account. Omit this field for permanent compatibility behavior. Creating an additional connection is not yet available: until it is, `add` succeeds only when the owner has no connection for this integration, which creates the compatibility connection, and otherwise returns 404 `multiple_connections_unavailable`. */
public ?string $connectionIntent = null,
) {
}

public static function fromArray(array $data): self
{
return new self(
accessToken: $data['access_token'] ?? null,
refreshToken: $data['refresh_token'] ?? null,
expiresAt: isset($data['expires_at']) ? new \DateTimeImmutable($data['expires_at']) : null,
scopes: $data['scopes'] ?? null,
state: isset($data['state']) ? PipeConnectedAccountState::from($data['state']) : null,
connectionIntent: $data['connection_intent'] ?? null,
);
}

public function toArray(): array
{
return [
'access_token' => $this->accessToken,
'refresh_token' => $this->refreshToken,
'expires_at' => $this->expiresAt?->format(\DateTimeInterface::RFC3339_EXTENDED),
'scopes' => $this->scopes,
'state' => $this->state?->value,
'connection_intent' => $this->connectionIntent,
];
}
}
59 changes: 59 additions & 0 deletions lib/Resource/CreateOrganizationConnectedAccount.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

declare(strict_types=1);

// This file is auto-generated by oagen. Do not edit.

namespace WorkOS\Resource;

readonly class CreateOrganizationConnectedAccount implements \JsonSerializable
{
use JsonSerializableTrait;

public function __construct(
/** The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization. */
public string $userId,
/** The OAuth access token for the connected account. */
public ?string $accessToken = null,
/** The OAuth refresh token for the connected account. */
public ?string $refreshToken = null,
/** The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire. */
public ?\DateTimeImmutable $expiresAt = null,
/**
* The OAuth scopes granted for this connection.
* @var array<string>|null
*/
public ?array $scopes = null,
/** Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided. */
public ?PipeConnectedAccountState $state = null,
/** Set to `add` to create another connected account. Omit this field for permanent compatibility behavior. Creating an additional connection is not yet available: until it is, `add` succeeds only when the owner has no connection for this integration, which creates the compatibility connection, and otherwise returns 404 `multiple_connections_unavailable`. */
public ?string $connectionIntent = null,
) {
}

public static function fromArray(array $data): self
{
return new self(
userId: $data['user_id'],
accessToken: $data['access_token'] ?? null,
refreshToken: $data['refresh_token'] ?? null,
expiresAt: isset($data['expires_at']) ? new \DateTimeImmutable($data['expires_at']) : null,
scopes: $data['scopes'] ?? null,
state: isset($data['state']) ? PipeConnectedAccountState::from($data['state']) : null,
connectionIntent: $data['connection_intent'] ?? null,
);
}

public function toArray(): array
{
return [
'user_id' => $this->userId,
'access_token' => $this->accessToken,
'refresh_token' => $this->refreshToken,
'expires_at' => $this->expiresAt?->format(\DateTimeInterface::RFC3339_EXTENDED),
'scopes' => $this->scopes,
'state' => $this->state?->value,
'connection_intent' => $this->connectionIntent,
];
}
}
4 changes: 2 additions & 2 deletions lib/Resource/DataIntegrationCredentialsResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function __construct(
/** Indicates credentials are available. */
public ?bool $active = null,
/** The credential object containing the vended secret. */
public ?DataIntegrationCredentialsResponseCredential $credential = null,
public ?DataIntegrationVendedCredential $credential = null,
/**
* The reason credentials are unavailable. Additional values may be added in the future; handle unknown values gracefully.
* - `"not_installed"`: The user does not have the integration installed.
Expand All @@ -28,7 +28,7 @@ public static function fromArray(array $data): self
{
return new self(
active: $data['active'] ?? null,
credential: isset($data['credential']) ? DataIntegrationCredentialsResponseCredential::fromArray($data['credential']) : null,
credential: isset($data['credential']) ? DataIntegrationVendedCredential::fromArray($data['credential']) : null,
error: isset($data['error']) ? DataIntegrationAccessTokenResponseError::from($data['error']) : null,
);
}
Expand Down
72 changes: 72 additions & 0 deletions lib/Resource/DataIntegrationVendedCredential.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

declare(strict_types=1);

// This file is auto-generated by oagen. Do not edit.

namespace WorkOS\Resource;

readonly class DataIntegrationVendedCredential implements \JsonSerializable
{
use JsonSerializableTrait;

public function __construct(
/** Distinguishes the credential object. */
public ?string $object = null,
/** The authentication method for this credential. Additional values may be added in the future; handle unknown values gracefully. */
public ?string $authMethod = null,
/** The vended secret. An OAuth access token when `auth_method` is `oauth`, the API key when `api_key`, or the client-credentials access token when `client_credentials`. */
public ?string $value = null,
/** The ISO-8601 formatted timestamp indicating when the credential expires, or `null` if it does not expire. Present for `oauth` and `client_credentials` credentials; absent for `api_key`. */
public ?string $expiresAt = null,
/**
* The scopes granted to the access token. Present for `oauth` and `client_credentials` credentials; absent for `api_key`.
* @var array<string>|null
*/
public ?array $scopes = null,
/**
* If the integration has requested scopes that aren't present on the access token, they're listed here. Present for `oauth` and `client_credentials` credentials; absent for `api_key`.
* @var array<string>|null
*/
public ?array $missingScopes = null,
/**
* Provider-declared, non-secret config from the installation snapshot, with current defaults for unset fields. Includes both integration- and installation-scope fields; omits undeclared fields and fields marked secret. Use these values to address a per-tenant host, such as Snowflake's `account` or Zendesk's `subdomain`. Empty when no values are disclosable. Changes to integration or organization pins require reconnecting or explicitly rebinding the connection. Defaults are live and can differ from a cached token's audience until refresh or re-mint.
* @var array<string, string>|null
*/
public ?array $config = null,
/**
* Non-sensitive fields captured from the provider token response (e.g. Salesforce `instance_url`), as configured for the provider. Only present for `client_credentials` credentials.
* @var array<string, mixed>|null
*/
public ?array $metadata = null,
) {
}

public static function fromArray(array $data): self
{
return new self(
object: $data['object'] ?? null,
authMethod: $data['auth_method'] ?? null,
value: $data['value'] ?? null,
expiresAt: $data['expires_at'] ?? null,
scopes: $data['scopes'] ?? null,
missingScopes: $data['missing_scopes'] ?? null,
config: $data['config'] ?? null,
metadata: $data['metadata'] ?? null,
);
}

public function toArray(): array
{
return [
'object' => $this->object,
'auth_method' => $this->authMethod,
'value' => $this->value,
'expires_at' => $this->expiresAt,
'scopes' => $this->scopes,
'missing_scopes' => $this->missingScopes,
'config' => $this->config,
'metadata' => $this->metadata,
];
}
}
Loading
Loading