Skip to content

Commit 402bb55

Browse files
authored
Merge pull request #8 from Frameio/comments
get, create, update, delete comments
2 parents 0c92b5a + 751f898 commit 402bb55

3 files changed

Lines changed: 62 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $ pip install .
1919

2020
## Documentation
2121

22-
TODO
22+
[Frame.io API Documentation](https://docs.frame.io)
2323

2424
## Usage
2525

frameioclient/client.py

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def create_project(self, **kwargs):
6565
)
6666
"""
6767
return self._api_call('post', '/projects', payload=kwargs)
68+
6869
def get_project(self, project_id):
6970
"""
7071
Get a project by id.
@@ -87,7 +88,7 @@ def get_asset(self, asset_id):
8788

8889
def get_asset_children(self, asset_id):
8990
"""
90-
Get an assets children.
91+
Get an asset's children.
9192
9293
:Args:
9394
asset_id (string): The asset id.
@@ -131,3 +132,61 @@ def upload(self, asset, file):
131132
"""
132133
uploader = FrameioUploader(asset, file)
133134
uploader.upload()
135+
136+
def get_comments(self, asset_id):
137+
"""
138+
Get an asset's comments.
139+
140+
:Args:
141+
asset_id (string): The asset id.
142+
"""
143+
endpoint = '/assets/{}/comments'.format(asset_id)
144+
return self._api_call('get', endpoint)
145+
146+
def create_comment(self, asset_id, **kwargs):
147+
"""
148+
Create a comment.
149+
150+
:Args:
151+
asset_id (string): The asset id.
152+
:Kwargs:
153+
(optional) kwargs: additional request parameters.
154+
155+
Example::
156+
157+
client.create_comment(
158+
asset_id="123abc",
159+
text="Hello world"
160+
)
161+
"""
162+
endpoint = '/assets/{}/comments'.format(asset_id)
163+
return self.api_call('post', endpoint, payload=kwargs)
164+
165+
def update_comment(self, comment_id, **kwargs):
166+
"""
167+
Update a comment.
168+
169+
:Args:
170+
comment_id (string): The comment id.
171+
:Kwargs:
172+
(optional) kwargs: additional request parameters.
173+
174+
Example::
175+
176+
client.create_comment(
177+
comment_id="123abc",
178+
text="Hello world"
179+
)
180+
"""
181+
endpoint = '/comments/{}'.format(comment_id)
182+
return self.api_call('post', endpoint, payload=kwargs)
183+
184+
def delete_comment(self, comment_id):
185+
"""
186+
Delete a comment.
187+
188+
:Args:
189+
comment_id (string): The comment id.
190+
"""
191+
endpoint = '/comments/{}'.format(comment_id)
192+
return self.api_call('delete', endpoint)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name='frameioclient',
8-
version='0.2.0',
8+
version='0.3.0',
99
description='Client library for the Frame.io API',
1010
long_description=long_description,
1111
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)