Skip to content

Commit 7e0fd55

Browse files
committed
Update version to v0.0.2
1 parent cdf0884 commit 7e0fd55

File tree

5 files changed

+39
-2
lines changed

5 files changed

+39
-2
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
def error_response(status, message):
2+
"""
3+
Custom error response
4+
5+
Args:
6+
status ([string]): [status message -> 404 not found, 500 server error, 400 bad request, etc]
7+
message ([string]): [what error message do you want to show to the end user?]
8+
9+
Returns:
10+
[response]: [Returns a dictionary of status, and message]
11+
"""
12+
13+
payload = {
14+
"status": status,
15+
"message": message
16+
}
17+
return payload
18+
19+
20+
def success_response(status, message, data):
21+
"""
22+
Custom success response
23+
24+
Args:
25+
status ([string]): [status message -> 201 created, 200 ok, 202 accepted, etc]
26+
message ([string]): [what message do you want to show to the end user?]
27+
data ([dict]): [serialized data from the server side]
28+
29+
Returns:
30+
[response]: [Returns a dictionary of status, message, data of whatever object that was serialized]
31+
"""
32+
33+
payload = {
34+
"status": status,
35+
"message": message,
36+
"data": data
37+
}
38+
return payload
3.89 KB
Binary file not shown.

dist/rest_api_payload-0.0.2.tar.gz

4.05 KB
Binary file not shown.

rest_api_payload.egg-info/PKG-INFO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: rest-api-payload
3-
Version: 0.0.1
3+
Version: 0.0.2
44
Summary: Industry ready custom API payload with an easy format for building Python APIs (Django/Django Rest Framework)
55
Home-page: https://github.com/israelabraham/API-Payload
66
Author: Abraham (Abram 🐼) Israel

rest_api_payload.egg-info/SOURCES.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ pyproject.toml
44
setup.cfg
55
setup.py
66
rest_api_payload/__init__.py
7-
rest_api_payload/rest_api_payload.py
87
rest_api_payload.egg-info/PKG-INFO
98
rest_api_payload.egg-info/SOURCES.txt
109
rest_api_payload.egg-info/dependency_links.txt

0 commit comments

Comments
 (0)