diff --git a/.oagen-manifest.json b/.oagen-manifest.json index d19d30e5..7c8bac81 100644 --- a/.oagen-manifest.json +++ b/.oagen-manifest.json @@ -1,7 +1,7 @@ { "version": 1, "language": "php", - "generatedAt": "2026-04-14T19:04:38.043Z", + "generatedAt": "2026-04-14T19:47:26.865Z", "files": [ "lib/Resource/ActionAuthenticationDenied.php", "lib/Resource/ActionAuthenticationDeniedData.php", diff --git a/lib/Service/AdminPortal.php b/lib/Service/AdminPortal.php index 77a07e64..ebdf4836 100644 --- a/lib/Service/AdminPortal.php +++ b/lib/Service/AdminPortal.php @@ -34,6 +34,7 @@ public function __construct( * @param \WorkOS\Resource\IntentOptions|null $intentOptions Options to configure the Admin Portal based on the intent. * @param array|null $adminEmails The email addresses of the IT admins to grant access to the Admin Portal for the given organization. Accepts up to 20 emails. * @return \WorkOS\Resource\PortalLinkResponse + * @throws \WorkOS\Exception\WorkOSException */ public function generateLink( string $organization, diff --git a/lib/Service/ApiKeys.php b/lib/Service/ApiKeys.php index 7cdc7f6e..d65fdc07 100644 --- a/lib/Service/ApiKeys.php +++ b/lib/Service/ApiKeys.php @@ -23,6 +23,7 @@ public function __construct( * Validate an API key value and return the API key object if valid. * @param string $value The value for an API key. * @return \WorkOS\Resource\ApiKeyValidationResponse + * @throws \WorkOS\Exception\WorkOSException */ public function createValidation( string $value, @@ -46,6 +47,7 @@ public function createValidation( * Permanently deletes an API key. This action cannot be undone. Once deleted, any requests using this API key will fail authentication. * @param string $id The unique ID of the API key. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function deleteApiKey( string $id, @@ -68,6 +70,7 @@ public function deleteApiKey( * @param int|null $limit Upper limit on the number of objects to return, between `1` and `100`. Defaults to 10. * @param \WorkOS\Resource\EventsOrder|null $order Order the results by the creation time. Defaults to "desc". * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\ApiKey> + * @throws \WorkOS\Exception\WorkOSException */ public function listOrganizationApiKeys( string $organizationId, @@ -100,6 +103,7 @@ public function listOrganizationApiKeys( * @param string $name The name for the API key. * @param array|null $permissions The permission slugs to assign to the API key. * @return \WorkOS\Resource\ApiKeyWithValue + * @throws \WorkOS\Exception\WorkOSException */ public function createOrganizationApiKey( string $organizationId, diff --git a/lib/Service/AuditLogs.php b/lib/Service/AuditLogs.php index adafed7f..c2265653 100644 --- a/lib/Service/AuditLogs.php +++ b/lib/Service/AuditLogs.php @@ -25,6 +25,7 @@ public function __construct( * Get the configured event retention period for the given Organization. * @param string $id Unique identifier of the Organization. * @return \WorkOS\Resource\AuditLogsRetentionJson + * @throws \WorkOS\Exception\WorkOSException */ public function getOrganizationAuditLogsRetention( string $id, @@ -45,6 +46,7 @@ public function getOrganizationAuditLogsRetention( * @param string $id Unique identifier of the Organization. * @param int $retentionPeriodInDays The number of days Audit Log events will be retained. Valid values are `30` and `365`. * @return \WorkOS\Resource\AuditLogsRetentionJson + * @throws \WorkOS\Exception\WorkOSException */ public function updateOrganizationAuditLogsRetention( string $id, @@ -72,6 +74,7 @@ public function updateOrganizationAuditLogsRetention( * @param int|null $limit Upper limit on the number of objects to return, between `1` and `100`. Defaults to 10. * @param \WorkOS\Resource\EventsOrder|null $order Order the results by the creation time. Defaults to "desc". * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\AuditLogActionJson> + * @throws \WorkOS\Exception\WorkOSException */ public function listActions( ?string $before = null, @@ -105,6 +108,7 @@ public function listActions( * @param int|null $limit Upper limit on the number of objects to return, between `1` and `100`. Defaults to 10. * @param \WorkOS\Resource\EventsOrder|null $order Order the results by the creation time. Defaults to "desc". * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\AuditLogSchemaJson> + * @throws \WorkOS\Exception\WorkOSException */ public function listActionSchemas( string $actionName, @@ -138,6 +142,7 @@ public function listActionSchemas( * @param array<\WorkOS\Resource\AuditLogSchemaTarget> $targets The list of targets for the schema. * @param array|null $metadata Optional JSON schema for event metadata. * @return \WorkOS\Resource\AuditLogSchemaJson + * @throws \WorkOS\Exception\WorkOSException */ public function createSchema( string $actionName, @@ -173,6 +178,7 @@ public function createSchema( * @param string $organizationId The unique ID of the Organization. * @param \WorkOS\Resource\AuditLogEvent $event The audit log event to create. * @return \WorkOS\Resource\AuditLogEventCreateResponse + * @throws \WorkOS\Exception\WorkOSException */ public function createEvent( string $organizationId, @@ -205,6 +211,7 @@ public function createEvent( * @param array|null $actorIds List of actor IDs to filter against. * @param array|null $targets List of target types to filter against. * @return \WorkOS\Resource\AuditLogExportJson + * @throws \WorkOS\Exception\WorkOSException */ public function createExport( string $organizationId, @@ -242,6 +249,7 @@ public function createExport( * Get an Audit Log Export. The URL will expire after 10 minutes. If the export is needed again at a later time, refetching the export will regenerate the URL. * @param string $auditLogExportId The unique ID of the Audit Log Export. * @return \WorkOS\Resource\AuditLogExportJson + * @throws \WorkOS\Exception\WorkOSException */ public function getExport( string $auditLogExportId, diff --git a/lib/Service/Authorization.php b/lib/Service/Authorization.php index 66f1dfee..ecc201d5 100644 --- a/lib/Service/Authorization.php +++ b/lib/Service/Authorization.php @@ -32,6 +32,7 @@ public function __construct( * @param string|null $resourceExternalId The external ID of the resource. * @param string|null $resourceTypeSlug The slug of the resource type. * @return \WorkOS\Resource\AuthorizationCheck + * @throws \WorkOS\Exception\WorkOSException */ public function check( string $organizationMembershipId, @@ -72,6 +73,7 @@ public function check( * @param string|null $parentResourceTypeSlug The slug of the parent resource type. Must be provided together with `parent_resource_external_id`. * @param string|null $parentResourceExternalId The application-specific external identifier of the parent resource. Must be provided together with `parent_resource_type_slug`. * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\AuthorizationResource> + * @throws \WorkOS\Exception\WorkOSException */ public function listOrganizationMembershipResources( string $organizationMembershipId, @@ -114,6 +116,7 @@ public function listOrganizationMembershipResources( * @param int|null $limit Upper limit on the number of objects to return, between `1` and `100`. Defaults to 10. * @param \WorkOS\Resource\EventsOrder|null $order Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. Defaults to "desc". * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\RoleAssignment> + * @throws \WorkOS\Exception\WorkOSException */ public function listOrganizationMembershipRoleAssignments( string $organizationMembershipId, @@ -148,6 +151,7 @@ public function listOrganizationMembershipRoleAssignments( * @param string|null $resourceExternalId The external ID of the resource. Requires `resource_type_slug`. * @param string|null $resourceTypeSlug The resource type slug. Required with `resource_external_id`. * @return \WorkOS\Resource\RoleAssignment + * @throws \WorkOS\Exception\WorkOSException */ public function assignRole( string $organizationMembershipId, @@ -182,6 +186,7 @@ public function assignRole( * @param string|null $resourceExternalId The external ID of the resource. Requires `resource_type_slug`. * @param string|null $resourceTypeSlug The resource type slug. Required with `resource_external_id`. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function removeRole( string $organizationMembershipId, @@ -212,6 +217,7 @@ public function removeRole( * @param string $organizationMembershipId The ID of the organization membership. * @param string $roleAssignmentId The ID of the role assignment to remove. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function deleteOrganizationMembershipRoleAssignment( string $organizationMembershipId, @@ -231,6 +237,7 @@ public function deleteOrganizationMembershipRoleAssignment( * Get a list of all roles that apply to an organization. This includes both environment roles and organization-specific roles, returned in priority order. * @param string $organizationId The ID of the organization. * @return \WorkOS\Resource\RoleList + * @throws \WorkOS\Exception\WorkOSException */ public function listOrganizationRoles( string $organizationId, @@ -254,6 +261,7 @@ public function listOrganizationRoles( * @param string|null $description An optional description of the role's purpose. * @param string|null $resourceTypeSlug The slug of the resource type the role is scoped to. * @return \WorkOS\Resource\Role + * @throws \WorkOS\Exception\WorkOSException */ public function createOrganizationRole( string $organizationId, @@ -285,6 +293,7 @@ public function createOrganizationRole( * @param string $organizationId The ID of the organization. * @param string $slug The slug of the role. * @return \WorkOS\Resource\Role + * @throws \WorkOS\Exception\WorkOSException */ public function getOrganizationRole( string $organizationId, @@ -308,6 +317,7 @@ public function getOrganizationRole( * @param string|null $name A descriptive name for the role. * @param string|null $description An optional description of the role's purpose. * @return \WorkOS\Resource\Role + * @throws \WorkOS\Exception\WorkOSException */ public function updateOrganizationRole( string $organizationId, @@ -336,6 +346,7 @@ public function updateOrganizationRole( * @param string $organizationId The ID of the organization. * @param string $slug The slug of the role. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function deleteOrganizationRole( string $organizationId, @@ -357,6 +368,7 @@ public function deleteOrganizationRole( * @param string $slug The slug of the role. * @param string $bodySlug The slug of the permission to add to the role. * @return \WorkOS\Resource\Role + * @throws \WorkOS\Exception\WorkOSException */ public function createRolePermission( string $organizationId, @@ -384,6 +396,7 @@ public function createRolePermission( * @param string $slug The slug of the role. * @param array $permissions The permission slugs to assign to the role. * @return \WorkOS\Resource\Role + * @throws \WorkOS\Exception\WorkOSException */ public function updateRolePermissions( string $organizationId, @@ -411,6 +424,7 @@ public function updateRolePermissions( * @param string $slug The slug of the role. * @param string $permissionSlug The slug of the permission to remove. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function deleteRolePermission( string $organizationId, @@ -433,6 +447,7 @@ public function deleteRolePermission( * @param string $resourceTypeSlug The slug of the resource type. * @param string $externalId An identifier you provide to reference the resource in your system. * @return \WorkOS\Resource\AuthorizationResource + * @throws \WorkOS\Exception\WorkOSException */ public function getOrganizationResource( string $organizationId, @@ -461,6 +476,7 @@ public function getOrganizationResource( * @param string|null $parentResourceExternalId The external ID of the parent resource. * @param string|null $parentResourceTypeSlug The resource type slug of the parent resource. * @return \WorkOS\Resource\AuthorizationResource + * @throws \WorkOS\Exception\WorkOSException */ public function updateOrganizationResource( string $organizationId, @@ -498,6 +514,7 @@ public function updateOrganizationResource( * @param string $externalId An identifier you provide to reference the resource in your system. * @param bool|null $cascadeDelete If true, deletes all descendant resources and role assignments. If not set and the resource has children or assignments, the request will fail. Defaults to false. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function deleteOrganizationResource( string $organizationId, @@ -531,6 +548,7 @@ public function deleteOrganizationResource( * @param string $permissionSlug The permission slug to filter by. Only users with this permission on the resource are returned. * @param \WorkOS\Resource\AuthorizationAssignment|null $assignment Filter by assignment type. Use "direct" for direct assignments only, or "indirect" to include inherited assignments. * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\UserOrganizationMembershipBaseListData> + * @throws \WorkOS\Exception\WorkOSException */ public function listResourceOrganizationMemberships( string $organizationId, @@ -576,6 +594,7 @@ public function listResourceOrganizationMemberships( * @param string|null $parentExternalId Filter resources by parent external ID. * @param string|null $search Search resources by name. * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\AuthorizationResource> + * @throws \WorkOS\Exception\WorkOSException */ public function listResources( ?string $before = null, @@ -624,6 +643,7 @@ public function listResources( * @param string|null $parentResourceExternalId The external ID of the parent resource. * @param string|null $parentResourceTypeSlug The resource type slug of the parent resource. * @return \WorkOS\Resource\AuthorizationResource + * @throws \WorkOS\Exception\WorkOSException */ public function createResource( string $externalId, @@ -661,6 +681,7 @@ public function createResource( * Retrieve the details of an authorization resource by its ID. * @param string $resourceId The ID of the authorization resource. * @return \WorkOS\Resource\AuthorizationResource + * @throws \WorkOS\Exception\WorkOSException */ public function getResource( string $resourceId, @@ -685,6 +706,7 @@ public function getResource( * @param string|null $parentResourceExternalId The external ID of the parent resource. * @param string|null $parentResourceTypeSlug The resource type slug of the parent resource. * @return \WorkOS\Resource\AuthorizationResource + * @throws \WorkOS\Exception\WorkOSException */ public function updateResource( string $resourceId, @@ -718,6 +740,7 @@ public function updateResource( * @param string $resourceId The ID of the authorization resource. * @param bool|null $cascadeDelete If true, deletes all descendant resources and role assignments. If not set and the resource has children or assignments, the request will fail. Defaults to false. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function deleteResource( string $resourceId, @@ -747,6 +770,7 @@ public function deleteResource( * @param string $permissionSlug The permission slug to filter by. Only users with this permission on the resource are returned. * @param \WorkOS\Resource\AuthorizationAssignment|null $assignment Filter by assignment type. Use `direct` for direct assignments only, or `indirect` to include inherited assignments. * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\UserOrganizationMembershipBaseListData> + * @throws \WorkOS\Exception\WorkOSException */ public function listMembershipsForResource( string $resourceId, @@ -780,6 +804,7 @@ public function listMembershipsForResource( * * List all environment roles in priority order. * @return \WorkOS\Resource\RoleList + * @throws \WorkOS\Exception\WorkOSException */ public function listEnvironmentRoles( ?\WorkOS\RequestOptions $options = null, @@ -801,6 +826,7 @@ public function listEnvironmentRoles( * @param string|null $description An optional description of the role. * @param string|null $resourceTypeSlug The slug of the resource type the role is scoped to. * @return \WorkOS\Resource\Role + * @throws \WorkOS\Exception\WorkOSException */ public function createEnvironmentRole( string $slug, @@ -830,6 +856,7 @@ public function createEnvironmentRole( * Get an environment role by its slug. * @param string $slug The slug of the environment role. * @return \WorkOS\Resource\Role + * @throws \WorkOS\Exception\WorkOSException */ public function getEnvironmentRole( string $slug, @@ -851,6 +878,7 @@ public function getEnvironmentRole( * @param string|null $name A descriptive name for the role. * @param string|null $description An optional description of the role. * @return \WorkOS\Resource\Role + * @throws \WorkOS\Exception\WorkOSException */ public function updateEnvironmentRole( string $slug, @@ -878,6 +906,7 @@ public function updateEnvironmentRole( * @param string $slug The slug of the environment role. * @param string $bodySlug The slug of the permission to add to the role. * @return \WorkOS\Resource\Role + * @throws \WorkOS\Exception\WorkOSException */ public function addEnvironmentRolePermission( string $slug, @@ -903,6 +932,7 @@ public function addEnvironmentRolePermission( * @param string $slug The slug of the environment role. * @param array $permissions The permission slugs to assign to the role. * @return \WorkOS\Resource\Role + * @throws \WorkOS\Exception\WorkOSException */ public function setEnvironmentRolePermissions( string $slug, @@ -930,6 +960,7 @@ public function setEnvironmentRolePermissions( * @param int|null $limit Upper limit on the number of objects to return, between `1` and `100`. Defaults to 10. * @param \WorkOS\Resource\EventsOrder|null $order Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. Defaults to "desc". * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\AuthorizationPermission> + * @throws \WorkOS\Exception\WorkOSException */ public function listPermissions( ?string $before = null, @@ -962,6 +993,7 @@ public function listPermissions( * @param string|null $description An optional description of the Permission. * @param string|null $resourceTypeSlug The slug of the resource type this permission is scoped to. * @return \WorkOS\Resource\Permission + * @throws \WorkOS\Exception\WorkOSException */ public function createPermission( string $slug, @@ -991,6 +1023,7 @@ public function createPermission( * Retrieve a permission by its unique slug. * @param string $slug A unique key to reference the permission. Must be lowercase and contain only letters, numbers, hyphens, underscores, colons, periods, and asterisks. * @return \WorkOS\Resource\AuthorizationPermission + * @throws \WorkOS\Exception\WorkOSException */ public function getPermission( string $slug, @@ -1012,6 +1045,7 @@ public function getPermission( * @param string|null $name A descriptive name for the Permission. * @param string|null $description An optional description of the Permission. * @return \WorkOS\Resource\AuthorizationPermission + * @throws \WorkOS\Exception\WorkOSException */ public function updatePermission( string $slug, @@ -1038,6 +1072,7 @@ public function updatePermission( * Delete an existing permission. System permissions cannot be deleted. * @param string $slug A unique key to reference the permission. Must be lowercase and contain only letters, numbers, hyphens, underscores, colons, periods, and asterisks. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function deletePermission( string $slug, diff --git a/lib/Service/Connect.php b/lib/Service/Connect.php index f873fa79..9a3e6f1c 100644 --- a/lib/Service/Connect.php +++ b/lib/Service/Connect.php @@ -35,6 +35,7 @@ public function __construct( * @param \WorkOS\Resource\UserObject $user The user to create or update in AuthKit. * @param array<\WorkOS\Resource\UserConsentOption>|null $userConsentOptions Array of [User Consent Options](https://workos.com/docs/reference/workos-connect/standalone/user-consent-options) to store with the session. * @return \WorkOS\Resource\ExternalAuthCompleteResponse + * @throws \WorkOS\Exception\WorkOSException */ public function completeOAuth2( string $externalAuthId, @@ -66,6 +67,7 @@ public function completeOAuth2( * @param \WorkOS\Resource\EventsOrder|null $order Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. Defaults to "desc". * @param string|null $organizationId Filter Connect Applications by organization ID. * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\ConnectApplication> + * @throws \WorkOS\Exception\WorkOSException */ public function listApplications( ?string $before = null, @@ -100,6 +102,7 @@ public function listApplications( * @param bool|null $usesPkce * @param string|null $organizationId * @return \WorkOS\Resource\ConnectApplication + * @throws \WorkOS\Exception\WorkOSException */ public function createOAuthApplication( string $name, @@ -137,6 +140,7 @@ public function createOAuthApplication( * @param string|null $description * @param array|null $scopes * @return \WorkOS\Resource\ConnectApplication + * @throws \WorkOS\Exception\WorkOSException */ public function createM2MApplication( string $name, @@ -168,6 +172,7 @@ public function createM2MApplication( * Retrieve details for a specific Connect Application by ID or client ID. * @param string $id The application ID or client ID of the Connect Application. * @return \WorkOS\Resource\ConnectApplication + * @throws \WorkOS\Exception\WorkOSException */ public function getApplication( string $id, @@ -191,6 +196,7 @@ public function getApplication( * @param array|null $scopes The OAuth scopes granted to the application. * @param array<\WorkOS\Resource\RedirectUriInput>|null $redirectUris Updated redirect URIs for the application. OAuth applications only. * @return \WorkOS\Resource\ConnectApplication + * @throws \WorkOS\Exception\WorkOSException */ public function updateApplication( string $id, @@ -221,6 +227,7 @@ public function updateApplication( * Delete an existing Connect Application. * @param string $id The application ID or client ID of the Connect Application. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function deleteApplication( string $id, @@ -239,6 +246,7 @@ public function deleteApplication( * List all client secrets associated with a Connect Application. * @param string $id The application ID or client ID of the Connect Application. * @return array + * @throws \WorkOS\Exception\WorkOSException */ public function listApplicationClientSecrets( string $id, @@ -258,6 +266,7 @@ public function listApplicationClientSecrets( * Create new secrets for a Connect Application. * @param string $id The application ID or client ID of the Connect Application. * @return \WorkOS\Resource\NewConnectApplicationSecret + * @throws \WorkOS\Exception\WorkOSException */ public function createApplicationClientSecret( string $id, @@ -280,6 +289,7 @@ public function createApplicationClientSecret( * Delete (revoke) an existing client secret. * @param string $id The unique ID of the client secret. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function deleteClientSecret( string $id, diff --git a/lib/Service/DirectorySync.php b/lib/Service/DirectorySync.php index feb1206f..19eb77cf 100644 --- a/lib/Service/DirectorySync.php +++ b/lib/Service/DirectorySync.php @@ -29,6 +29,7 @@ public function __construct( * @param string|null $search Searchable text to match against Directory names. * @param string|null $domain (deprecated) Filter Directories by their associated domain. * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\Directory> + * @throws \WorkOS\Exception\WorkOSException */ public function listDirectories( ?string $before = null, @@ -64,6 +65,7 @@ public function listDirectories( * Get the details of an existing directory. * @param string $id Unique identifier for the Directory. * @return \WorkOS\Resource\Directory + * @throws \WorkOS\Exception\WorkOSException */ public function getDirectory( string $id, @@ -83,6 +85,7 @@ public function getDirectory( * Permanently deletes an existing directory. It cannot be undone. * @param string $id Unique identifier for the Directory. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function deleteDirectory( string $id, @@ -106,6 +109,7 @@ public function deleteDirectory( * @param string|null $directory Unique identifier of the WorkOS Directory. This value can be obtained from the WorkOS dashboard or from the WorkOS API. * @param string|null $user Unique identifier of the WorkOS Directory User. This value can be obtained from the WorkOS API. * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\DirectoryGroup> + * @throws \WorkOS\Exception\WorkOSException */ public function listGroups( ?string $before = null, @@ -139,6 +143,7 @@ public function listGroups( * Get the details of an existing Directory Group. * @param string $id Unique identifier for the Directory Group. * @return \WorkOS\Resource\DirectoryGroup + * @throws \WorkOS\Exception\WorkOSException */ public function getGroup( string $id, @@ -163,6 +168,7 @@ public function getGroup( * @param string|null $directory Unique identifier of the WorkOS Directory. This value can be obtained from the WorkOS dashboard or from the WorkOS API. * @param string|null $group Unique identifier of the WorkOS Directory Group. This value can be obtained from the WorkOS API. * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\DirectoryUserWithGroups> + * @throws \WorkOS\Exception\WorkOSException */ public function listUsers( ?string $before = null, @@ -196,6 +202,7 @@ public function listUsers( * Get the details of an existing Directory User. * @param string $id Unique identifier for the Directory User. * @return \WorkOS\Resource\DirectoryUserWithGroups + * @throws \WorkOS\Exception\WorkOSException */ public function getUser( string $id, diff --git a/lib/Service/Events.php b/lib/Service/Events.php index 4558b7d9..ac91ca4c 100644 --- a/lib/Service/Events.php +++ b/lib/Service/Events.php @@ -28,6 +28,7 @@ public function __construct( * @param string|null $rangeEnd ISO-8601 date string to filter events created before this date. * @param string|null $organizationId Filter events by the [Organization](https://workos.com/docs/reference/organization) that the event is associated with. * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\EventSchema> + * @throws \WorkOS\Exception\WorkOSException */ public function listEvents( ?string $before = null, diff --git a/lib/Service/FeatureFlags.php b/lib/Service/FeatureFlags.php index 353acd0d..f400ee46 100644 --- a/lib/Service/FeatureFlags.php +++ b/lib/Service/FeatureFlags.php @@ -25,6 +25,7 @@ public function __construct( * @param int|null $limit Upper limit on the number of objects to return, between `1` and `100`. Defaults to 10. * @param \WorkOS\Resource\EventsOrder|null $order Order the results by the creation time. Defaults to "desc". * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\Flag> + * @throws \WorkOS\Exception\WorkOSException */ public function listFeatureFlags( ?string $before = null, @@ -54,6 +55,7 @@ public function listFeatureFlags( * Get the details of an existing feature flag by its slug. * @param string $slug A unique key to reference the Feature Flag. * @return \WorkOS\Resource\Flag + * @throws \WorkOS\Exception\WorkOSException */ public function getFeatureFlag( string $slug, @@ -73,6 +75,7 @@ public function getFeatureFlag( * Disables a feature flag in the current environment. * @param string $slug A unique key to reference the Feature Flag. * @return \WorkOS\Resource\FeatureFlag + * @throws \WorkOS\Exception\WorkOSException */ public function disableFeatureFlag( string $slug, @@ -92,6 +95,7 @@ public function disableFeatureFlag( * Enables a feature flag in the current environment. * @param string $slug A unique key to reference the Feature Flag. * @return \WorkOS\Resource\FeatureFlag + * @throws \WorkOS\Exception\WorkOSException */ public function enableFeatureFlag( string $slug, @@ -112,6 +116,7 @@ public function enableFeatureFlag( * @param string $resourceId The resource ID in format "user_" or "org_". * @param string $slug The unique slug identifier of the feature flag. * @return mixed + * @throws \WorkOS\Exception\WorkOSException */ public function addFlagTarget( string $resourceId, @@ -133,6 +138,7 @@ public function addFlagTarget( * @param string $resourceId The resource ID in format "user_" or "org_". * @param string $slug The unique slug identifier of the feature flag. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function removeFlagTarget( string $resourceId, @@ -156,6 +162,7 @@ public function removeFlagTarget( * @param int|null $limit Upper limit on the number of objects to return, between `1` and `100`. Defaults to 10. * @param \WorkOS\Resource\EventsOrder|null $order Order the results by the creation time. Defaults to "desc". * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\Flag> + * @throws \WorkOS\Exception\WorkOSException */ public function listOrganizationFeatureFlags( string $organizationId, @@ -190,6 +197,7 @@ public function listOrganizationFeatureFlags( * @param int|null $limit Upper limit on the number of objects to return, between `1` and `100`. Defaults to 10. * @param \WorkOS\Resource\EventsOrder|null $order Order the results by the creation time. Defaults to "desc". * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\Flag> + * @throws \WorkOS\Exception\WorkOSException */ public function listUserFeatureFlags( string $userId, diff --git a/lib/Service/MultiFactorAuth.php b/lib/Service/MultiFactorAuth.php index 93a6aec9..91466790 100644 --- a/lib/Service/MultiFactorAuth.php +++ b/lib/Service/MultiFactorAuth.php @@ -26,6 +26,7 @@ public function __construct( * @param string $id The unique ID of the Authentication Challenge. * @param string $code The one-time code to verify. * @return \WorkOS\Resource\AuthenticationChallengeVerifyResponse + * @throws \WorkOS\Exception\WorkOSException */ public function verifyChallenge( string $id, @@ -54,6 +55,7 @@ public function verifyChallenge( * @param string|null $totpUser Required when type is 'totp'. * @param string|null $userId The ID of the user to associate the factor with. * @return \WorkOS\Resource\AuthenticationFactorEnrolled + * @throws \WorkOS\Exception\WorkOSException */ public function enrollFactor( \WorkOS\Resource\AuthenticationFactorsCreateRequestType $type, @@ -85,6 +87,7 @@ public function enrollFactor( * Gets an Authentication Factor. * @param string $id The unique ID of the Factor. * @return \WorkOS\Resource\AuthenticationFactor + * @throws \WorkOS\Exception\WorkOSException */ public function getFactor( string $id, @@ -104,6 +107,7 @@ public function getFactor( * Permanently deletes an Authentication Factor. It cannot be undone. * @param string $id The unique ID of the Factor. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function deleteFactor( string $id, @@ -123,6 +127,7 @@ public function deleteFactor( * @param string $id The unique ID of the Authentication Factor to be challenged. * @param string|null $smsTemplate A custom template for the SMS message. Use the {{code}} placeholder to include the verification code. * @return \WorkOS\Resource\AuthenticationChallenge + * @throws \WorkOS\Exception\WorkOSException */ public function challengeFactor( string $id, @@ -151,6 +156,7 @@ public function challengeFactor( * @param int|null $limit Upper limit on the number of objects to return, between `1` and `100`. Defaults to 10. * @param \WorkOS\Resource\EventsOrder|null $order Order the results by the creation time. Defaults to "desc". * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\AuthenticationFactor> + * @throws \WorkOS\Exception\WorkOSException */ public function listUserAuthFactors( string $userlandUserId, @@ -185,6 +191,7 @@ public function listUserAuthFactors( * @param string|null $totpUser The user's account name displayed in their authenticator app. * @param string|null $totpSecret The Base32-encoded shared secret for TOTP factors. This can be provided when creating the auth factor, otherwise it will be generated. The algorithm used to derive TOTP codes is SHA-1, the code length is 6 digits, and the timestep is 30 seconds – the secret must be compatible with these parameters. * @return \WorkOS\Resource\UserAuthenticationFactorEnrollResponse + * @throws \WorkOS\Exception\WorkOSException */ public function createUserAuthFactor( string $userlandUserId, diff --git a/lib/Service/OrganizationDomains.php b/lib/Service/OrganizationDomains.php index 29ccb264..f1bc1b88 100644 --- a/lib/Service/OrganizationDomains.php +++ b/lib/Service/OrganizationDomains.php @@ -23,6 +23,7 @@ public function __construct( * @param string $domain The domain to add to the organization. * @param string $organizationId The ID of the organization to add the domain to. * @return \WorkOS\Resource\OrganizationDomain + * @throws \WorkOS\Exception\WorkOSException */ public function createOrganizationDomain( string $domain, @@ -48,6 +49,7 @@ public function createOrganizationDomain( * Get the details of an existing organization domain. * @param string $id Unique identifier of the organization domain. * @return \WorkOS\Resource\OrganizationDomainStandAlone + * @throws \WorkOS\Exception\WorkOSException */ public function getOrganizationDomain( string $id, @@ -67,6 +69,7 @@ public function getOrganizationDomain( * Permanently deletes an organization domain. It cannot be undone. * @param string $id Unique identifier of the organization domain. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function deleteOrganizationDomain( string $id, @@ -85,6 +88,7 @@ public function deleteOrganizationDomain( * Initiates verification process for an Organization Domain. * @param string $id Unique identifier of the organization domain. * @return \WorkOS\Resource\OrganizationDomainStandAlone + * @throws \WorkOS\Exception\WorkOSException */ public function verifyOrganizationDomain( string $id, diff --git a/lib/Service/Organizations.php b/lib/Service/Organizations.php index 58257d82..177b0f43 100644 --- a/lib/Service/Organizations.php +++ b/lib/Service/Organizations.php @@ -27,6 +27,7 @@ public function __construct( * @param array|null $domains The domains of an Organization. Any Organization with a matching domain will be returned. * @param string|null $search Searchable text for an Organization. Matches against the organization name. * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\Organization> + * @throws \WorkOS\Exception\WorkOSException */ public function listOrganizations( ?string $before = null, @@ -65,6 +66,7 @@ public function listOrganizations( * @param array|null $metadata Object containing [metadata](https://workos.com/docs/authkit/metadata) key/value pairs associated with the Organization. * @param string|null $externalId An external identifier for the Organization. * @return \WorkOS\Resource\Organization + * @throws \WorkOS\Exception\WorkOSException */ public function createOrganization( string $name, @@ -98,6 +100,7 @@ public function createOrganization( * Get the details of an existing organization by an [external identifier](https://workos.com/docs/authkit/metadata/external-identifiers). * @param string $externalId The external ID of the Organization. * @return \WorkOS\Resource\Organization + * @throws \WorkOS\Exception\WorkOSException */ public function getOrganizationByExternalId( string $externalId, @@ -117,6 +120,7 @@ public function getOrganizationByExternalId( * Get the details of an existing organization. * @param string $id Unique identifier of the Organization. * @return \WorkOS\Resource\Organization + * @throws \WorkOS\Exception\WorkOSException */ public function getOrganization( string $id, @@ -143,6 +147,7 @@ public function getOrganization( * @param array|null $metadata Object containing [metadata](https://workos.com/docs/authkit/metadata) key/value pairs associated with the Organization. * @param string|null $externalId An external identifier for the Organization. * @return \WorkOS\Resource\Organization + * @throws \WorkOS\Exception\WorkOSException */ public function updateOrganization( string $id, @@ -179,6 +184,7 @@ public function updateOrganization( * Permanently deletes an organization in the current environment. It cannot be undone. * @param string $id Unique identifier of the Organization. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function deleteOrganization( string $id, @@ -197,6 +203,7 @@ public function deleteOrganization( * Get the unified view of audit log trail and stream configuration for an organization. * @param string $id Unique identifier of the Organization. * @return \WorkOS\Resource\AuditLogConfiguration + * @throws \WorkOS\Exception\WorkOSException */ public function getAuditLogConfiguration( string $id, diff --git a/lib/Service/Pipes.php b/lib/Service/Pipes.php index 2fb39450..7ef9e7d5 100644 --- a/lib/Service/Pipes.php +++ b/lib/Service/Pipes.php @@ -27,6 +27,7 @@ public function __construct( * @param string|null $organizationId An organization ID to scope the authorization to a specific organization. * @param string|null $returnTo The URL to redirect the user to after authorization. * @return \WorkOS\Resource\DataIntegrationAuthorizeUrlResponse + * @throws \WorkOS\Exception\WorkOSException */ public function authorizeDataIntegration( string $slug, @@ -57,6 +58,7 @@ public function authorizeDataIntegration( * @param string $userId A [User](https://workos.com/docs/reference/authkit/user) identifier. * @param string|null $organizationId An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. * @return \WorkOS\Resource\DataIntegrationAccessTokenResponse + * @throws \WorkOS\Exception\WorkOSException */ public function createDataIntegrationToken( string $slug, @@ -85,6 +87,7 @@ public function createDataIntegrationToken( * @param string $slug The slug identifier of the provider (e.g., `github`, `slack`, `notion`). * @param string|null $organizationId An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization. * @return \WorkOS\Resource\ConnectedAccount + * @throws \WorkOS\Exception\WorkOSException */ public function getUserConnectedAccount( string $userId, @@ -112,6 +115,7 @@ public function getUserConnectedAccount( * @param string $slug The slug identifier of the provider (e.g., `github`, `slack`, `notion`). * @param string|null $organizationId An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function deleteUserConnectedAccount( string $userId, @@ -137,6 +141,7 @@ public function deleteUserConnectedAccount( * @param string $userId A [User](https://workos.com/docs/reference/authkit/user) identifier to list providers and connected accounts for. * @param string|null $organizationId An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to filter connections for a specific organization. * @return \WorkOS\Resource\DataIntegrationsListResponse + * @throws \WorkOS\Exception\WorkOSException */ public function listUserDataProviders( string $userId, diff --git a/lib/Service/Radar.php b/lib/Service/Radar.php index a6e720b9..d6a8439a 100644 --- a/lib/Service/Radar.php +++ b/lib/Service/Radar.php @@ -28,6 +28,7 @@ public function __construct( * @param string|null $deviceFingerprint An optional device fingerprint for the request. * @param string|null $botScore An optional bot detection score for the request. * @return \WorkOS\Resource\RadarStandaloneResponse + * @throws \WorkOS\Exception\WorkOSException */ public function createAttempt( string $ipAddress, @@ -65,6 +66,7 @@ public function createAttempt( * @param string|null $challengeStatus Set to `"success"` to mark the challenge as completed. * @param string|null $attemptStatus Set to `"success"` to mark the authentication attempt as successful. * @return mixed + * @throws \WorkOS\Exception\WorkOSException */ public function updateAttempt( string $id, @@ -93,6 +95,7 @@ public function updateAttempt( * @param \WorkOS\Resource\RadarAction $action The list action indicating whether to add the entry to the allow or block list. * @param string $entry The value to add to the list. Must match the format of the list type (e.g. a valid IP address for `ip_address`, a valid email for `email`). * @return \WorkOS\Resource\RadarListEntryAlreadyPresentResponse + * @throws \WorkOS\Exception\WorkOSException */ public function addListEntry( \WorkOS\Resource\RadarType $type, @@ -120,6 +123,7 @@ public function addListEntry( * @param \WorkOS\Resource\RadarAction $action The list action indicating whether to remove the entry from the allow or block list. * @param string $entry The value to remove from the list. Must match an existing entry. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function removeListEntry( \WorkOS\Resource\RadarType $type, diff --git a/lib/Service/SSO.php b/lib/Service/SSO.php index 370efdfb..97e5c104 100644 --- a/lib/Service/SSO.php +++ b/lib/Service/SSO.php @@ -31,6 +31,7 @@ public function __construct( * @param string|null $organizationId Filter Connections by their associated organization. * @param string|null $search Searchable text to match against Connection names. * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\Connection> + * @throws \WorkOS\Exception\WorkOSException */ public function listConnections( ?string $before = null, @@ -68,6 +69,7 @@ public function listConnections( * Get the details of an existing connection. * @param string $id Unique identifier for the Connection. * @return \WorkOS\Resource\Connection + * @throws \WorkOS\Exception\WorkOSException */ public function getConnection( string $id, @@ -87,6 +89,7 @@ public function getConnection( * Permanently deletes an existing connection. It cannot be undone. * @param string $id Unique identifier for the Connection. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function deleteConnection( string $id, @@ -119,6 +122,7 @@ public function deleteConnection( * @param string|null $loginHint Can be used to pre-fill the username/email address field of the IdP sign-in page for the user, if you know their username ahead of time. Currently supported for OAuth, OpenID Connect, Okta, and Entra ID connections. * @param string|null $nonce A random string generated by the client that is used to mitigate replay attacks. * @return string + * @throws \WorkOS\Exception\ConfigurationException */ public function getAuthorizationUrl( string $redirectUri, @@ -177,6 +181,7 @@ public function getLogoutUrl( * You should call this endpoint from your server to generate a logout token which is required for the [Logout Redirect](https://workos.com/docs/reference/sso/logout) endpoint. * @param string $profileId The unique ID of the profile to log out. * @return \WorkOS\Resource\SSOLogoutAuthorizeResponse + * @throws \WorkOS\Exception\WorkOSException */ public function authorizeLogout( string $profileId, @@ -199,6 +204,7 @@ public function authorizeLogout( * * Exchange an access token for a user's [Profile](https://workos.com/docs/reference/sso/profile). Because this profile is returned in the [Get a Profile and Token endpoint](https://workos.com/docs/reference/sso/profile/get-profile-and-token) your application usually does not need to call this endpoint. It is available for any authentication flows that require an additional endpoint to retrieve a user's profile. * @return \WorkOS\Resource\Profile + * @throws \WorkOS\Exception\WorkOSException */ public function getProfile( ?\WorkOS\RequestOptions $options = null, @@ -217,6 +223,7 @@ public function getProfile( * Get an access token along with the user [Profile](https://workos.com/docs/reference/sso/profile) using the code passed to your [Redirect URI](https://workos.com/docs/reference/sso/get-authorization-url/redirect-uri). * @param string $code The authorization code received from the authorization callback. * @return \WorkOS\Resource\SSOTokenResponse + * @throws \WorkOS\Exception\WorkOSException */ public function getProfileAndToken( string $code, diff --git a/lib/Service/UserManagement.php b/lib/Service/UserManagement.php index be6e7cbc..fd8f0b73 100644 --- a/lib/Service/UserManagement.php +++ b/lib/Service/UserManagement.php @@ -42,6 +42,7 @@ public function __construct( * Returns the JSON Web Key Set (JWKS) containing the public keys used for verifying access tokens. * @param string $clientId Identifies the application making the request to the WorkOS server. You can obtain your client ID from the [API Keys](https://dashboard.workos.com/api-keys) page in the dashboard. * @return \WorkOS\Resource\JwksResponse + * @throws \WorkOS\Exception\WorkOSException */ public function getJwks( string $clientId, @@ -63,6 +64,7 @@ public function getJwks( * @param string|null $deviceId * @param string|null $userAgent * @return \WorkOS\Resource\AuthenticateResponse + * @throws \WorkOS\Exception\WorkOSException */ public function authenticateWithPassword( string $email, @@ -100,6 +102,7 @@ public function authenticateWithPassword( * @param mixed|null $deviceId * @param mixed|null $userAgent * @return \WorkOS\Resource\AuthenticateResponse + * @throws \WorkOS\Exception\WorkOSException */ public function authenticateWithCode( mixed $code = null, @@ -134,6 +137,7 @@ public function authenticateWithCode( * @param string|null $deviceId * @param string|null $userAgent * @return \WorkOS\Resource\AuthenticateResponse + * @throws \WorkOS\Exception\WorkOSException */ public function authenticateWithRefreshToken( string $refreshToken, @@ -171,6 +175,7 @@ public function authenticateWithRefreshToken( * @param mixed|null $deviceId * @param mixed|null $userAgent * @return \WorkOS\Resource\AuthenticateResponse + * @throws \WorkOS\Exception\WorkOSException */ public function authenticateWithMagicAuth( mixed $code = null, @@ -209,6 +214,7 @@ public function authenticateWithMagicAuth( * @param mixed|null $deviceId * @param mixed|null $userAgent * @return \WorkOS\Resource\AuthenticateResponse + * @throws \WorkOS\Exception\WorkOSException */ public function authenticateWithEmailVerification( mixed $code = null, @@ -246,6 +252,7 @@ public function authenticateWithEmailVerification( * @param mixed|null $deviceId * @param mixed|null $userAgent * @return \WorkOS\Resource\AuthenticateResponse + * @throws \WorkOS\Exception\WorkOSException */ public function authenticateWithTotp( mixed $code = null, @@ -284,6 +291,7 @@ public function authenticateWithTotp( * @param mixed|null $deviceId * @param mixed|null $userAgent * @return \WorkOS\Resource\AuthenticateResponse + * @throws \WorkOS\Exception\WorkOSException */ public function authenticateWithOrganizationSelection( mixed $pendingAuthenticationToken = null, @@ -319,6 +327,7 @@ public function authenticateWithOrganizationSelection( * @param mixed|null $deviceId * @param mixed|null $userAgent * @return \WorkOS\Resource\AuthenticateResponse + * @throws \WorkOS\Exception\WorkOSException */ public function authenticateWithDeviceCode( mixed $deviceCode = null, @@ -364,6 +373,7 @@ public function authenticateWithDeviceCode( * @param string|null $organizationId The ID of the organization to authenticate the user against. * @param string $redirectUri The callback URI where the authorization code will be sent after authentication. * @return string + * @throws \WorkOS\Exception\ConfigurationException */ public function getAuthorizationUrl( string $redirectUri, @@ -409,6 +419,7 @@ public function getAuthorizationUrl( * Initiates the CLI Auth flow by requesting a device code and verification URLs. This endpoint implements the OAuth 2.0 Device Authorization Flow ([RFC 8628](https://datatracker.ietf.org/doc/html/rfc8628)) and is designed for command-line applications or other devices with limited input capabilities. * @param string $clientId The WorkOS client ID for your application. * @return \WorkOS\Resource\DeviceAuthorizationResponse + * @throws \WorkOS\Exception\WorkOSException */ public function createDevice( string $clientId, @@ -453,6 +464,7 @@ public function getLogoutUrl( * @param string $sessionId The ID of the session to revoke. This can be extracted from the `sid` claim of the access token. * @param string|null $returnTo The URL to redirect the user to after session revocation. * @return mixed + * @throws \WorkOS\Exception\WorkOSException */ public function revokeSession( string $sessionId, @@ -478,6 +490,7 @@ public function revokeSession( * Creates a new CORS origin for the current environment. CORS origins allow browser-based applications to make requests to the WorkOS API. * @param string $origin The origin URL to allow for CORS requests. * @return \WorkOS\Resource\CORSOriginResponse + * @throws \WorkOS\Exception\WorkOSException */ public function createCorsOrigin( string $origin, @@ -501,6 +514,7 @@ public function createCorsOrigin( * Get the details of an existing email verification code that can be used to send an email to a user for verification. * @param string $id The ID of the email verification code. * @return \WorkOS\Resource\EmailVerification + * @throws \WorkOS\Exception\WorkOSException */ public function getEmailVerification( string $id, @@ -520,6 +534,7 @@ public function getEmailVerification( * Creates a one-time token that can be used to reset a user's password. * @param string $email The email address of the user requesting a password reset. * @return \WorkOS\Resource\PasswordReset + * @throws \WorkOS\Exception\WorkOSException */ public function resetPassword( string $email, @@ -544,6 +559,7 @@ public function resetPassword( * @param string $token The password reset token. * @param string $newPassword The new password to set for the user. * @return \WorkOS\Resource\ResetPasswordResponse + * @throws \WorkOS\Exception\WorkOSException */ public function confirmPasswordReset( string $token, @@ -569,6 +585,7 @@ public function confirmPasswordReset( * Get the details of an existing password reset token that can be used to reset a user's password. * @param string $id The ID of the password reset token. * @return \WorkOS\Resource\PasswordReset + * @throws \WorkOS\Exception\WorkOSException */ public function getPasswordReset( string $id, @@ -594,6 +611,7 @@ public function getPasswordReset( * @param string|null $organizationId Filter users by the organization they are a member of. * @param string|null $email Filter users by their email address. * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\User> + * @throws \WorkOS\Exception\WorkOSException */ public function listUsers( ?string $before = null, @@ -637,6 +655,7 @@ public function listUsers( * @param array|null $metadata Object containing metadata key/value pairs associated with the user. * @param string|null $externalId The external ID of the user. * @return \WorkOS\Resource\User + * @throws \WorkOS\Exception\WorkOSException */ public function createUser( string $email, @@ -676,6 +695,7 @@ public function createUser( * Get the details of an existing user by an [external identifier](https://workos.com/docs/authkit/metadata/external-identifiers). * @param string $externalId The external ID of the user. * @return \WorkOS\Resource\User + * @throws \WorkOS\Exception\WorkOSException */ public function getUserByExternalId( string $externalId, @@ -695,6 +715,7 @@ public function getUserByExternalId( * Get the details of an existing user. * @param string $id The unique ID of the user. * @return \WorkOS\Resource\User + * @throws \WorkOS\Exception\WorkOSException */ public function getUser( string $id, @@ -724,6 +745,7 @@ public function getUser( * @param string|null $externalId The external ID of the user. * @param string|null $locale The user's preferred locale. * @return \WorkOS\Resource\User + * @throws \WorkOS\Exception\WorkOSException */ public function updateUser( string $id, @@ -766,6 +788,7 @@ public function updateUser( * Permanently deletes a user in the current environment. It cannot be undone. * @param string $id The unique ID of the user. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function deleteUser( string $id, @@ -785,6 +808,7 @@ public function deleteUser( * @param string $id The unique ID of the user. * @param string $code The one-time code used to confirm the email change. * @return \WorkOS\Resource\EmailChangeConfirmation + * @throws \WorkOS\Exception\WorkOSException */ public function confirmEmailChange( string $id, @@ -810,6 +834,7 @@ public function confirmEmailChange( * @param string $id The unique ID of the user. * @param string $newEmail The new email address to change to. * @return \WorkOS\Resource\EmailChange + * @throws \WorkOS\Exception\WorkOSException */ public function sendEmailChange( string $id, @@ -835,6 +860,7 @@ public function sendEmailChange( * @param string $id The ID of the user. * @param string $code The one-time email verification code. * @return \WorkOS\Resource\VerifyEmailResponse + * @throws \WorkOS\Exception\WorkOSException */ public function verifyEmail( string $id, @@ -859,6 +885,7 @@ public function verifyEmail( * Sends an email that contains a one-time code used to verify a user’s email address. * @param string $id The ID of the user. * @return \WorkOS\Resource\SendVerificationEmailResponse + * @throws \WorkOS\Exception\WorkOSException */ public function sendVerificationEmail( string $id, @@ -878,6 +905,7 @@ public function sendVerificationEmail( * Get a list of identities associated with the user. A user can have multiple associated identities after going through [identity linking](https://workos.com/docs/authkit/identity-linking). Currently only OAuth identities are supported. More provider types may be added in the future. * @param string $id The unique ID of the user. * @return array + * @throws \WorkOS\Exception\WorkOSException */ public function getUserIdentities( string $id, @@ -901,6 +929,7 @@ public function getUserIdentities( * @param int|null $limit Upper limit on the number of objects to return, between `1` and `100`. Defaults to 10. * @param \WorkOS\Resource\EventsOrder|null $order Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. Defaults to "desc". * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\UserSessionsListItem> + * @throws \WorkOS\Exception\WorkOSException */ public function listSessions( string $id, @@ -936,6 +965,7 @@ public function listSessions( * @param string|null $organizationId The ID of the [organization](https://workos.com/docs/reference/organization) that the recipient will join. * @param string|null $email The email address of the recipient. * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\UserInvite> + * @throws \WorkOS\Exception\WorkOSException */ public function listInvitations( ?string $before = null, @@ -974,6 +1004,7 @@ public function listInvitations( * @param string|null $inviterUserId The ID of the [user](https://workos.com/docs/reference/authkit/user) who invites the recipient. The invitation email will mention the name of this user. * @param \WorkOS\Resource\CreateUserInviteOptionsLocale|null $locale The locale to use when rendering the invitation email. See [supported locales](https://workos.com/docs/authkit/hosted-ui/localization). * @return \WorkOS\Resource\UserInvite + * @throws \WorkOS\Exception\WorkOSException */ public function sendInvitation( string $email, @@ -1007,6 +1038,7 @@ public function sendInvitation( * Retrieve an existing invitation using the token. * @param string $token The token used to accept the invitation. * @return \WorkOS\Resource\UserInvite + * @throws \WorkOS\Exception\WorkOSException */ public function findInvitationByToken( string $token, @@ -1026,6 +1058,7 @@ public function findInvitationByToken( * Get the details of an existing invitation. * @param string $id The unique ID of the invitation. * @return \WorkOS\Resource\UserInvite + * @throws \WorkOS\Exception\WorkOSException */ public function getInvitation( string $id, @@ -1045,6 +1078,7 @@ public function getInvitation( * Accepts an invitation and, if linked to an organization, activates the user's membership in that organization. * @param string $id The unique ID of the invitation. * @return \WorkOS\Resource\Invitation + * @throws \WorkOS\Exception\WorkOSException */ public function acceptInvitation( string $id, @@ -1065,6 +1099,7 @@ public function acceptInvitation( * @param string $id The unique ID of the invitation. * @param \WorkOS\Resource\CreateUserInviteOptionsLocale|null $locale The locale to use when rendering the invitation email. See [supported locales](https://workos.com/docs/authkit/hosted-ui/localization). * @return \WorkOS\Resource\UserInvite + * @throws \WorkOS\Exception\WorkOSException */ public function resendInvitation( string $id, @@ -1089,6 +1124,7 @@ public function resendInvitation( * Revokes an existing invitation. * @param string $id The unique ID of the invitation. * @return \WorkOS\Resource\Invitation + * @throws \WorkOS\Exception\WorkOSException */ public function revokeInvitation( string $id, @@ -1108,6 +1144,7 @@ public function revokeInvitation( * Update the JWT template for the current environment. * @param string $content The JWT template content as a Liquid template string. * @return \WorkOS\Resource\JWTTemplateResponse + * @throws \WorkOS\Exception\WorkOSException */ public function updateJWTTemplate( string $content, @@ -1132,6 +1169,7 @@ public function updateJWTTemplate( * @param string $email The email address to send the magic code to. * @param string|null $invitationToken The invitation token to associate with this magic code. * @return \WorkOS\Resource\MagicAuth + * @throws \WorkOS\Exception\WorkOSException */ public function createMagicAuth( string $email, @@ -1157,6 +1195,7 @@ public function createMagicAuth( * Get the details of an existing [Magic Auth](https://workos.com/docs/reference/authkit/magic-auth) code that can be used to send an email to a user for authentication. * @param string $id The unique ID of the Magic Auth code. * @return \WorkOS\Resource\MagicAuth + * @throws \WorkOS\Exception\WorkOSException */ public function getMagicAuth( string $id, @@ -1182,6 +1221,7 @@ public function getMagicAuth( * @param array<\WorkOS\Resource\OrganizationMembershipStatus>|null $statuses Filter by the status of the organization membership. Array including any of `active`, `inactive`, or `pending`. * @param string|null $userId The ID of the [user](https://workos.com/docs/reference/authkit/user). * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\UserOrganizationMembership> + * @throws \WorkOS\Exception\WorkOSException */ public function listOrganizationMemberships( ?string $before = null, @@ -1222,6 +1262,7 @@ public function listOrganizationMemberships( * @param string|null $roleSlug A single role identifier. Defaults to `member` or the explicit default role. Mutually exclusive with `role_slugs`. * @param array|null $roleSlugs An array of role identifiers. Limited to one role when Multiple Roles is disabled. Mutually exclusive with `role_slug`. * @return \WorkOS\Resource\OrganizationMembership + * @throws \WorkOS\Exception\WorkOSException */ public function createOrganizationMembership( string $userId, @@ -1251,6 +1292,7 @@ public function createOrganizationMembership( * Get the details of an existing organization membership. * @param string $id The unique ID of the organization membership. * @return \WorkOS\Resource\UserOrganizationMembership + * @throws \WorkOS\Exception\WorkOSException */ public function getOrganizationMembership( string $id, @@ -1272,6 +1314,7 @@ public function getOrganizationMembership( * @param string|null $roleSlug A single role identifier. Defaults to `member` or the explicit default role. Mutually exclusive with `role_slugs`. * @param array|null $roleSlugs An array of role identifiers. Limited to one role when Multiple Roles is disabled. Mutually exclusive with `role_slug`. * @return \WorkOS\Resource\UserOrganizationMembership + * @throws \WorkOS\Exception\WorkOSException */ public function updateOrganizationMembership( string $id, @@ -1298,6 +1341,7 @@ public function updateOrganizationMembership( * Permanently deletes an existing organization membership. It cannot be undone. * @param string $id The unique ID of the organization membership. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function deleteOrganizationMembership( string $id, @@ -1321,6 +1365,7 @@ public function deleteOrganizationMembership( * See the [membership management documentation](https://workos.com/docs/authkit/users-organizations/organizations/membership-management) for additional details. * @param string $id The unique ID of the organization membership. * @return \WorkOS\Resource\OrganizationMembership + * @throws \WorkOS\Exception\WorkOSException */ public function deactivateOrganizationMembership( string $id, @@ -1345,6 +1390,7 @@ public function deactivateOrganizationMembership( * See the [membership management documentation](https://workos.com/docs/authkit/users-organizations/organizations/membership-management) for additional details. * @param string $id The unique ID of the organization membership. * @return \WorkOS\Resource\UserOrganizationMembership + * @throws \WorkOS\Exception\WorkOSException */ public function reactivateOrganizationMembership( string $id, @@ -1364,6 +1410,7 @@ public function reactivateOrganizationMembership( * Creates a new redirect URI for an environment. * @param string $uri The redirect URI to create. * @return \WorkOS\Resource\RedirectUri + * @throws \WorkOS\Exception\WorkOSException */ public function createRedirectUri( string $uri, @@ -1391,6 +1438,7 @@ public function createRedirectUri( * @param int|null $limit Upper limit on the number of objects to return, between `1` and `100`. Defaults to 10. * @param \WorkOS\Resource\EventsOrder|null $order Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. Defaults to "desc". * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\AuthorizedConnectApplicationListData> + * @throws \WorkOS\Exception\WorkOSException */ public function listUserAuthorizedApplications( string $userId, @@ -1422,6 +1470,7 @@ public function listUserAuthorizedApplications( * @param string $applicationId The ID or client ID of the application. * @param string $userId The ID of the user. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function deleteUserAuthorizedApplication( string $applicationId, diff --git a/lib/Service/Webhooks.php b/lib/Service/Webhooks.php index 7e993e37..4424560b 100644 --- a/lib/Service/Webhooks.php +++ b/lib/Service/Webhooks.php @@ -24,6 +24,7 @@ public function __construct( * @param int|null $limit Upper limit on the number of objects to return, between `1` and `100`. Defaults to 10. * @param \WorkOS\Resource\EventsOrder|null $order Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. Defaults to "desc". * @return \WorkOS\PaginatedResponse<\WorkOS\Resource\WebhookEndpointJson> + * @throws \WorkOS\Exception\WorkOSException */ public function listWebhookEndpoints( ?string $before = null, @@ -54,6 +55,7 @@ public function listWebhookEndpoints( * @param string $endpointUrl The HTTPS URL where webhooks will be sent. * @param array<\WorkOS\Resource\CreateWebhookEndpointEvents> $events The events that the Webhook Endpoint is subscribed to. * @return \WorkOS\Resource\WebhookEndpointJson + * @throws \WorkOS\Exception\WorkOSException */ public function createWebhookEndpoint( string $endpointUrl, @@ -82,6 +84,7 @@ public function createWebhookEndpoint( * @param \WorkOS\Resource\WebhookEndpointJsonStatus|null $status Whether the Webhook Endpoint is enabled or disabled. * @param array<\WorkOS\Resource\CreateWebhookEndpointEvents>|null $events The events that the Webhook Endpoint is subscribed to. * @return \WorkOS\Resource\WebhookEndpointJson + * @throws \WorkOS\Exception\WorkOSException */ public function updateWebhookEndpoint( string $id, @@ -110,6 +113,7 @@ public function updateWebhookEndpoint( * Delete an existing webhook endpoint. * @param string $id Unique identifier of the Webhook Endpoint. * @return void + * @throws \WorkOS\Exception\WorkOSException */ public function deleteWebhookEndpoint( string $id, diff --git a/lib/Service/Widgets.php b/lib/Service/Widgets.php index 7c284923..f3f27072 100644 --- a/lib/Service/Widgets.php +++ b/lib/Service/Widgets.php @@ -23,6 +23,7 @@ public function __construct( * @param string|null $userId The ID of the user to issue the widget session token for. * @param array<\WorkOS\Resource\WidgetSessionTokenScopes>|null $scopes The scopes to grant the widget session. * @return \WorkOS\Resource\WidgetSessionTokenResponse + * @throws \WorkOS\Exception\WorkOSException */ public function createToken( string $organizationId,