Skip to content

Commit

Permalink
Make string definitions which use know_values field as not closed enum (
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshalX authored Sep 11, 2024
1 parent b6e0f89 commit 43fd5ba
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/atproto_client/models/app/bsky/actor/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class InterestsPref(base.ModelBase):
)


MutedWordTarget = t.Union[t.Literal['content'], t.Literal['tag']] #: Muted word target
MutedWordTarget = t.Union[t.Literal['content'], t.Literal['tag'], str] #: Muted word target


class MutedWord(base.ModelBase):
Expand Down
5 changes: 4 additions & 1 deletion packages/atproto_client/models/app/bsky/graph/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ class StarterPackViewBasic(base.ModelBase):


ListPurpose = t.Union[
'models.AppBskyGraphDefs.Modlist', 'models.AppBskyGraphDefs.Curatelist', 'models.AppBskyGraphDefs.Referencelist'
'models.AppBskyGraphDefs.Modlist',
'models.AppBskyGraphDefs.Curatelist',
'models.AppBskyGraphDefs.Referencelist',
str,
] #: List purpose

Modlist = t.Literal[
Expand Down
1 change: 1 addition & 0 deletions packages/atproto_client/models/com/atproto/label/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,5 @@ class LabelValueDefinitionStrings(base.ModelBase):
t.Literal['nudity'],
t.Literal['nsfl'],
t.Literal['gore'],
str,
] #: Label value
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
'models.ComAtprotoModerationDefs.ReasonRude',
'models.ComAtprotoModerationDefs.ReasonOther',
'models.ComAtprotoModerationDefs.ReasonAppeal',
str,
] #: Reason type

ReasonSpam = t.Literal[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class SubjectStatusView(base.ModelBase):
'models.ToolsOzoneModerationDefs.ReviewEscalated',
'models.ToolsOzoneModerationDefs.ReviewClosed',
'models.ToolsOzoneModerationDefs.ReviewNone',
str,
] #: Subject review state

ReviewOpen = t.Literal[
Expand Down
2 changes: 1 addition & 1 deletion packages/atproto_codegen/models/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ def _generate_def_string(nsid: NSID, def_name: str, def_model: models.LexString)

union_types.append(type_)

final_type = f"t.Union[{', '.join(union_types)}]"
final_type = f"t.Union[{', '.join(union_types)}, str]"

description = def_model.description
if not description:
Expand Down

0 comments on commit 43fd5ba

Please sign in to comment.