Skip to content

Commit 01542a2

Browse files
committed
adjust requiredness
1 parent faf60f2 commit 01542a2

File tree

9 files changed

+27
-36
lines changed

9 files changed

+27
-36
lines changed

src/workos/types/events/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from .api_key_payload import *
21
from .authentication_payload import *
32
from .connection_payload_with_legacy_fields import *
43
from .connection_saml_certificate_payload import *

src/workos/types/events/api_key_payload.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/workos/types/events/authentication_payload.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ class AuthenticationSsoSucceededPayload(AuthenticationResultSucceeded):
9898
class AuthenticationRadarRiskDetectedPayload(AuthenticationResultCommon):
9999
auth_method: str
100100
action: str
101-
control: str
101+
control: Optional[str] = None
102102
blocklist_type: Optional[str] = None
103-
user_id: Optional[str] = None
103+
user_id: str
104+
email: str

src/workos/types/events/connection_saml_certificate_payload.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
from typing import Literal
1+
from typing import Literal, Optional
22
from workos.types.workos_model import WorkOSModel
33

44
SamlCertificateType = Literal["ResponseSigning", "RequestSigning", "ResponseEncryption"]
55

66

77
class SamlCertificateConnection(WorkOSModel):
88
id: str
9-
organization_id: str
9+
organization_id: Optional[str] = None
1010

1111

1212
class SamlCertificate(WorkOSModel):

src/workos/types/events/event.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from workos.types.user_management import OrganizationMembership, User
55
from workos.types.directory_sync.directory_group import DirectoryGroup
66
from workos.types.directory_sync.directory_user import DirectoryUser
7-
from workos.types.events.api_key_payload import ApiKeyPayload
7+
from workos.types.api_keys import ApiKey
88
from workos.types.events.authentication_payload import (
99
AuthenticationEmailVerificationFailedPayload,
1010
AuthenticationEmailVerificationSucceededPayload,
@@ -71,11 +71,11 @@
7171
# the event name is added to the EventType union type in event_type.py.
7272

7373

74-
class ApiKeyCreatedEvent(EventModel[ApiKeyPayload]):
74+
class ApiKeyCreatedEvent(EventModel[ApiKey]):
7575
event: Literal["api_key.created"]
7676

7777

78-
class ApiKeyRevokedEvent(EventModel[ApiKeyPayload]):
78+
class ApiKeyRevokedEvent(EventModel[ApiKey]):
7979
event: Literal["api_key.revoked"]
8080

8181

src/workos/types/events/event_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from workos.types.workos_model import WorkOSModel
44
from workos.types.directory_sync.directory_group import DirectoryGroup
55
from workos.types.directory_sync.directory_user import DirectoryUser
6-
from workos.types.events.api_key_payload import ApiKeyPayload
6+
from workos.types.api_keys import ApiKey
77
from workos.types.events.authentication_payload import (
88
AuthenticationEmailVerificationFailedPayload,
99
AuthenticationEmailVerificationSucceededPayload,
@@ -67,7 +67,7 @@
6767

6868
EventPayload = TypeVar(
6969
"EventPayload",
70-
ApiKeyPayload,
70+
ApiKey,
7171
AuthenticationEmailVerificationFailedPayload,
7272
AuthenticationEmailVerificationSucceededPayload,
7373
AuthenticationMagicAuthFailedPayload,

src/workos/types/events/flag_payload.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,22 @@
33
from workos.types.workos_model import WorkOSModel
44

55

6+
class FlagOwner(WorkOSModel):
7+
email: str
8+
first_name: Optional[str] = None
9+
last_name: Optional[str] = None
10+
11+
612
class FlagPayload(WorkOSModel):
7-
object: Literal["flag"]
13+
object: Literal["feature_flag"]
814
id: str
9-
name: str
15+
environment_id: str
1016
slug: str
17+
name: str
1118
description: Optional[str] = None
12-
tags: Optional[Sequence[str]] = None
19+
owner: Optional[FlagOwner] = None
20+
tags: Sequence[str]
21+
enabled: bool
22+
default_value: bool
1323
created_at: str
1424
updated_at: str

src/workos/types/events/organization_role_payload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class OrganizationRolePayload(WorkOSModel):
88
slug: str
99
name: str
1010
description: Optional[str] = None
11-
resource_type_slug: Optional[str] = None
11+
resource_type_slug: str
1212
permissions: Sequence[str]
1313
created_at: str
1414
updated_at: str

src/workos/types/webhooks/webhook.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from workos.types.directory_sync import DirectoryGroup
77
from workos.types.directory_sync.directory_user import DirectoryUser
8-
from workos.types.events.api_key_payload import ApiKeyPayload
8+
from workos.types.api_keys import ApiKey
99
from workos.types.events.authentication_payload import (
1010
AuthenticationEmailVerificationFailedPayload,
1111
AuthenticationEmailVerificationSucceededPayload,
@@ -71,11 +71,11 @@
7171
# added to the Webhook union type at the bottom of this file.
7272

7373

74-
class ApiKeyCreatedWebhook(WebhookModel[ApiKeyPayload]):
74+
class ApiKeyCreatedWebhook(WebhookModel[ApiKey]):
7575
event: Literal["api_key.created"]
7676

7777

78-
class ApiKeyRevokedWebhook(WebhookModel[ApiKeyPayload]):
78+
class ApiKeyRevokedWebhook(WebhookModel[ApiKey]):
7979
event: Literal["api_key.revoked"]
8080

8181

0 commit comments

Comments
 (0)