Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zzstoatzz committed Nov 23, 2024
1 parent e228fb4 commit 4a1afbc
Show file tree
Hide file tree
Showing 152 changed files with 984 additions and 870 deletions.
55 changes: 28 additions & 27 deletions packages/atproto_client/models/app/bsky/actor/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@
import typing_extensions as te
from pydantic import Field

from atproto_client.models import string_formats

if t.TYPE_CHECKING:
from atproto_client import models
from atproto_client.models import string_formats
from atproto_client.models import base


class ProfileViewBasic(base.ModelBase):
"""Definition model for :obj:`app.bsky.actor.defs`."""

did: 'string_formats.Did' #: Did.
handle: 'string_formats.Handle' #: Handle.
did: string_formats.Did #: Did.
handle: string_formats.Handle #: Handle.
associated: t.Optional['models.AppBskyActorDefs.ProfileAssociated'] = None #: Associated.
avatar: t.Optional['string_formats.Uri'] = None #: Avatar.
created_at: t.Optional['string_formats.DateTime'] = None #: Created at.
avatar: t.Optional[string_formats.Uri] = None #: Avatar.
created_at: t.Optional[string_formats.DateTime] = None #: Created at.
display_name: t.Optional[str] = Field(default=None, max_length=640) #: Display name.
labels: t.Optional[t.List['models.ComAtprotoLabelDefs.Label']] = None #: Labels.
viewer: t.Optional['models.AppBskyActorDefs.ViewerState'] = None #: Viewer.
Expand All @@ -36,14 +37,14 @@ class ProfileViewBasic(base.ModelBase):
class ProfileView(base.ModelBase):
"""Definition model for :obj:`app.bsky.actor.defs`."""

did: 'string_formats.Did' #: Did.
handle: 'string_formats.Handle' #: Handle.
did: string_formats.Did #: Did.
handle: string_formats.Handle #: Handle.
associated: t.Optional['models.AppBskyActorDefs.ProfileAssociated'] = None #: Associated.
avatar: t.Optional['string_formats.Uri'] = None #: Avatar.
created_at: t.Optional['string_formats.DateTime'] = None #: Created at.
avatar: t.Optional[string_formats.Uri] = None #: Avatar.
created_at: t.Optional[string_formats.DateTime] = None #: Created at.
description: t.Optional[str] = Field(default=None, max_length=2560) #: Description.
display_name: t.Optional[str] = Field(default=None, max_length=640) #: Display name.
indexed_at: t.Optional['string_formats.DateTime'] = None #: Indexed at.
indexed_at: t.Optional[string_formats.DateTime] = None #: Indexed at.
labels: t.Optional[t.List['models.ComAtprotoLabelDefs.Label']] = None #: Labels.
viewer: t.Optional['models.AppBskyActorDefs.ViewerState'] = None #: Viewer.

Expand All @@ -55,17 +56,17 @@ class ProfileView(base.ModelBase):
class ProfileViewDetailed(base.ModelBase):
"""Definition model for :obj:`app.bsky.actor.defs`."""

did: 'string_formats.Did' #: Did.
handle: 'string_formats.Handle' #: Handle.
did: string_formats.Did #: Did.
handle: string_formats.Handle #: Handle.
associated: t.Optional['models.AppBskyActorDefs.ProfileAssociated'] = None #: Associated.
avatar: t.Optional['string_formats.Uri'] = None #: Avatar.
banner: t.Optional['string_formats.Uri'] = None #: Banner.
created_at: t.Optional['string_formats.DateTime'] = None #: Created at.
avatar: t.Optional[string_formats.Uri] = None #: Avatar.
banner: t.Optional[string_formats.Uri] = None #: Banner.
created_at: t.Optional[string_formats.DateTime] = None #: Created at.
description: t.Optional[str] = Field(default=None, max_length=2560) #: Description.
display_name: t.Optional[str] = Field(default=None, max_length=640) #: Display name.
followers_count: t.Optional[int] = None #: Followers count.
follows_count: t.Optional[int] = None #: Follows count.
indexed_at: t.Optional['string_formats.DateTime'] = None #: Indexed at.
indexed_at: t.Optional[string_formats.DateTime] = None #: Indexed at.
joined_via_starter_pack: t.Optional['models.AppBskyGraphDefs.StarterPackViewBasic'] = (
None #: Joined via starter pack.
)
Expand Down Expand Up @@ -107,10 +108,10 @@ class ViewerState(base.ModelBase):
"""Definition model for :obj:`app.bsky.actor.defs`. Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests."""

blocked_by: t.Optional[bool] = None #: Blocked by.
blocking: t.Optional['string_formats.AtUri'] = None #: Blocking.
blocking: t.Optional[string_formats.AtUri] = None #: Blocking.
blocking_by_list: t.Optional['models.AppBskyGraphDefs.ListViewBasic'] = None #: Blocking by list.
followed_by: t.Optional['string_formats.AtUri'] = None #: Followed by.
following: t.Optional['string_formats.AtUri'] = None #: Following.
followed_by: t.Optional[string_formats.AtUri] = None #: Followed by.
following: t.Optional[string_formats.AtUri] = None #: Following.
known_followers: t.Optional['models.AppBskyActorDefs.KnownFollowers'] = None #: Known followers.
muted: t.Optional[bool] = None #: Muted.
muted_by_list: t.Optional['models.AppBskyGraphDefs.ListViewBasic'] = None #: Muted by list.
Expand Down Expand Up @@ -169,7 +170,7 @@ class ContentLabelPref(base.ModelBase):
visibility: t.Union[
t.Literal['ignore'], t.Literal['show'], t.Literal['warn'], t.Literal['hide'], str
] #: Visibility.
labeler_did: t.Optional['string_formats.Did'] = (
labeler_did: t.Optional[string_formats.Did] = (
None #: Which labeler does this preference apply to? If undefined, applies globally.
)

Expand Down Expand Up @@ -204,8 +205,8 @@ class SavedFeedsPrefV2(base.ModelBase):
class SavedFeedsPref(base.ModelBase):
"""Definition model for :obj:`app.bsky.actor.defs`."""

pinned: t.List['string_formats.AtUri'] #: Pinned.
saved: t.List['string_formats.AtUri'] #: Saved.
pinned: t.List[string_formats.AtUri] #: Pinned.
saved: t.List[string_formats.AtUri] #: Saved.
timeline_index: t.Optional[int] = None #: Timeline index.

py_type: t.Literal['app.bsky.actor.defs#savedFeedsPref'] = Field(
Expand All @@ -216,7 +217,7 @@ class SavedFeedsPref(base.ModelBase):
class PersonalDetailsPref(base.ModelBase):
"""Definition model for :obj:`app.bsky.actor.defs`."""

birth_date: t.Optional['string_formats.DateTime'] = None #: The birth date of account owner.
birth_date: t.Optional[string_formats.DateTime] = None #: The birth date of account owner.

py_type: t.Literal['app.bsky.actor.defs#personalDetailsPref'] = Field(
default='app.bsky.actor.defs#personalDetailsPref', alias='$type', frozen=True
Expand Down Expand Up @@ -276,7 +277,7 @@ class MutedWord(base.ModelBase):
actor_target: t.Optional[t.Union[t.Literal['all'], t.Literal['exclude-following'], str]] = (
'all' #: Groups of users to apply the muted word to. If undefined, applies to all users.
)
expires_at: t.Optional['string_formats.DateTime'] = (
expires_at: t.Optional[string_formats.DateTime] = (
None #: The date and time at which the muted word will expire and no longer be applied.
)
id: t.Optional[str] = None #: Id.
Expand All @@ -299,7 +300,7 @@ class MutedWordsPref(base.ModelBase):
class HiddenPostsPref(base.ModelBase):
"""Definition model for :obj:`app.bsky.actor.defs`."""

items: t.List['string_formats.AtUri'] #: A list of URIs of posts the account owner has hidden.
items: t.List[string_formats.AtUri] #: A list of URIs of posts the account owner has hidden.

py_type: t.Literal['app.bsky.actor.defs#hiddenPostsPref'] = Field(
default='app.bsky.actor.defs#hiddenPostsPref', alias='$type', frozen=True
Expand All @@ -319,7 +320,7 @@ class LabelersPref(base.ModelBase):
class LabelerPrefItem(base.ModelBase):
"""Definition model for :obj:`app.bsky.actor.defs`."""

did: 'string_formats.Did' #: Did.
did: string_formats.Did #: Did.

py_type: t.Literal['app.bsky.actor.defs#labelerPrefItem'] = Field(
default='app.bsky.actor.defs#labelerPrefItem', alias='$type', frozen=True
Expand Down Expand Up @@ -360,7 +361,7 @@ class Nux(base.ModelBase):
data: t.Optional[str] = Field(
default=None, max_length=3000
) #: Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters.
expires_at: t.Optional['string_formats.DateTime'] = (
expires_at: t.Optional[string_formats.DateTime] = (
None #: The date and time at which the NUX will expire and should be considered completed.
)

Expand Down
8 changes: 3 additions & 5 deletions packages/atproto_client/models/app/bsky/actor/get_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@

import typing as t

if t.TYPE_CHECKING:
from atproto_client.models import string_formats
from atproto_client.models import base
from atproto_client.models import base, string_formats


class Params(base.ParamsModelBase):
"""Parameters model for :obj:`app.bsky.actor.getProfile`."""

actor: 'string_formats.Handle' #: Handle or DID of account to fetch profile of.
actor: string_formats.Handle #: Handle or DID of account to fetch profile of.


class ParamsDict(t.TypedDict):
actor: 'string_formats.Handle' #: Handle or DID of account to fetch profile of.
actor: string_formats.Handle #: Handle or DID of account to fetch profile of.
7 changes: 4 additions & 3 deletions packages/atproto_client/models/app/bsky/actor/get_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,21 @@

from pydantic import Field

from atproto_client.models import string_formats

if t.TYPE_CHECKING:
from atproto_client import models
from atproto_client.models import string_formats
from atproto_client.models import base


class Params(base.ParamsModelBase):
"""Parameters model for :obj:`app.bsky.actor.getProfiles`."""

actors: t.List['string_formats.Handle'] = Field(max_length=25) #: Actors.
actors: t.List[string_formats.Handle] = Field(max_length=25) #: Actors.


class ParamsDict(t.TypedDict):
actors: t.List['string_formats.Handle'] #: Actors.
actors: t.List[string_formats.Handle] #: Actors.


class Response(base.ResponseModelBase):
Expand Down
5 changes: 3 additions & 2 deletions packages/atproto_client/models/app/bsky/actor/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
import typing_extensions as te
from pydantic import Field

from atproto_client.models import string_formats

if t.TYPE_CHECKING:
from atproto_client import models
from atproto_client.models import string_formats
from atproto_client.models.blob_ref import BlobRef
from atproto_client.models import base

Expand All @@ -24,7 +25,7 @@ class Record(base.RecordModelBase):
None #: Small image to be displayed next to posts from account. AKA, 'profile picture'.
)
banner: t.Optional['BlobRef'] = None #: Larger horizontal image to display behind profile view.
created_at: t.Optional['string_formats.DateTime'] = None #: Created at.
created_at: t.Optional[string_formats.DateTime] = None #: Created at.
description: t.Optional[str] = Field(default=None, max_length=2560) #: Free-form profile description text.
display_name: t.Optional[str] = Field(default=None, max_length=640) #: Display name.
joined_via_starter_pack: t.Optional['models.ComAtprotoRepoStrongRef.Main'] = None #: Joined via starter pack.
Expand Down
9 changes: 5 additions & 4 deletions packages/atproto_client/models/app/bsky/embed/external.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

from pydantic import Field

from atproto_client.models import string_formats

if t.TYPE_CHECKING:
from atproto_client import models
from atproto_client.models import string_formats
from atproto_client.models.blob_ref import BlobRef
from atproto_client.models import base

Expand All @@ -29,7 +30,7 @@ class External(base.ModelBase):

description: str #: Description.
title: str #: Title.
uri: 'string_formats.Uri' #: Uri.
uri: string_formats.Uri #: Uri.
thumb: t.Optional['BlobRef'] = None #: Thumb.

py_type: t.Literal['app.bsky.embed.external#external'] = Field(
Expand All @@ -52,8 +53,8 @@ class ViewExternal(base.ModelBase):

description: str #: Description.
title: str #: Title.
uri: 'string_formats.Uri' #: Uri.
thumb: t.Optional['string_formats.Uri'] = None #: Thumb.
uri: string_formats.Uri #: Uri.
thumb: t.Optional[string_formats.Uri] = None #: Thumb.

py_type: t.Literal['app.bsky.embed.external#viewExternal'] = Field(
default='app.bsky.embed.external#viewExternal', alias='$type', frozen=True
Expand Down
7 changes: 4 additions & 3 deletions packages/atproto_client/models/app/bsky/embed/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

from pydantic import Field

from atproto_client.models import string_formats

if t.TYPE_CHECKING:
from atproto_client import models
from atproto_client.models import string_formats
from atproto_client.models.blob_ref import BlobRef
from atproto_client.models import base

Expand Down Expand Up @@ -50,8 +51,8 @@ class ViewImage(base.ModelBase):
"""Definition model for :obj:`app.bsky.embed.images`."""

alt: str #: Alt text description of the image, for accessibility.
fullsize: 'string_formats.Uri' #: Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View.
thumb: 'string_formats.Uri' #: Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View.
fullsize: string_formats.Uri #: Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View.
thumb: string_formats.Uri #: Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View.
aspect_ratio: t.Optional['models.AppBskyEmbedDefs.AspectRatio'] = None #: Aspect ratio.

py_type: t.Literal['app.bsky.embed.images#viewImage'] = Field(
Expand Down
15 changes: 8 additions & 7 deletions packages/atproto_client/models/app/bsky/embed/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
import typing_extensions as te
from pydantic import Field

from atproto_client.models import string_formats

if t.TYPE_CHECKING:
from atproto_client import models
from atproto_client.models import string_formats
from atproto_client.models.unknown_type import UnknownType
from atproto_client.models import base

Expand Down Expand Up @@ -51,9 +52,9 @@ class ViewRecord(base.ModelBase):
"""Definition model for :obj:`app.bsky.embed.record`."""

author: 'models.AppBskyActorDefs.ProfileViewBasic' #: Author.
cid: 'string_formats.Cid' #: Cid.
indexed_at: 'string_formats.DateTime' #: Indexed at.
uri: 'string_formats.AtUri' #: Uri.
cid: string_formats.Cid #: Cid.
indexed_at: string_formats.DateTime #: Indexed at.
uri: string_formats.AtUri #: Uri.
value: 'UnknownType' #: The record data itself.
embeds: t.Optional[
t.List[
Expand Down Expand Up @@ -84,7 +85,7 @@ class ViewNotFound(base.ModelBase):
"""Definition model for :obj:`app.bsky.embed.record`."""

not_found: bool = Field(frozen=True) #: Not found.
uri: 'string_formats.AtUri' #: Uri.
uri: string_formats.AtUri #: Uri.

py_type: t.Literal['app.bsky.embed.record#viewNotFound'] = Field(
default='app.bsky.embed.record#viewNotFound', alias='$type', frozen=True
Expand All @@ -96,7 +97,7 @@ class ViewBlocked(base.ModelBase):

author: 'models.AppBskyFeedDefs.BlockedAuthor' #: Author.
blocked: bool = Field(frozen=True) #: Blocked.
uri: 'string_formats.AtUri' #: Uri.
uri: string_formats.AtUri #: Uri.

py_type: t.Literal['app.bsky.embed.record#viewBlocked'] = Field(
default='app.bsky.embed.record#viewBlocked', alias='$type', frozen=True
Expand All @@ -107,7 +108,7 @@ class ViewDetached(base.ModelBase):
"""Definition model for :obj:`app.bsky.embed.record`."""

detached: bool = Field(frozen=True) #: Detached.
uri: 'string_formats.AtUri' #: Uri.
uri: string_formats.AtUri #: Uri.

py_type: t.Literal['app.bsky.embed.record#viewDetached'] = Field(
default='app.bsky.embed.record#viewDetached', alias='$type', frozen=True
Expand Down
11 changes: 6 additions & 5 deletions packages/atproto_client/models/app/bsky/embed/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

from pydantic import Field

from atproto_client.models import string_formats

if t.TYPE_CHECKING:
from atproto_client import models
from atproto_client.models import string_formats
from atproto_client.models.blob_ref import BlobRef
from atproto_client.models import base

Expand All @@ -33,7 +34,7 @@ class Caption(base.ModelBase):
"""Definition model for :obj:`app.bsky.embed.video`."""

file: 'BlobRef' #: File.
lang: 'string_formats.Language' #: Lang.
lang: string_formats.Language #: Lang.

py_type: t.Literal['app.bsky.embed.video#caption'] = Field(
default='app.bsky.embed.video#caption', alias='$type', frozen=True
Expand All @@ -43,11 +44,11 @@ class Caption(base.ModelBase):
class View(base.ModelBase):
"""Definition model for :obj:`app.bsky.embed.video`."""

cid: 'string_formats.Cid' #: Cid.
playlist: 'string_formats.Uri' #: Playlist.
cid: string_formats.Cid #: Cid.
playlist: string_formats.Uri #: Playlist.
alt: t.Optional[str] = Field(default=None, max_length=10000) #: Alt.
aspect_ratio: t.Optional['models.AppBskyEmbedDefs.AspectRatio'] = None #: Aspect ratio.
thumbnail: t.Optional['string_formats.Uri'] = None #: Thumbnail.
thumbnail: t.Optional[string_formats.Uri] = None #: Thumbnail.

py_type: t.Literal['app.bsky.embed.video#view'] = Field(
default='app.bsky.embed.video#view', alias='$type', frozen=True
Expand Down
Loading

0 comments on commit 4a1afbc

Please sign in to comment.