Skip to content

Commit

Permalink
Fix request format in collection creation/update
Browse files Browse the repository at this point in the history
  • Loading branch information
0xRy4n committed Oct 20, 2023
1 parent 78b6783 commit 889cef4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
15 changes: 3 additions & 12 deletions intercom_python_sdk/apis/help_center/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

# External
from uplink import (
json,
get, put,
post, delete,
Query, Body,
Expand Down Expand Up @@ -83,18 +84,7 @@ def list_all_collections(self):
return resp

@returns(CollectionSchema(many=False)) # type: ignore
@post("collections")
def create_collection(self, data: Body(CollectionSchema)): # type: ignore
""" Create a Collection.
Args:
data (dict): The data to create the Collection with.
Returns:
Collection: The created Collection.
"""

@returns(CollectionSchema(many=False)) # type: ignore
@json()
@put("collections/{collection_id}")
def update_collection_by_id(self, collection_id: Union[str, int], data: Body(type=CollectionSchema)): # type: ignore
""" Update a Collection.
Expand All @@ -108,6 +98,7 @@ def update_collection_by_id(self, collection_id: Union[str, int], data: Body(typ
"""

@returns(CollectionSchema(many=False)) # type: ignore
@json()
@post("collections")
def create_collection(self, data: Body(type=CollectionSchema)): # type: ignore
""" Create a Collection.
Expand Down
2 changes: 2 additions & 0 deletions intercom_python_sdk/core/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,6 @@ def catch_api_error(response): # type: ignore
data = response.json()
error = IntercomErrorListSchema().load(data)

print(response.content)

raise error # type: ignore

0 comments on commit 889cef4

Please sign in to comment.