Skip to content

Commit

Permalink
Avoid name conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
mnogu committed May 4, 2023
1 parent 76010da commit b909997
Show file tree
Hide file tree
Showing 36 changed files with 175 additions and 197 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You can also post with `com.atproto.repo.create_record()`:
```python
from datetime import datetime
from chitose.agent import BskyAgent
from chitose.app.bsky.feed import Post
from chitose.app.bsky.feed.post import Post

agent = BskyAgent(service='https://example.com')
agent.login(identifier='alice@mail.com', password='hunter2')
Expand Down
8 changes: 1 addition & 7 deletions chitose/app/bsky/actor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@
from .get_suggestions import _get_suggestions
from .search_actors import _search_actors
from .search_actors_typeahead import _search_actors_typeahead
from .defs import *
from .get_profile import *
from .get_profiles import *
from .get_suggestions import *
from .profile import *
from .search_actors import *
from .search_actors_typeahead import *
import typing

class Actor_:

Expand Down
7 changes: 4 additions & 3 deletions chitose/app/bsky/actor/defs.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# GENERATED CODE - DO NOT MODIFY
from __future__ import annotations
import chitose
import chitose.app.bsky.actor.defs
import chitose.com.atproto.label.defs
import typing

class ProfileViewBasic(chitose.Object):

def __init__(self, did: str, handle: str, display_name: typing.Optional[str]=None, avatar: typing.Optional[str]=None, viewer: typing.Optional[ViewerState]=None, labels: typing.Optional[list[chitose.com.atproto.label.defs.Label]]=None) -> None:
def __init__(self, did: str, handle: str, display_name: typing.Optional[str]=None, avatar: typing.Optional[str]=None, viewer: typing.Optional[chitose.app.bsky.actor.defs.ViewerState]=None, labels: typing.Optional[list[chitose.com.atproto.label.defs.Label]]=None) -> None:
self.did = did
self.handle = handle
self.display_name = display_name
Expand All @@ -19,7 +20,7 @@ def to_dict(self):

class ProfileView(chitose.Object):

def __init__(self, did: str, handle: str, display_name: typing.Optional[str]=None, description: typing.Optional[str]=None, avatar: typing.Optional[str]=None, indexed_at: typing.Optional[str]=None, viewer: typing.Optional[ViewerState]=None, labels: typing.Optional[list[chitose.com.atproto.label.defs.Label]]=None) -> None:
def __init__(self, did: str, handle: str, display_name: typing.Optional[str]=None, description: typing.Optional[str]=None, avatar: typing.Optional[str]=None, indexed_at: typing.Optional[str]=None, viewer: typing.Optional[chitose.app.bsky.actor.defs.ViewerState]=None, labels: typing.Optional[list[chitose.com.atproto.label.defs.Label]]=None) -> None:
self.did = did
self.handle = handle
self.display_name = display_name
Expand All @@ -34,7 +35,7 @@ def to_dict(self):

class ProfileViewDetailed(chitose.Object):

def __init__(self, did: str, handle: str, display_name: typing.Optional[str]=None, description: typing.Optional[str]=None, avatar: typing.Optional[str]=None, banner: typing.Optional[str]=None, followers_count: typing.Optional[int]=None, follows_count: typing.Optional[int]=None, posts_count: typing.Optional[int]=None, indexed_at: typing.Optional[str]=None, viewer: typing.Optional[ViewerState]=None, labels: typing.Optional[list[chitose.com.atproto.label.defs.Label]]=None) -> None:
def __init__(self, did: str, handle: str, display_name: typing.Optional[str]=None, description: typing.Optional[str]=None, avatar: typing.Optional[str]=None, banner: typing.Optional[str]=None, followers_count: typing.Optional[int]=None, follows_count: typing.Optional[int]=None, posts_count: typing.Optional[int]=None, indexed_at: typing.Optional[str]=None, viewer: typing.Optional[chitose.app.bsky.actor.defs.ViewerState]=None, labels: typing.Optional[list[chitose.com.atproto.label.defs.Label]]=None) -> None:
self.did = did
self.handle = handle
self.display_name = display_name
Expand Down
4 changes: 0 additions & 4 deletions chitose/app/bsky/embed/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# GENERATED CODE - DO NOT MODIFY
from __future__ import annotations
from .external import *
from .images import *
from .record import *
from .record_with_media import *

class Embed_:

Expand Down
7 changes: 4 additions & 3 deletions chitose/app/bsky/embed/external.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# GENERATED CODE - DO NOT MODIFY
from __future__ import annotations
import chitose
import chitose.app.bsky.embed.external
import typing

class External(chitose.Object):

def __init__(self, external: External) -> None:
def __init__(self, external: chitose.app.bsky.embed.external.ExternalExternal) -> None:
self.external = external

def to_dict(self):
return {'external': self.external}

class External(chitose.Object):
class ExternalExternal(chitose.Object):

def __init__(self, uri: str, title: str, description: str, thumb: typing.Optional[typing.Any]=None) -> None:
self.uri = uri
Expand All @@ -24,7 +25,7 @@ def to_dict(self):

class View(chitose.Object):

def __init__(self, external: ViewExternal) -> None:
def __init__(self, external: chitose.app.bsky.embed.external.ViewExternal) -> None:
self.external = external

def to_dict(self):
Expand Down
5 changes: 3 additions & 2 deletions chitose/app/bsky/embed/images.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# GENERATED CODE - DO NOT MODIFY
from __future__ import annotations
import chitose
import chitose.app.bsky.embed.images
import typing

class Images(chitose.Object):

def __init__(self, images: list[Image]) -> None:
def __init__(self, images: list[chitose.app.bsky.embed.images.Image]) -> None:
self.images = images

def to_dict(self):
Expand All @@ -22,7 +23,7 @@ def to_dict(self):

class View(chitose.Object):

def __init__(self, images: list[ViewImage]) -> None:
def __init__(self, images: list[chitose.app.bsky.embed.images.ViewImage]) -> None:
self.images = images

def to_dict(self):
Expand Down
9 changes: 5 additions & 4 deletions chitose/app/bsky/embed/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,31 @@
import chitose.app.bsky.actor.defs
import chitose.app.bsky.embed.external
import chitose.app.bsky.embed.images
import chitose.app.bsky.embed.record
import chitose.app.bsky.embed.record_with_media
import chitose.com.atproto.label.defs
import chitose.com.atproto.repo
import chitose.com.atproto.repo.strong_ref
import typing

class Record(chitose.Object):

def __init__(self, record: chitose.com.atproto.repo.StrongRef) -> None:
def __init__(self, record: chitose.com.atproto.repo.strong_ref.StrongRef) -> None:
self.record = record

def to_dict(self):
return {'record': self.record}

class View(chitose.Object):

def __init__(self, record: typing.Union[ViewRecord, ViewNotFound, ViewBlocked]) -> None:
def __init__(self, record: typing.Union[chitose.app.bsky.embed.record.ViewRecord, chitose.app.bsky.embed.record.ViewNotFound, chitose.app.bsky.embed.record.ViewBlocked]) -> None:
self.record = record

def to_dict(self):
return {'record': self.record}

class ViewRecord(chitose.Object):

def __init__(self, uri: str, cid: str, author: chitose.app.bsky.actor.defs.ProfileViewBasic, value: typing.Any, indexed_at: str, labels: typing.Optional[list[chitose.com.atproto.label.defs.Label]]=None, embeds: typing.Optional[list[typing.Union[chitose.app.bsky.embed.images.View, chitose.app.bsky.embed.external.View, View, chitose.app.bsky.embed.record_with_media.View]]]=None) -> None:
def __init__(self, uri: str, cid: str, author: chitose.app.bsky.actor.defs.ProfileViewBasic, value: typing.Any, indexed_at: str, labels: typing.Optional[list[chitose.com.atproto.label.defs.Label]]=None, embeds: typing.Optional[list[typing.Union[chitose.app.bsky.embed.images.View, chitose.app.bsky.embed.external.View, chitose.app.bsky.embed.record.View, chitose.app.bsky.embed.record_with_media.View]]]=None) -> None:
self.uri = uri
self.cid = cid
self.author = author
Expand Down
3 changes: 1 addition & 2 deletions chitose/app/bsky/embed/record_with_media.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# GENERATED CODE - DO NOT MODIFY
from __future__ import annotations
import chitose
import chitose.app.bsky.embed
import chitose.app.bsky.embed.external
import chitose.app.bsky.embed.images
import chitose.app.bsky.embed.record
import typing

class RecordWithMedia(chitose.Object):

def __init__(self, record: chitose.app.bsky.embed.Record, media: typing.Union[chitose.app.bsky.embed.Images, chitose.app.bsky.embed.External]) -> None:
def __init__(self, record: chitose.app.bsky.embed.record.Record, media: typing.Union[chitose.app.bsky.embed.images.Images, chitose.app.bsky.embed.external.External]) -> None:
self.record = record
self.media = media

Expand Down
12 changes: 2 additions & 10 deletions chitose/app/bsky/feed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,8 @@
from .get_posts import _get_posts
from .get_reposted_by import _get_reposted_by
from .get_timeline import _get_timeline
from .defs import *
from .get_author_feed import *
from .get_likes import *
from .get_post_thread import *
from .get_posts import *
from .get_reposted_by import *
from .get_timeline import *
from .like import *
from .post import *
from .repost import *
import chitose
import typing

class Feed_:

Expand Down
9 changes: 5 additions & 4 deletions chitose/app/bsky/feed/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
import chitose.app.bsky.embed.images
import chitose.app.bsky.embed.record
import chitose.app.bsky.embed.record_with_media
import chitose.app.bsky.feed.defs
import chitose.com.atproto.label.defs
import typing

class PostView(chitose.Object):

def __init__(self, uri: str, cid: str, author: chitose.app.bsky.actor.defs.ProfileViewBasic, record: typing.Any, indexed_at: str, embed: typing.Optional[typing.Union[chitose.app.bsky.embed.images.View, chitose.app.bsky.embed.external.View, chitose.app.bsky.embed.record.View, chitose.app.bsky.embed.record_with_media.View]]=None, reply_count: typing.Optional[int]=None, repost_count: typing.Optional[int]=None, like_count: typing.Optional[int]=None, viewer: typing.Optional[ViewerState]=None, labels: typing.Optional[list[chitose.com.atproto.label.defs.Label]]=None) -> None:
def __init__(self, uri: str, cid: str, author: chitose.app.bsky.actor.defs.ProfileViewBasic, record: typing.Any, indexed_at: str, embed: typing.Optional[typing.Union[chitose.app.bsky.embed.images.View, chitose.app.bsky.embed.external.View, chitose.app.bsky.embed.record.View, chitose.app.bsky.embed.record_with_media.View]]=None, reply_count: typing.Optional[int]=None, repost_count: typing.Optional[int]=None, like_count: typing.Optional[int]=None, viewer: typing.Optional[chitose.app.bsky.feed.defs.ViewerState]=None, labels: typing.Optional[list[chitose.com.atproto.label.defs.Label]]=None) -> None:
self.uri = uri
self.cid = cid
self.author = author
Expand All @@ -38,7 +39,7 @@ def to_dict(self):

class FeedViewPost(chitose.Object):

def __init__(self, post: PostView, reply: typing.Optional[ReplyRef]=None, reason: typing.Optional[ReasonRepost]=None) -> None:
def __init__(self, post: chitose.app.bsky.feed.defs.PostView, reply: typing.Optional[chitose.app.bsky.feed.defs.ReplyRef]=None, reason: typing.Optional[chitose.app.bsky.feed.defs.ReasonRepost]=None) -> None:
self.post = post
self.reply = reply
self.reason = reason
Expand All @@ -48,7 +49,7 @@ def to_dict(self):

class ReplyRef(chitose.Object):

def __init__(self, root: PostView, parent: PostView) -> None:
def __init__(self, root: chitose.app.bsky.feed.defs.PostView, parent: chitose.app.bsky.feed.defs.PostView) -> None:
self.root = root
self.parent = parent

Expand All @@ -66,7 +67,7 @@ def to_dict(self):

class ThreadViewPost(chitose.Object):

def __init__(self, post: PostView, parent: typing.Optional[typing.Union[ThreadViewPost, NotFoundPost, BlockedPost]]=None, replies: typing.Optional[list[typing.Union[ThreadViewPost, NotFoundPost, BlockedPost]]]=None) -> None:
def __init__(self, post: chitose.app.bsky.feed.defs.PostView, parent: typing.Optional[typing.Union[chitose.app.bsky.feed.defs.ThreadViewPost, chitose.app.bsky.feed.defs.NotFoundPost, chitose.app.bsky.feed.defs.BlockedPost]]=None, replies: typing.Optional[list[typing.Union[chitose.app.bsky.feed.defs.ThreadViewPost, chitose.app.bsky.feed.defs.NotFoundPost, chitose.app.bsky.feed.defs.BlockedPost]]]=None) -> None:
self.post = post
self.parent = parent
self.replies = replies
Expand Down
4 changes: 2 additions & 2 deletions chitose/app/bsky/feed/like.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# GENERATED CODE - DO NOT MODIFY
from __future__ import annotations
import chitose
import chitose.com.atproto.repo
import chitose.com.atproto.repo.strong_ref

class Like(chitose.Record):

def __init__(self, subject: chitose.com.atproto.repo.StrongRef, created_at: str) -> None:
def __init__(self, subject: chitose.com.atproto.repo.strong_ref.StrongRef, created_at: str) -> None:
self.subject = subject
self.created_at = created_at

Expand Down
16 changes: 10 additions & 6 deletions chitose/app/bsky/feed/post.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# GENERATED CODE - DO NOT MODIFY
from __future__ import annotations
import chitose
import chitose.app.bsky.embed
import chitose.app.bsky.richtext
import chitose.com.atproto.repo
import chitose.app.bsky.embed.external
import chitose.app.bsky.embed.images
import chitose.app.bsky.embed.record
import chitose.app.bsky.embed.record_with_media
import chitose.app.bsky.feed.post
import chitose.app.bsky.richtext.facet
import chitose.com.atproto.repo.strong_ref
import typing

class Post(chitose.Record):

def __init__(self, text: str, created_at: str, entities: typing.Optional[list[Entity]]=None, facets: typing.Optional[list[chitose.app.bsky.richtext.Facet]]=None, reply: typing.Optional[ReplyRef]=None, embed: typing.Optional[typing.Union[chitose.app.bsky.embed.Images, chitose.app.bsky.embed.External, chitose.app.bsky.embed.Record, chitose.app.bsky.embed.RecordWithMedia]]=None) -> None:
def __init__(self, text: str, created_at: str, entities: typing.Optional[list[chitose.app.bsky.feed.post.Entity]]=None, facets: typing.Optional[list[chitose.app.bsky.richtext.facet.Facet]]=None, reply: typing.Optional[chitose.app.bsky.feed.post.ReplyRef]=None, embed: typing.Optional[typing.Union[chitose.app.bsky.embed.images.Images, chitose.app.bsky.embed.external.External, chitose.app.bsky.embed.record.Record, chitose.app.bsky.embed.record_with_media.RecordWithMedia]]=None) -> None:
self.text = text
self.created_at = created_at
self.entities = entities
Expand All @@ -21,7 +25,7 @@ def to_dict(self):

class ReplyRef(chitose.Object):

def __init__(self, root: chitose.com.atproto.repo.StrongRef, parent: chitose.com.atproto.repo.StrongRef) -> None:
def __init__(self, root: chitose.com.atproto.repo.strong_ref.StrongRef, parent: chitose.com.atproto.repo.strong_ref.StrongRef) -> None:
self.root = root
self.parent = parent

Expand All @@ -30,7 +34,7 @@ def to_dict(self):

class Entity(chitose.Object):

def __init__(self, index: TextSlice, type: str, value: str) -> None:
def __init__(self, index: chitose.app.bsky.feed.post.TextSlice, type: str, value: str) -> None:
self.index = index
self.type = type
self.value = value
Expand Down
4 changes: 2 additions & 2 deletions chitose/app/bsky/feed/repost.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# GENERATED CODE - DO NOT MODIFY
from __future__ import annotations
import chitose
import chitose.com.atproto.repo
import chitose.com.atproto.repo.strong_ref

class Repost(chitose.Record):

def __init__(self, subject: chitose.com.atproto.repo.StrongRef, created_at: str) -> None:
def __init__(self, subject: chitose.com.atproto.repo.strong_ref.StrongRef, created_at: str) -> None:
self.subject = subject
self.created_at = created_at

Expand Down
9 changes: 1 addition & 8 deletions chitose/app/bsky/graph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@
from .get_mutes import _get_mutes
from .mute_actor import _mute_actor
from .unmute_actor import _unmute_actor
from .block import *
from .follow import *
from .get_blocks import *
from .get_followers import *
from .get_follows import *
from .get_mutes import *
from .mute_actor import *
from .unmute_actor import *
import typing

class Graph_:

Expand Down
5 changes: 2 additions & 3 deletions chitose/app/bsky/notification/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
from .get_unread_count import _get_unread_count
from .list_notifications import _list_notifications
from .update_seen import _update_seen
from .get_unread_count import *
from .list_notifications import *
from .update_seen import *
import chitose
import typing

class Notification_:

Expand Down
1 change: 0 additions & 1 deletion chitose/app/bsky/richtext/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# GENERATED CODE - DO NOT MODIFY
from __future__ import annotations
from .facet import *

class Richtext_:

Expand Down
3 changes: 2 additions & 1 deletion chitose/app/bsky/richtext/facet.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# GENERATED CODE - DO NOT MODIFY
from __future__ import annotations
import chitose
import chitose.app.bsky.richtext.facet
import typing

class Facet(chitose.Object):

def __init__(self, index: ByteSlice, features: list[typing.Union[Mention, Link]]) -> None:
def __init__(self, index: chitose.app.bsky.richtext.facet.ByteSlice, features: list[typing.Union[chitose.app.bsky.richtext.facet.Mention, chitose.app.bsky.richtext.facet.Link]]) -> None:
self.index = index
self.features = features

Expand Down
2 changes: 1 addition & 1 deletion chitose/app/bsky/unspecced/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# GENERATED CODE - DO NOT MODIFY
from __future__ import annotations
from .get_popular import _get_popular
from .get_popular import *
import typing

class Unspecced_:

Expand Down
19 changes: 3 additions & 16 deletions chitose/com/atproto/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,8 @@
from .take_moderation_action import _take_moderation_action
from .update_account_email import _update_account_email
from .update_account_handle import _update_account_handle
from .defs import *
from .disable_invite_codes import *
from .get_invite_codes import *
from .get_moderation_action import *
from .get_moderation_actions import *
from .get_moderation_report import *
from .get_moderation_reports import *
from .get_record import *
from .get_repo import *
from .resolve_moderation_reports import *
from .reverse_moderation_action import *
from .search_repos import *
from .take_moderation_action import *
from .update_account_email import *
from .update_account_handle import *
import chitose
import typing

class Admin_:

Expand All @@ -44,7 +31,7 @@ def get_moderation_reports(self, subject: typing.Optional[str]=None, resolved: t
"""List moderation reports related to a subject."""
return _get_moderation_reports(self.service, self.headers, subject, resolved, limit, cursor)

def take_moderation_action(self, action: str, subject: typing.Union[chitose.com.atproto.admin.defs.RepoRef, chitose.com.atproto.repo.StrongRef], reason: str, created_by: str, subject_blob_cids: typing.Optional[list[str]]=None, create_label_vals: typing.Optional[list[str]]=None, negate_label_vals: typing.Optional[list[str]]=None):
def take_moderation_action(self, action: str, subject: typing.Union[chitose.com.atproto.admin.defs.RepoRef, chitose.com.atproto.repo.strong_ref.StrongRef], reason: str, created_by: str, subject_blob_cids: typing.Optional[list[str]]=None, create_label_vals: typing.Optional[list[str]]=None, negate_label_vals: typing.Optional[list[str]]=None):
"""Take a moderation action on a repo."""
return _take_moderation_action(self.service, self.headers, action, subject, reason, created_by, subject_blob_cids, create_label_vals, negate_label_vals)

Expand Down
Loading

0 comments on commit b909997

Please sign in to comment.