-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4318460
commit 6f4543c
Showing
6 changed files
with
417 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,3 +110,6 @@ | |
|
||
from . import splitprofile | ||
from .splitprofile.__splitprofile import SplitProfile | ||
|
||
from . import request | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .__request import (get, post, patch, put, delete) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
from ..utils import rest | ||
|
||
|
||
def get(path, query=None, user=None): | ||
"""# Retrieve any StarkBank resource | ||
Receive a json of resources previously created in the Stark Bank API | ||
## Parameters (required): | ||
- path [string]: StarkBank resource's route. ex: "/invoice/" | ||
- query [dict, default None]: Query parameters. ex: {"limit": 1, "status": paid} | ||
## Parameters (optional): | ||
- user [Organization/Project object, default None]: Organization or Project object. Not necessary if starkbank.user | ||
was set before function call | ||
## Return: | ||
- generator of Invoice objects with updated attributes | ||
""" | ||
return rest.get_raw( | ||
path=path, | ||
query=query, | ||
user=user | ||
) | ||
|
||
|
||
def post(path, body=None, user=None): | ||
return rest.post_raw( | ||
path=path, | ||
payload=body, | ||
user=user | ||
) | ||
|
||
|
||
def patch(path, body=None, user=None): | ||
return rest.patch_raw( | ||
path=path, | ||
payload=body, | ||
user=user | ||
) | ||
|
||
|
||
def put(path, body=None, user=None): | ||
return rest.put_raw( | ||
path=path, | ||
payload=body, | ||
user=user | ||
) | ||
|
||
|
||
def delete(path, body=None, user=None): | ||
return rest.delete_raw( | ||
path=path, | ||
payload=body, | ||
user=user | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.