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 dced566 committed 2024-12-16T23:20:46Z #502

Merged
merged 1 commit into from
Dec 17, 2024
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
1 change: 1 addition & 0 deletions docs/source/aliases_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
'models.AppBskyUnspeccedGetPopularFeedGenerators': 'atproto_client.models.app.bsky.unspecced.get_popular_feed_generators',
'models.AppBskyUnspeccedGetSuggestionsSkeleton': 'atproto_client.models.app.bsky.unspecced.get_suggestions_skeleton',
'models.AppBskyUnspeccedGetTaggedSuggestions': 'atproto_client.models.app.bsky.unspecced.get_tagged_suggestions',
'models.AppBskyUnspeccedGetTrendingTopics': 'atproto_client.models.app.bsky.unspecced.get_trending_topics',
'models.AppBskyUnspeccedSearchActorsSkeleton': 'atproto_client.models.app.bsky.unspecced.search_actors_skeleton',
'models.AppBskyUnspeccedSearchPostsSkeleton': 'atproto_client.models.app.bsky.unspecced.search_posts_skeleton',
'models.AppBskyUnspeccedSearchStarterPacksSkeleton': 'atproto_client.models.app.bsky.unspecced.search_starter_packs_skeleton',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
app.bsky.unspecced.get\_trending\_topics
===============================================================

.. automodule:: atproto_client.models.app.bsky.unspecced.get_trending_topics
:members:
:undoc-members:
:show-inheritance:
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Submodules
atproto_client.models.app.bsky.unspecced.get_popular_feed_generators
atproto_client.models.app.bsky.unspecced.get_suggestions_skeleton
atproto_client.models.app.bsky.unspecced.get_tagged_suggestions
atproto_client.models.app.bsky.unspecced.get_trending_topics
atproto_client.models.app.bsky.unspecced.search_actors_skeleton
atproto_client.models.app.bsky.unspecced.search_posts_skeleton
atproto_client.models.app.bsky.unspecced.search_starter_packs_skeleton
10 changes: 10 additions & 0 deletions lexicons/app.bsky.unspecced.defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@
"properties": {
"uri": { "type": "string", "format": "at-uri" }
}
},
"trendingTopic": {
"type": "object",
"required": ["topic", "link"],
"properties": {
"topic": { "type": "string" },
"displayName": { "type": "string" },
"description": { "type": "string" },
"link": { "type": "string" }
}
}
}
}
49 changes: 49 additions & 0 deletions lexicons/app.bsky.unspecced.getTrendingTopics.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"lexicon": 1,
"id": "app.bsky.unspecced.getTrendingTopics",
"defs": {
"main": {
"type": "query",
"description": "Get a list of trending topics",
"parameters": {
"type": "params",
"properties": {
"viewer": {
"type": "string",
"format": "did",
"description": "DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking."
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 25,
"default": 10
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["topics", "suggested"],
"properties": {
"topics": {
"type": "array",
"items": {
"type": "ref",
"ref": "app.bsky.unspecced.defs#trendingTopic"
}
},
"suggested": {
"type": "array",
"items": {
"type": "ref",
"ref": "app.bsky.unspecced.defs#trendingTopic"
}
}
}
}
}
}
}
}
2 changes: 2 additions & 0 deletions packages/atproto_client/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
)
from atproto_client.models.app.bsky.unspecced import get_suggestions_skeleton as AppBskyUnspeccedGetSuggestionsSkeleton
from atproto_client.models.app.bsky.unspecced import get_tagged_suggestions as AppBskyUnspeccedGetTaggedSuggestions
from atproto_client.models.app.bsky.unspecced import get_trending_topics as AppBskyUnspeccedGetTrendingTopics
from atproto_client.models.app.bsky.unspecced import search_actors_skeleton as AppBskyUnspeccedSearchActorsSkeleton
from atproto_client.models.app.bsky.unspecced import search_posts_skeleton as AppBskyUnspeccedSearchPostsSkeleton
from atproto_client.models.app.bsky.unspecced import (
Expand Down Expand Up @@ -329,6 +330,7 @@ class _Ids:
AppBskyUnspeccedGetPopularFeedGenerators: str = 'app.bsky.unspecced.getPopularFeedGenerators'
AppBskyUnspeccedGetSuggestionsSkeleton: str = 'app.bsky.unspecced.getSuggestionsSkeleton'
AppBskyUnspeccedGetTaggedSuggestions: str = 'app.bsky.unspecced.getTaggedSuggestions'
AppBskyUnspeccedGetTrendingTopics: str = 'app.bsky.unspecced.getTrendingTopics'
AppBskyUnspeccedSearchActorsSkeleton: str = 'app.bsky.unspecced.searchActorsSkeleton'
AppBskyUnspeccedSearchPostsSkeleton: str = 'app.bsky.unspecced.searchPostsSkeleton'
AppBskyUnspeccedSearchStarterPacksSkeleton: str = 'app.bsky.unspecced.searchStarterPacksSkeleton'
Expand Down
13 changes: 13 additions & 0 deletions packages/atproto_client/models/app/bsky/unspecced/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,16 @@ class SkeletonSearchStarterPack(base.ModelBase):
py_type: t.Literal['app.bsky.unspecced.defs#skeletonSearchStarterPack'] = Field(
default='app.bsky.unspecced.defs#skeletonSearchStarterPack', alias='$type', frozen=True
)


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

link: str #: Link.
topic: str #: Topic.
description: t.Optional[str] = None #: Description.
display_name: t.Optional[str] = None #: Display name.

py_type: t.Literal['app.bsky.unspecced.defs#trendingTopic'] = Field(
default='app.bsky.unspecced.defs#trendingTopic', alias='$type', frozen=True
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
##################################################################
# 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

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 base


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

limit: t.Optional[int] = Field(default=10, ge=1, le=25) #: Limit.
viewer: t.Optional[string_formats.Did] = (
None #: DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking.
)


class ParamsDict(t.TypedDict):
limit: te.NotRequired[t.Optional[int]] #: Limit.
viewer: te.NotRequired[
t.Optional[string_formats.Did]
] #: DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking.


class Response(base.ResponseModelBase):
"""Output data model for :obj:`app.bsky.unspecced.getTrendingTopics`."""

suggested: t.List['models.AppBskyUnspeccedDefs.TrendingTopic'] #: Suggested.
topics: t.List['models.AppBskyUnspeccedDefs.TrendingTopic'] #: Topics.
30 changes: 30 additions & 0 deletions packages/atproto_client/namespaces/async_ns.py
Original file line number Diff line number Diff line change
Expand Up @@ -3642,6 +3642,36 @@ async def get_tagged_suggestions(
)
return get_response_model(response, models.AppBskyUnspeccedGetTaggedSuggestions.Response)

async def get_trending_topics(
self,
params: t.Optional[
t.Union[
models.AppBskyUnspeccedGetTrendingTopics.Params, models.AppBskyUnspeccedGetTrendingTopics.ParamsDict
]
] = None,
**kwargs: t.Any,
) -> 'models.AppBskyUnspeccedGetTrendingTopics.Response':
"""Get a list of trending topics.

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

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

Raises:
:class:`atproto.exceptions.AtProtocolError`: Base exception.
"""
params_model = t.cast(
'models.AppBskyUnspeccedGetTrendingTopics.Params',
get_or_create(params, models.AppBskyUnspeccedGetTrendingTopics.Params),
)
response = await self._client.invoke_query(
'app.bsky.unspecced.getTrendingTopics', params=params_model, output_encoding='application/json', **kwargs
)
return get_response_model(response, models.AppBskyUnspeccedGetTrendingTopics.Response)

async def search_actors_skeleton(
self,
params: t.Union[
Expand Down
30 changes: 30 additions & 0 deletions packages/atproto_client/namespaces/sync_ns.py
Original file line number Diff line number Diff line change
Expand Up @@ -3642,6 +3642,36 @@ def get_tagged_suggestions(
)
return get_response_model(response, models.AppBskyUnspeccedGetTaggedSuggestions.Response)

def get_trending_topics(
self,
params: t.Optional[
t.Union[
models.AppBskyUnspeccedGetTrendingTopics.Params, models.AppBskyUnspeccedGetTrendingTopics.ParamsDict
]
] = None,
**kwargs: t.Any,
) -> 'models.AppBskyUnspeccedGetTrendingTopics.Response':
"""Get a list of trending topics.

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

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

Raises:
:class:`atproto.exceptions.AtProtocolError`: Base exception.
"""
params_model = t.cast(
'models.AppBskyUnspeccedGetTrendingTopics.Params',
get_or_create(params, models.AppBskyUnspeccedGetTrendingTopics.Params),
)
response = self._client.invoke_query(
'app.bsky.unspecced.getTrendingTopics', params=params_model, output_encoding='application/json', **kwargs
)
return get_response_model(response, models.AppBskyUnspeccedGetTrendingTopics.Response)

def search_actors_skeleton(
self,
params: t.Union[
Expand Down
Loading