Skip to content

Commit

Permalink
Update version to v0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
aybruhm committed Feb 28, 2022
1 parent cdf0884 commit 7e0fd55
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 2 deletions.
38 changes: 38 additions & 0 deletions build/lib/rest_api_payload/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
def error_response(status, message):
"""
Custom error response
Args:
status ([string]): [status message -> 404 not found, 500 server error, 400 bad request, etc]
message ([string]): [what error message do you want to show to the end user?]
Returns:
[response]: [Returns a dictionary of status, and message]
"""

payload = {
"status": status,
"message": message
}
return payload


def success_response(status, message, data):
"""
Custom success response
Args:
status ([string]): [status message -> 201 created, 200 ok, 202 accepted, etc]
message ([string]): [what message do you want to show to the end user?]
data ([dict]): [serialized data from the server side]
Returns:
[response]: [Returns a dictionary of status, message, data of whatever object that was serialized]
"""

payload = {
"status": status,
"message": message,
"data": data
}
return payload
Binary file added dist/rest_api_payload-0.0.2-py3-none-any.whl
Binary file not shown.
Binary file added dist/rest_api_payload-0.0.2.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion rest_api_payload.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: rest-api-payload
Version: 0.0.1
Version: 0.0.2
Summary: Industry ready custom API payload with an easy format for building Python APIs (Django/Django Rest Framework)
Home-page: https://github.com/israelabraham/API-Payload
Author: Abraham (Abram 🐼) Israel
Expand Down
1 change: 0 additions & 1 deletion rest_api_payload.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pyproject.toml
setup.cfg
setup.py
rest_api_payload/__init__.py
rest_api_payload/rest_api_payload.py
rest_api_payload.egg-info/PKG-INFO
rest_api_payload.egg-info/SOURCES.txt
rest_api_payload.egg-info/dependency_links.txt
Expand Down

0 comments on commit 7e0fd55

Please sign in to comment.