Skip to content

Commit

Permalink
Update lexicons fetched from 76c91f8 committed 2024-07-23T19:33:01Z
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshalX committed Jul 26, 2024
1 parent ddc6e35 commit e36a562
Show file tree
Hide file tree
Showing 12 changed files with 111 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/aliases_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
'models.AppBskyLabelerService': 'atproto_client.models.app.bsky.labeler.service',
'models.AppBskyNotificationGetUnreadCount': 'atproto_client.models.app.bsky.notification.get_unread_count',
'models.AppBskyNotificationListNotifications': 'atproto_client.models.app.bsky.notification.list_notifications',
'models.AppBskyNotificationPutPreferences': 'atproto_client.models.app.bsky.notification.put_preferences',
'models.AppBskyNotificationRegisterPush': 'atproto_client.models.app.bsky.notification.register_push',
'models.AppBskyNotificationUpdateSeen': 'atproto_client.models.app.bsky.notification.update_seen',
'models.AppBskyRichtextFacet': 'atproto_client.models.app.bsky.richtext.facet',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
app.bsky.notification.put\_preferences
=============================================================

.. automodule:: atproto_client.models.app.bsky.notification.put_preferences
:members:
:undoc-members:
:show-inheritance:
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ Submodules

atproto_client.models.app.bsky.notification.get_unread_count
atproto_client.models.app.bsky.notification.list_notifications
atproto_client.models.app.bsky.notification.put_preferences
atproto_client.models.app.bsky.notification.register_push
atproto_client.models.app.bsky.notification.update_seen
1 change: 1 addition & 0 deletions lexicons/app.bsky.notification.getUnreadCount.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"parameters": {
"type": "params",
"properties": {
"priority": { "type": "boolean" },
"seenAt": { "type": "string", "format": "datetime" }
}
},
Expand Down
2 changes: 2 additions & 0 deletions lexicons/app.bsky.notification.listNotifications.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"maximum": 100,
"default": 50
},
"priority": { "type": "boolean" },
"cursor": { "type": "string" },
"seenAt": { "type": "string", "format": "datetime" }
}
Expand All @@ -29,6 +30,7 @@
"type": "array",
"items": { "type": "ref", "ref": "#notification" }
},
"priority": { "type": "boolean" },
"seenAt": { "type": "string", "format": "datetime" }
}
}
Expand Down
20 changes: 20 additions & 0 deletions lexicons/app.bsky.notification.putPreferences.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"lexicon": 1,
"id": "app.bsky.notification.putPreferences",
"defs": {
"main": {
"type": "procedure",
"description": "Set notification-related preferences for an account. Requires auth.",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["priority"],
"properties": {
"priority": { "type": "boolean" }
}
}
}
}
}
}
2 changes: 2 additions & 0 deletions packages/atproto_client/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
from atproto_client.models.app.bsky.labeler import service as AppBskyLabelerService
from atproto_client.models.app.bsky.notification import get_unread_count as AppBskyNotificationGetUnreadCount
from atproto_client.models.app.bsky.notification import list_notifications as AppBskyNotificationListNotifications
from atproto_client.models.app.bsky.notification import put_preferences as AppBskyNotificationPutPreferences
from atproto_client.models.app.bsky.notification import register_push as AppBskyNotificationRegisterPush
from atproto_client.models.app.bsky.notification import update_seen as AppBskyNotificationUpdateSeen
from atproto_client.models.app.bsky.richtext import facet as AppBskyRichtextFacet
Expand Down Expand Up @@ -282,6 +283,7 @@ class _Ids:
AppBskyLabelerService: str = 'app.bsky.labeler.service'
AppBskyNotificationGetUnreadCount: str = 'app.bsky.notification.getUnreadCount'
AppBskyNotificationListNotifications: str = 'app.bsky.notification.listNotifications'
AppBskyNotificationPutPreferences: str = 'app.bsky.notification.putPreferences'
AppBskyNotificationRegisterPush: str = 'app.bsky.notification.registerPush'
AppBskyNotificationUpdateSeen: str = 'app.bsky.notification.updateSeen'
AppBskyRichtextFacet: str = 'app.bsky.richtext.facet'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
class Params(base.ParamsModelBase):
"""Parameters model for :obj:`app.bsky.notification.getUnreadCount`."""

priority: t.Optional[bool] = None #: Priority.
seen_at: t.Optional[str] = None #: Seen at.


class ParamsDict(t.TypedDict):
priority: te.NotRequired[t.Optional[bool]] #: Priority.
seen_at: te.NotRequired[t.Optional[str]] #: Seen at.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ class Params(base.ParamsModelBase):

cursor: t.Optional[str] = None #: Cursor.
limit: t.Optional[int] = Field(default=50, ge=1, le=100) #: Limit.
priority: t.Optional[bool] = None #: Priority.
seen_at: t.Optional[str] = None #: Seen at.


class ParamsDict(t.TypedDict):
cursor: te.NotRequired[t.Optional[str]] #: Cursor.
limit: te.NotRequired[t.Optional[int]] #: Limit.
priority: te.NotRequired[t.Optional[bool]] #: Priority.
seen_at: te.NotRequired[t.Optional[str]] #: Seen at.


Expand All @@ -35,6 +37,7 @@ class Response(base.ResponseModelBase):

notifications: t.List['models.AppBskyNotificationListNotifications.Notification'] #: Notifications.
cursor: t.Optional[str] = None #: Cursor.
priority: t.Optional[bool] = None #: Priority.
seen_at: t.Optional[str] = None #: Seen at.


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


import typing as t

from atproto_client.models import base


class Data(base.DataModelBase):
"""Input data model for :obj:`app.bsky.notification.putPreferences`."""

priority: bool #: Priority.


class DataDict(t.TypedDict):
priority: bool #: Priority.
26 changes: 26 additions & 0 deletions packages/atproto_client/namespaces/async_ns.py
Original file line number Diff line number Diff line change
Expand Up @@ -3242,6 +3242,32 @@ async def list_notifications(
)
return get_response_model(response, models.AppBskyNotificationListNotifications.Response)

async def put_preferences(
self,
data: t.Union[models.AppBskyNotificationPutPreferences.Data, models.AppBskyNotificationPutPreferences.DataDict],
**kwargs: t.Any,
) -> bool:
"""Set notification-related preferences for an account. Requires auth.
Args:
data: Input data.
**kwargs: Arbitrary arguments to HTTP request.
Returns:
:obj:`bool`: Success status.
Raises:
:class:`atproto.exceptions.AtProtocolError`: Base exception.
"""
data_model = t.cast(
'models.AppBskyNotificationPutPreferences.Data',
get_or_create(data, models.AppBskyNotificationPutPreferences.Data),
)
response = await self._client.invoke_procedure(
'app.bsky.notification.putPreferences', data=data_model, input_encoding='application/json', **kwargs
)
return get_response_model(response, bool)

async def register_push(
self,
data: t.Union[models.AppBskyNotificationRegisterPush.Data, models.AppBskyNotificationRegisterPush.DataDict],
Expand Down
26 changes: 26 additions & 0 deletions packages/atproto_client/namespaces/sync_ns.py
Original file line number Diff line number Diff line change
Expand Up @@ -3242,6 +3242,32 @@ def list_notifications(
)
return get_response_model(response, models.AppBskyNotificationListNotifications.Response)

def put_preferences(
self,
data: t.Union[models.AppBskyNotificationPutPreferences.Data, models.AppBskyNotificationPutPreferences.DataDict],
**kwargs: t.Any,
) -> bool:
"""Set notification-related preferences for an account. Requires auth.
Args:
data: Input data.
**kwargs: Arbitrary arguments to HTTP request.
Returns:
:obj:`bool`: Success status.
Raises:
:class:`atproto.exceptions.AtProtocolError`: Base exception.
"""
data_model = t.cast(
'models.AppBskyNotificationPutPreferences.Data',
get_or_create(data, models.AppBskyNotificationPutPreferences.Data),
)
response = self._client.invoke_procedure(
'app.bsky.notification.putPreferences', data=data_model, input_encoding='application/json', **kwargs
)
return get_response_model(response, bool)

def register_push(
self,
data: t.Union[models.AppBskyNotificationRegisterPush.Data, models.AppBskyNotificationRegisterPush.DataDict],
Expand Down

0 comments on commit e36a562

Please sign in to comment.