Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lexicons fetched from 9879ca9 committed 2023-09-14T20:24:48Z #150

Merged
merged 2 commits into from
Sep 16, 2023
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions atproto/xrpc_client/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from atproto.xrpc_client.models.app.bsky.feed import get_feed_generators as AppBskyFeedGetFeedGenerators
from atproto.xrpc_client.models.app.bsky.feed import get_feed_skeleton as AppBskyFeedGetFeedSkeleton
from atproto.xrpc_client.models.app.bsky.feed import get_likes as AppBskyFeedGetLikes
from atproto.xrpc_client.models.app.bsky.feed import get_list_feed as AppBskyFeedGetListFeed
from atproto.xrpc_client.models.app.bsky.feed import get_post_thread as AppBskyFeedGetPostThread
from atproto.xrpc_client.models.app.bsky.feed import get_posts as AppBskyFeedGetPosts
from atproto.xrpc_client.models.app.bsky.feed import get_reposted_by as AppBskyFeedGetRepostedBy
Expand All @@ -30,6 +31,7 @@
from atproto.xrpc_client.models.app.bsky.feed import like as AppBskyFeedLike
from atproto.xrpc_client.models.app.bsky.feed import post as AppBskyFeedPost
from atproto.xrpc_client.models.app.bsky.feed import repost as AppBskyFeedRepost
from atproto.xrpc_client.models.app.bsky.feed import threadgate as AppBskyFeedThreadgate
from atproto.xrpc_client.models.app.bsky.graph import block as AppBskyGraphBlock
from atproto.xrpc_client.models.app.bsky.graph import defs as AppBskyGraphDefs
from atproto.xrpc_client.models.app.bsky.graph import follow as AppBskyGraphFollow
Expand All @@ -41,6 +43,9 @@
from atproto.xrpc_client.models.app.bsky.graph import get_list_mutes as AppBskyGraphGetListMutes
from atproto.xrpc_client.models.app.bsky.graph import get_lists as AppBskyGraphGetLists
from atproto.xrpc_client.models.app.bsky.graph import get_mutes as AppBskyGraphGetMutes
from atproto.xrpc_client.models.app.bsky.graph import (
get_suggested_follows_by_actor as AppBskyGraphGetSuggestedFollowsByActor,
)
from atproto.xrpc_client.models.app.bsky.graph import list as AppBskyGraphList
from atproto.xrpc_client.models.app.bsky.graph import listblock as AppBskyGraphListblock
from atproto.xrpc_client.models.app.bsky.graph import listitem as AppBskyGraphListitem
Expand Down Expand Up @@ -165,17 +170,20 @@ class _Ids:
AppBskyGraphListblock: str = 'app.bsky.graph.listblock'
AppBskyGraphGetList: str = 'app.bsky.graph.getList'
AppBskyGraphGetMutes: str = 'app.bsky.graph.getMutes'
AppBskyGraphGetSuggestedFollowsByActor: str = 'app.bsky.graph.getSuggestedFollowsByActor'
AppBskyGraphGetFollows: str = 'app.bsky.graph.getFollows'
AppBskyGraphMuteActorList: str = 'app.bsky.graph.muteActorList'
AppBskyGraphBlock: str = 'app.bsky.graph.block'
AppBskyGraphUnmuteActorList: str = 'app.bsky.graph.unmuteActorList'
AppBskyFeedGetLikes: str = 'app.bsky.feed.getLikes'
AppBskyFeedPost: str = 'app.bsky.feed.post'
AppBskyFeedDefs: str = 'app.bsky.feed.defs'
AppBskyFeedGetListFeed: str = 'app.bsky.feed.getListFeed'
AppBskyFeedGetActorFeeds: str = 'app.bsky.feed.getActorFeeds'
AppBskyFeedGetFeedGenerators: str = 'app.bsky.feed.getFeedGenerators'
AppBskyFeedGetPostThread: str = 'app.bsky.feed.getPostThread'
AppBskyFeedGetAuthorFeed: str = 'app.bsky.feed.getAuthorFeed'
AppBskyFeedThreadgate: str = 'app.bsky.feed.threadgate'
AppBskyFeedGetPosts: str = 'app.bsky.feed.getPosts'
AppBskyFeedGetSuggestedFeeds: str = 'app.bsky.feed.getSuggestedFeeds'
AppBskyFeedGetActorLikes: str = 'app.bsky.feed.getActorLikes'
Expand Down
27 changes: 27 additions & 0 deletions atproto/xrpc_client/models/app/bsky/feed/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class PostView(base.ModelBase):
like_count: t.Optional[int] = Field(default=None, alias='likeCount') #: Like count.
reply_count: t.Optional[int] = Field(default=None, alias='replyCount') #: Reply count.
repost_count: t.Optional[int] = Field(default=None, alias='repostCount') #: Repost count.
threadgate: t.Optional['models.AppBskyFeedDefs.ThreadgateView'] = None #: Threadgate.
viewer: t.Optional['models.AppBskyFeedDefs.ViewerState'] = None #: Viewer.

py_type: te.Literal['app.bsky.feed.defs#postView'] = Field(
Expand Down Expand Up @@ -139,6 +140,7 @@ class ThreadViewPost(base.ModelBase):
]
]
] = None #: Replies.
viewer: t.Optional['models.AppBskyFeedDefs.ViewerThreadState'] = None #: Viewer.

py_type: te.Literal['app.bsky.feed.defs#threadViewPost'] = Field(
default='app.bsky.feed.defs#threadViewPost', alias='$type', frozen=True
Expand Down Expand Up @@ -182,6 +184,17 @@ class BlockedAuthor(base.ModelBase):
)


class ViewerThreadState(base.ModelBase):

"""Definition model for :obj:`app.bsky.feed.defs`."""

can_reply: t.Optional[bool] = Field(default=None, alias='canReply') #: Can reply.

py_type: te.Literal['app.bsky.feed.defs#viewerThreadState'] = Field(
default='app.bsky.feed.defs#viewerThreadState', alias='$type', frozen=True
)


class GeneratorView(base.ModelBase):

"""Definition model for :obj:`app.bsky.feed.defs`."""
Expand Down Expand Up @@ -241,3 +254,17 @@ class SkeletonReasonRepost(base.ModelBase):
py_type: te.Literal['app.bsky.feed.defs#skeletonReasonRepost'] = Field(
default='app.bsky.feed.defs#skeletonReasonRepost', alias='$type', frozen=True
)


class ThreadgateView(base.ModelBase):

"""Definition model for :obj:`app.bsky.feed.defs`."""

cid: t.Optional[str] = None #: Cid.
lists: t.Optional[t.List['models.AppBskyGraphDefs.ListViewBasic']] = None #: Lists.
record: t.Optional['UnknownType'] = None #: Record.
uri: t.Optional[str] = None #: Uri.

py_type: te.Literal['app.bsky.feed.defs#threadgateView'] = Field(
default='app.bsky.feed.defs#threadgateView', alias='$type', frozen=True
)
31 changes: 31 additions & 0 deletions atproto/xrpc_client/models/app/bsky/feed/get_list_feed.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
##################################################################
# THIS IS THE AUTO-GENERATED CODE. DON'T EDIT IT BY HANDS!
# Copyright (C) 2023 Ilya (Marshal) <https://github.com/MarshalX>.
# This file is part of Python atproto SDK. Licenced under MIT.
##################################################################


import typing as t

from pydantic import Field

if t.TYPE_CHECKING:
from atproto.xrpc_client import models
from atproto.xrpc_client.models import base


class Params(base.ParamsModelBase):

"""Parameters model for :obj:`app.bsky.feed.getListFeed`."""

list: str #: List.
cursor: t.Optional[str] = None #: Cursor.
limit: t.Optional[int] = Field(default=50, ge=1, le=100) #: Limit.


class Response(base.ResponseModelBase):

"""Output data model for :obj:`app.bsky.feed.getListFeed`."""

feed: t.List['models.AppBskyFeedDefs.FeedViewPost'] #: Feed.
cursor: t.Optional[str] = None #: Cursor.
70 changes: 70 additions & 0 deletions atproto/xrpc_client/models/app/bsky/feed/threadgate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
##################################################################
# THIS IS THE AUTO-GENERATED CODE. DON'T EDIT IT BY HANDS!
# Copyright (C) 2023 Ilya (Marshal) <https://github.com/MarshalX>.
# This file is part of Python atproto SDK. Licenced under MIT.
##################################################################


import typing as t

import typing_extensions as te
from pydantic import Field

if t.TYPE_CHECKING:
from atproto.xrpc_client import models
from atproto.xrpc_client.models import base


class MentionRule(base.ModelBase):

"""Definition model for :obj:`app.bsky.feed.threadgate`. Allow replies from actors mentioned in your post."""

py_type: te.Literal['app.bsky.feed.threadgate#mentionRule'] = Field(
default='app.bsky.feed.threadgate#mentionRule', alias='$type', frozen=True
)


class FollowingRule(base.ModelBase):

"""Definition model for :obj:`app.bsky.feed.threadgate`. Allow replies from actors you follow."""

py_type: te.Literal['app.bsky.feed.threadgate#followingRule'] = Field(
default='app.bsky.feed.threadgate#followingRule', alias='$type', frozen=True
)


class ListRule(base.ModelBase):

"""Definition model for :obj:`app.bsky.feed.threadgate`. Allow replies from actors on a list."""

list: str #: List.

py_type: te.Literal['app.bsky.feed.threadgate#listRule'] = Field(
default='app.bsky.feed.threadgate#listRule', alias='$type', frozen=True
)


class Main(base.RecordModelBase):

"""Record model for :obj:`app.bsky.feed.threadgate`."""

created_at: str = Field(alias='createdAt') #: Created at.
post: str #: Post.
allow: t.Optional[
t.List[
te.Annotated[
t.Union[
'models.AppBskyFeedThreadgate.MentionRule',
'models.AppBskyFeedThreadgate.FollowingRule',
'models.AppBskyFeedThreadgate.ListRule',
],
Field(discriminator='py_type'),
]
]
] = Field(
default=None, max_length=5
) #: Allow.

py_type: te.Literal['app.bsky.feed.threadgate'] = Field(
default='app.bsky.feed.threadgate', alias='$type', frozen=True
)
6 changes: 5 additions & 1 deletion atproto/xrpc_client/models/app/bsky/graph/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,16 @@ class ListItemView(base.ModelBase):
)


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

Modlist = te.Literal[
'app.bsky.graph.defs#modlist'
] #: A list of actors to apply an aggregate moderation action (mute/block) on

Curatelist = te.Literal[
'app.bsky.graph.defs#curatelist'
] #: A list of actors used for curation purposes such as list feeds or interaction gating


class ListViewerState(base.ModelBase):

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
##################################################################
# THIS IS THE AUTO-GENERATED CODE. DON'T EDIT IT BY HANDS!
# Copyright (C) 2023 Ilya (Marshal) <https://github.com/MarshalX>.
# This file is part of Python atproto SDK. Licenced under MIT.
##################################################################


import typing as t

if t.TYPE_CHECKING:
from atproto.xrpc_client import models
from atproto.xrpc_client.models import base


class Params(base.ParamsModelBase):

"""Parameters model for :obj:`app.bsky.graph.getSuggestedFollowsByActor`."""

actor: str #: Actor.


class Response(base.ResponseModelBase):

"""Output data model for :obj:`app.bsky.graph.getSuggestedFollowsByActor`."""

suggestions: t.List['models.AppBskyActorDefs.ProfileView'] #: Suggestions.
1 change: 1 addition & 0 deletions atproto/xrpc_client/models/type_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
'app.bsky.feed.repost': models.AppBskyFeedRepost.Main,
'app.bsky.graph.listitem': models.AppBskyGraphListitem.Main,
'app.bsky.feed.like': models.AppBskyFeedLike.Main,
'app.bsky.feed.threadgate': models.AppBskyFeedThreadgate.Main,
'app.bsky.graph.follow': models.AppBskyGraphFollow.Main,
'app.bsky.graph.list': models.AppBskyGraphList.Main,
'app.bsky.graph.listblock': models.AppBskyGraphListblock.Main,
Expand Down
2 changes: 2 additions & 0 deletions atproto/xrpc_client/models/unknown_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
'models.AppBskyFeedRepost.Main',
'models.AppBskyGraphListitem.Main',
'models.AppBskyFeedLike.Main',
'models.AppBskyFeedThreadgate.Main',
'models.AppBskyGraphFollow.Main',
'models.AppBskyGraphList.Main',
'models.AppBskyGraphListblock.Main',
Expand All @@ -26,6 +27,7 @@
'models.AppBskyFeedRepost.Main',
'models.AppBskyGraphListitem.Main',
'models.AppBskyFeedLike.Main',
'models.AppBskyFeedThreadgate.Main',
'models.AppBskyGraphFollow.Main',
'models.AppBskyGraphList.Main',
'models.AppBskyGraphListblock.Main',
Expand Down
47 changes: 47 additions & 0 deletions atproto/xrpc_client/namespaces/async_ns.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,28 @@ async def get_likes(
)
return get_response_model(response, models.AppBskyFeedGetLikes.Response)

async def get_list_feed(
self, params: t.Union[dict, 'models.AppBskyFeedGetListFeed.Params'], **kwargs
) -> 'models.AppBskyFeedGetListFeed.Response':
"""A view of a recent posts from actors in a list.

Args:
params: Parameters.
**kwargs: Arbitrary arguments to HTTP request.

Returns:
:obj:`models.AppBskyFeedGetListFeed.Response`: Output model.

Raises:
:class:`atproto.exceptions.AtProtocolError`: Base exception.
"""

params_model = get_or_create(params, models.AppBskyFeedGetListFeed.Params)
response = await self._client.invoke_query(
'app.bsky.feed.getListFeed', params=params_model, output_encoding='application/json', **kwargs
)
return get_response_model(response, models.AppBskyFeedGetListFeed.Response)

async def get_post_thread(
self, params: t.Union[dict, 'models.AppBskyFeedGetPostThread.Params'], **kwargs
) -> 'models.AppBskyFeedGetPostThread.Response':
Expand Down Expand Up @@ -668,6 +690,31 @@ async def get_mutes(
)
return get_response_model(response, models.AppBskyGraphGetMutes.Response)

async def get_suggested_follows_by_actor(
self, params: t.Union[dict, 'models.AppBskyGraphGetSuggestedFollowsByActor.Params'], **kwargs
) -> 'models.AppBskyGraphGetSuggestedFollowsByActor.Response':
"""Get suggested follows related to a given actor.

Args:
params: Parameters.
**kwargs: Arbitrary arguments to HTTP request.

Returns:
:obj:`models.AppBskyGraphGetSuggestedFollowsByActor.Response`: Output model.

Raises:
:class:`atproto.exceptions.AtProtocolError`: Base exception.
"""

params_model = get_or_create(params, models.AppBskyGraphGetSuggestedFollowsByActor.Params)
response = await self._client.invoke_query(
'app.bsky.graph.getSuggestedFollowsByActor',
params=params_model,
output_encoding='application/json',
**kwargs,
)
return get_response_model(response, models.AppBskyGraphGetSuggestedFollowsByActor.Response)

async def mute_actor(self, data: t.Union[dict, 'models.AppBskyGraphMuteActor.Data'], **kwargs) -> bool:
"""Mute an actor by did or handle.

Expand Down
47 changes: 47 additions & 0 deletions atproto/xrpc_client/namespaces/sync_ns.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,28 @@ def get_likes(
)
return get_response_model(response, models.AppBskyFeedGetLikes.Response)

def get_list_feed(
self, params: t.Union[dict, 'models.AppBskyFeedGetListFeed.Params'], **kwargs
) -> 'models.AppBskyFeedGetListFeed.Response':
"""A view of a recent posts from actors in a list.

Args:
params: Parameters.
**kwargs: Arbitrary arguments to HTTP request.

Returns:
:obj:`models.AppBskyFeedGetListFeed.Response`: Output model.

Raises:
:class:`atproto.exceptions.AtProtocolError`: Base exception.
"""

params_model = get_or_create(params, models.AppBskyFeedGetListFeed.Params)
response = self._client.invoke_query(
'app.bsky.feed.getListFeed', params=params_model, output_encoding='application/json', **kwargs
)
return get_response_model(response, models.AppBskyFeedGetListFeed.Response)

def get_post_thread(
self, params: t.Union[dict, 'models.AppBskyFeedGetPostThread.Params'], **kwargs
) -> 'models.AppBskyFeedGetPostThread.Response':
Expand Down Expand Up @@ -668,6 +690,31 @@ def get_mutes(
)
return get_response_model(response, models.AppBskyGraphGetMutes.Response)

def get_suggested_follows_by_actor(
self, params: t.Union[dict, 'models.AppBskyGraphGetSuggestedFollowsByActor.Params'], **kwargs
) -> 'models.AppBskyGraphGetSuggestedFollowsByActor.Response':
"""Get suggested follows related to a given actor.

Args:
params: Parameters.
**kwargs: Arbitrary arguments to HTTP request.

Returns:
:obj:`models.AppBskyGraphGetSuggestedFollowsByActor.Response`: Output model.

Raises:
:class:`atproto.exceptions.AtProtocolError`: Base exception.
"""

params_model = get_or_create(params, models.AppBskyGraphGetSuggestedFollowsByActor.Params)
response = self._client.invoke_query(
'app.bsky.graph.getSuggestedFollowsByActor',
params=params_model,
output_encoding='application/json',
**kwargs,
)
return get_response_model(response, models.AppBskyGraphGetSuggestedFollowsByActor.Response)

def mute_actor(self, data: t.Union[dict, 'models.AppBskyGraphMuteActor.Data'], **kwargs) -> bool:
"""Mute an actor by did or handle.

Expand Down
Loading