Skip to content

Commit

Permalink
Add: Comment Object
Browse files Browse the repository at this point in the history
  • Loading branch information
faridrasidov committed Jul 23, 2024
1 parent b867575 commit cb43afb
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
3 changes: 2 additions & 1 deletion soundcld/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"""
SoundCld Is Soundcloud-v2 api handler
"""
from .api_handler import SoundCloud
import soundcld.resource.playlist_album
import soundcld.resource.track
import soundcld.resource.user
import soundcld.resource.webprofiles
import soundcld.resource.visual
import soundcld.resource.comments
from .api_handler import SoundCloud

__version__ = '1.0'
41 changes: 41 additions & 0 deletions soundcld/resource/comments.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"""
Comments Object
"""
import datetime
from dataclasses import dataclass

from soundcld.resource.base import BaseData
from soundcld.resource.track import CommentTrack
from soundcld.resource.user import BasicUser


@dataclass
class CommentSelf(BaseData):
"""
Comment Link
"""
urn: str


@dataclass
class BasicComment(BaseData):
"""
Comment without a specified track
"""
kind: str
id: int
body: str
created_at: datetime.datetime
timestamp: int
track_id: int
user_id: int
self: CommentSelf
user: BasicUser


@dataclass
class Comment(BasicComment):
"""
Comment with a specified track
"""
track: CommentTrack

0 comments on commit cb43afb

Please sign in to comment.