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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
* [#710](https://github.com/workos/workos-python/pull/710) feat(generated)!: regenerate from spec (3 changes)

**⚠️ Breaking**
* **[events](https://workos.com/docs/reference/events)**:
* Changed required status for parameter `Events.list.events`

**Features**
* **[groups](https://workos.com/docs/reference/groups)**:
* Added parameter `Groups.list.search`
* **[connect](https://workos.com/docs/reference/workos-connect/standalone)**:
* Added `client_id` to `ConnectedAccount`
* Added `client_secret_last_4` to `ConnectedAccount`
* Added `config` to `ConnectedAccount`
* **[pipes](https://workos.com/docs/reference/pipes)**:
* Added `client_id` to `DataIntegrationsListResponseDataConnectedAccount`
* Added `client_secret_last_4` to `DataIntegrationsListResponseDataConnectedAccount`
* Added `config` to `DataIntegrationsListResponseDataConnectedAccount`
* Changed errors for endpoint `POST /data-integrations/{slug}/credentials`
* Made `CustomProviderDefinition.authorization_url` optional
* Made `CustomProviderDefinition.token_url` optional
* Added model `DataIntegrationsUpsertClientCredentialsRequest`
* Added `client_credentials` to `CreateDataIntegrationAuthMethods`
* Added endpoint `PUT /data-integrations/{slug}/client-credentials`
* **[sso](https://workos.com/docs/reference/sso)**:
* Added `XOAuth` to `ConnectionType`
* Added `XOAuth` to `ProfileConnectionType`
* Added `XOAuth` to `ConnectionsConnectionType`
* Added `GrokOAuth` to `ConnectionType`
* Added `GrokOAuth` to `ProfileConnectionType`
* Added `GrokOAuth` to `ConnectionsConnectionType`
* **[user_management](https://workos.com/docs/reference/authkit/user)**:
* Changed errors for endpoint `DELETE /user_management/users/{id}`
* Added `password_salt_position` to `CreateUser`
* Added `password_salt_position` to `UpdateUser`
* Made `RadarSmsChallengeCodeSessionAuthenticateRequest.verification_id` optional
* Made `RadarSmsChallengeCodeSessionAuthenticateRequest.phone_number` optional
* Added enum `CreateUserPasswordSaltPosition`
* Added enum `UpdateUserPasswordSaltPosition`
* Added `XOAuth` to `AuthenticateResponseAuthenticationMethod`
* Added `XOAuth` to `UserIdentitiesGetItemProvider`
* Added `GrokOAuth` to `AuthenticateResponseAuthenticationMethod`
* Added `GrokOAuth` to `UserIdentitiesGetItemProvider`
* **[webhooks](https://workos.com/docs/reference/webhooks)**:
* Added `agent.registration.refreshed` to `CreateWebhookEndpointEvents`
* Added `agent.registration.refreshed` to `UpdateWebhookEndpointEvents`

**Fixes**
* **[pipes](https://workos.com/docs/reference/pipes)**:
* Changed the type of `DataIntegration.credentials`
* **[user_management](https://workos.com/docs/reference/authkit/user)**:
* Changed errors for endpoint `POST /user_management/authenticate`
* Changed errors for endpoint `POST /user_management/users`
* Changed errors for endpoint `PUT /user_management/users/{id}`
2 changes: 1 addition & 1 deletion .last-synced-sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ae3ebbb08d9b4bf9b2391558e820b7eb6f511fb9
a07d8e7988d035c2d727787f18f64d71b4b89a84
12 changes: 12 additions & 0 deletions .oagen-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"src/workos/common/models/agent_registration_kind.py",
"src/workos/common/models/agent_registration_organization_switched.py",
"src/workos/common/models/agent_registration_organization_switched_data.py",
"src/workos/common/models/agent_registration_refreshed.py",
"src/workos/common/models/agent_registration_refreshed_data.py",
"src/workos/common/models/agent_registration_revoked.py",
"src/workos/common/models/agent_registration_revoked_data.py",
"src/workos/common/models/agent_registration_status.py",
Expand Down Expand Up @@ -240,6 +242,7 @@
"src/workos/common/models/create_data_integration_auth_methods.py",
"src/workos/common/models/create_user_invite_options_locale.py",
"src/workos/common/models/create_user_password_hash_type.py",
"src/workos/common/models/create_user_password_salt_position.py",
"src/workos/common/models/create_webhook_endpoint_events.py",
"src/workos/common/models/custom_provider_definition_authenticate_via.py",
"src/workos/common/models/data_integration_access_token_response_error.py",
Expand Down Expand Up @@ -465,6 +468,7 @@
"src/workos/common/models/slim_role.py",
"src/workos/common/models/update_custom_provider_definition_authenticate_via.py",
"src/workos/common/models/update_user_password_hash_type.py",
"src/workos/common/models/update_user_password_salt_position.py",
"src/workos/common/models/update_webhook_endpoint_events.py",
"src/workos/common/models/update_webhook_endpoint_status.py",
"src/workos/common/models/user.py",
Expand Down Expand Up @@ -620,6 +624,7 @@
"src/workos/pipes/models/data_integrations_list_response_data.py",
"src/workos/pipes/models/data_integrations_list_response_data_connected_account.py",
"src/workos/pipes/models/data_integrations_upsert_api_key_request.py",
"src/workos/pipes/models/data_integrations_upsert_client_credentials_request.py",
"src/workos/pipes/models/data_integrations_vend_credentials_request.py",
"src/workos/pipes/models/update_custom_provider_definition.py",
"src/workos/pipes/models/update_data_integration.py",
Expand Down Expand Up @@ -801,6 +806,8 @@
"tests/fixtures/agent_registration_expired_data.json",
"tests/fixtures/agent_registration_organization_switched.json",
"tests/fixtures/agent_registration_organization_switched_data.json",
"tests/fixtures/agent_registration_refreshed.json",
"tests/fixtures/agent_registration_refreshed_data.json",
"tests/fixtures/agent_registration_revoked.json",
"tests/fixtures/agent_registration_revoked_data.json",
"tests/fixtures/api_key.json",
Expand Down Expand Up @@ -982,6 +989,7 @@
"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_client_credentials_request.json",
"tests/fixtures/data_integrations_vend_credentials_request.json",
"tests/fixtures/decrypt_request.json",
"tests/fixtures/decrypt_response.json",
Expand Down Expand Up @@ -2217,6 +2225,10 @@
"GET /audit_logs/exports/{auditLogExportId}": {
"sdkMethod": "get_export",
"service": "audit_logs"
},
"PUT /data-integrations/{slug}/client-credentials": {
"sdkMethod": "update_data_integration_client_credentials",
"service": "pipes"
}
}
}
33 changes: 17 additions & 16 deletions src/workos/admin_portal/_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,32 @@

from __future__ import annotations

from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
from typing import TYPE_CHECKING, Any

if TYPE_CHECKING:
from .._client import AsyncWorkOSClient, WorkOSClient

from workos.common.models.generate_link_intent import GenerateLinkIntent

from .._types import RequestOptions, enum_value
from .models import PortalLinkResponse
from workos.common.models.generate_link_intent import GenerateLinkIntent


class AdminPortal:
"""Admin Portal API resources."""

def __init__(self, client: "WorkOSClient") -> None:
def __init__(self, client: WorkOSClient) -> None:
self._client = client

def generate_link(
self,
*,
organization: str,
return_url: Optional[str] = None,
success_url: Optional[str] = None,
intent: Optional[Union[GenerateLinkIntent, str]] = None,
it_contact_emails: Optional[List[str]] = None,
request_options: Optional[RequestOptions] = None,
return_url: str | None = None,
success_url: str | None = None,
intent: GenerateLinkIntent | str | None = None,
it_contact_emails: list[str] | None = None,
request_options: RequestOptions | None = None,
) -> PortalLinkResponse:
"""Generate a Portal Link

Expand Down Expand Up @@ -59,7 +60,7 @@ def generate_link(
RateLimitExceededError: If rate limited (429).
ServerError: If the server returns a 5xx error.
"""
body: Dict[str, Any] = {
body: dict[str, Any] = {
k: v
for k, v in {
"return_url": return_url,
Expand All @@ -82,18 +83,18 @@ def generate_link(
class AsyncAdminPortal:
"""Admin Portal API resources (async)."""

def __init__(self, client: "AsyncWorkOSClient") -> None:
def __init__(self, client: AsyncWorkOSClient) -> None:
self._client = client

async def generate_link(
self,
*,
organization: str,
return_url: Optional[str] = None,
success_url: Optional[str] = None,
intent: Optional[Union[GenerateLinkIntent, str]] = None,
it_contact_emails: Optional[List[str]] = None,
request_options: Optional[RequestOptions] = None,
return_url: str | None = None,
success_url: str | None = None,
intent: GenerateLinkIntent | str | None = None,
it_contact_emails: list[str] | None = None,
request_options: RequestOptions | None = None,
) -> PortalLinkResponse:
"""Generate a Portal Link

Expand Down Expand Up @@ -126,7 +127,7 @@ async def generate_link(
RateLimitExceededError: If rate limited (429).
ServerError: If the server returns a 5xx error.
"""
body: Dict[str, Any] = {
body: dict[str, Any] = {
k: v
for k, v in {
"return_url": return_url,
Expand Down
17 changes: 9 additions & 8 deletions src/workos/admin_portal/models/generate_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

from dataclasses import dataclass
from enum import Enum
from typing import Any, Dict, List, Optional
from typing import Any

from workos._types import _raise_deserialize_error
from workos.common.models.generate_link_intent import GenerateLinkIntent

Expand All @@ -15,11 +16,11 @@ class GenerateLink:

organization: str
"""An [Organization](https://workos.com/docs/reference/organization) identifier."""
return_url: Optional[str] = None
return_url: str | None = None
"""The URL to go to when an admin clicks on your logo in the Admin Portal. If not specified, the return URL configured on the [Redirects](https://dashboard.workos.com/redirects) page will be used."""
success_url: Optional[str] = None
success_url: str | None = None
"""The URL to redirect the admin to when they finish setup. If not specified, the success URL configured on the [Redirects](https://dashboard.workos.com/redirects) page will be used."""
intent: Optional["GenerateLinkIntent"] = None
intent: GenerateLinkIntent | None = None
"""
The intent of the Admin Portal.
- `sso` - Launch Admin Portal for creating SSO connections
Expand All @@ -29,11 +30,11 @@ class GenerateLink:
- `domain_verification` - Launch Admin Portal for Domain Verification
- `certificate_renewal` - Launch Admin Portal for renewing SAML Certificates
- `bring_your_own_key` - Launch Admin Portal for configuring Bring Your Own Key"""
it_contact_emails: Optional[List[str]] = None
it_contact_emails: list[str] | None = None
"""The email addresses of the IT contacts to grant access to the Admin Portal for the given organization. Accepts up to 20 emails."""

@classmethod
def from_dict(cls, data: Dict[str, Any]) -> "GenerateLink":
def from_dict(cls, data: dict[str, Any]) -> GenerateLink:
"""Deserialize from a dictionary."""
try:
return cls(
Expand All @@ -48,9 +49,9 @@ def from_dict(cls, data: Dict[str, Any]) -> "GenerateLink":
except (KeyError, ValueError) as e:
_raise_deserialize_error("GenerateLink", e)

def to_dict(self) -> Dict[str, Any]:
def to_dict(self) -> dict[str, Any]:
"""Serialize to a dictionary."""
result: Dict[str, Any] = {}
result: dict[str, Any] = {}
result["organization"] = self.organization
if self.return_url is not None:
result["return_url"] = self.return_url
Expand Down
9 changes: 5 additions & 4 deletions src/workos/admin_portal/models/portal_link_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from __future__ import annotations

from dataclasses import dataclass
from typing import Any, Dict
from typing import Any

from workos._types import _raise_deserialize_error


Expand All @@ -15,7 +16,7 @@ class PortalLinkResponse:
"""An ephemeral link to initiate the Admin Portal."""

@classmethod
def from_dict(cls, data: Dict[str, Any]) -> "PortalLinkResponse":
def from_dict(cls, data: dict[str, Any]) -> PortalLinkResponse:
"""Deserialize from a dictionary."""
try:
return cls(
Expand All @@ -24,8 +25,8 @@ def from_dict(cls, data: Dict[str, Any]) -> "PortalLinkResponse":
except (KeyError, ValueError) as e:
_raise_deserialize_error("PortalLinkResponse", e)

def to_dict(self) -> Dict[str, Any]:
def to_dict(self) -> dict[str, Any]:
"""Serialize to a dictionary."""
result: Dict[str, Any] = {}
result: dict[str, Any] = {}
result["link"] = self.link
return result
Loading