Skip to content

Commit 54fbd8a

Browse files
feat: add account balance support
1 parent f831170 commit 54fbd8a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1625
-1727
lines changed

processout/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
from processout.addon import Addon
77
from processout.apirequest import APIRequest
88
from processout.apiversion import APIVersion
9+
from processout.balances import Balances
10+
from processout.balance import Balance
911
from processout.card import Card
1012
from processout.cardinformation import CardInformation
1113
from processout.coupon import Coupon
@@ -44,7 +46,7 @@
4446

4547
# Import errors
4648
from processout.errors.authenticationerror import AuthenticationError
47-
from processout.errors.genericerror import GenericError
48-
from processout.errors.internalerror import InternalError
49-
from processout.errors.notfounderror import NotFoundError
50-
from processout.errors.validationerror import ValidationError
49+
from processout.errors.genericerror import GenericError
50+
from processout.errors.internalerror import InternalError
51+
from processout.errors.notfounderror import NotFoundError
52+
from processout.errors.validationerror import ValidationError

processout/activity.py

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
import processout
77
import json
88

9-
from processout.networking.request import Request
9+
from processout.networking.request import Request
1010
from processout.networking.response import Response
1111

1212
# The content of this file was automatically generated
1313

14+
1415
class Activity(object):
15-
def __init__(self, client, prefill = None):
16+
def __init__(self, client, prefill=None):
1617
self._client = client
1718

1819
self._id = None
@@ -22,10 +23,9 @@ def __init__(self, client, prefill = None):
2223
self._content = None
2324
self._level = None
2425
self._created_at = None
25-
if prefill != None:
26+
if prefill is not None:
2627
self.fill_with_data(prefill)
2728

28-
2929
@property
3030
def id(self):
3131
"""Get id"""
@@ -38,7 +38,7 @@ def id(self, val):
3838
val -- New id value"""
3939
self._id = val
4040
return self
41-
41+
4242
@property
4343
def project(self):
4444
"""Get project"""
@@ -60,7 +60,7 @@ def project(self, val):
6060
else:
6161
self._project = val
6262
return self
63-
63+
6464
@property
6565
def project_id(self):
6666
"""Get project_id"""
@@ -73,7 +73,7 @@ def project_id(self, val):
7373
val -- New project_id value"""
7474
self._project_id = val
7575
return self
76-
76+
7777
@property
7878
def title(self):
7979
"""Get title"""
@@ -86,7 +86,7 @@ def title(self, val):
8686
val -- New title value"""
8787
self._title = val
8888
return self
89-
89+
9090
@property
9191
def content(self):
9292
"""Get content"""
@@ -99,7 +99,7 @@ def content(self, val):
9999
val -- New content value"""
100100
self._content = val
101101
return self
102-
102+
103103
@property
104104
def level(self):
105105
"""Get level"""
@@ -112,7 +112,7 @@ def level(self, val):
112112
val -- New level value"""
113113
self._level = val
114114
return self
115-
115+
116116
@property
117117
def created_at(self):
118118
"""Get created_at"""
@@ -125,7 +125,6 @@ def created_at(self, val):
125125
val -- New created_at value"""
126126
self._created_at = val
127127
return self
128-
129128

130129
def fill_with_data(self, data):
131130
"""Fill the current object with the new values pulled from data
@@ -145,7 +144,7 @@ def fill_with_data(self, data):
145144
self.level = data["level"]
146145
if "created_at" in data.keys():
147146
self.created_at = data["created_at"]
148-
147+
149148
return self
150149

151150
def to_json(self):
@@ -159,60 +158,53 @@ def to_json(self):
159158
"created_at": self.created_at,
160159
}
161160

162-
def all(self, options = {}):
161+
def all(self, options={}):
163162
"""Get all the project activities.
164163
Keyword argument:
165-
164+
166165
options -- Options for the request"""
167166
self.fill_with_data(options)
168167

169168
request = Request(self._client)
170-
path = "/activities"
171-
data = {
169+
path = "/activities"
170+
data = {
172171

173172
}
174173

175174
response = Response(request.get(path, data, options))
176175
return_values = []
177-
178-
a = []
176+
177+
a = []
179178
body = response.body
180179
for v in body['activities']:
181180
tmp = processout.Activity(self._client)
182181
tmp.fill_with_data(v)
183182
a.append(tmp)
184183

185184
return_values.append(a)
186-
187185

188-
189186
return return_values[0]
190187

191-
def find(self, activity_id, options = {}):
188+
def find(self, activity_id, options={}):
192189
"""Find a specific activity and fetch its data.
193190
Keyword argument:
194191
activity_id -- ID of the activity
195192
options -- Options for the request"""
196193
self.fill_with_data(options)
197194

198195
request = Request(self._client)
199-
path = "/activities/" + quote_plus(activity_id) + ""
200-
data = {
196+
path = "/activities/" + quote_plus(activity_id) + ""
197+
data = {
201198

202199
}
203200

204201
response = Response(request.get(path, data, options))
205202
return_values = []
206-
203+
207204
body = response.body
208205
body = body["activity"]
209-
210-
206+
211207
obj = processout.Activity(self._client)
212208
return_values.append(obj.fill_with_data(body))
213-
214209

215-
216210
return return_values[0]
217-
218-

0 commit comments

Comments
 (0)