biweeklybudget.flaskapp.views.plaid module¶
-
class
biweeklybudget.flaskapp.views.plaid.
PlaidHandleLink
[source]¶ Bases:
flask.views.MethodView
Handle POST /ajax/plaid/handle_link endpoint.
-
methods
= {'POST'}¶
-
-
class
biweeklybudget.flaskapp.views.plaid.
PlaidJs
[source]¶ Bases:
flask.views.MethodView
Handle GET /plaid.js endpoint, for CI/test or production/real.
-
methods
= {'GET'}¶
-
-
class
biweeklybudget.flaskapp.views.plaid.
PlaidLinkToken
[source]¶ Bases:
flask.views.MethodView
Handle POST /ajax/plaid/create_link_token endpoint.
-
methods
= {'POST'}¶
-
-
class
biweeklybudget.flaskapp.views.plaid.
PlaidRefreshAccounts
[source]¶ Bases:
flask.views.MethodView
Handle POST /ajax/plaid/refresh_item_accounts endpoint.
-
methods
= {'POST'}¶
-
-
class
biweeklybudget.flaskapp.views.plaid.
PlaidUpdate
[source]¶ Bases:
flask.views.MethodView
Handle GET or POST /plaid-update
This single endpoint has multiple functions:
- If GET with no query parameters, displays a form template to use to interactively update Plaid accounts.
- If GET or POST with an
item_ids
query parameter, performs a Plaid update (via_update()
) of the specified CSV list of Plaid Item IDs, or all Plaid Items if the value isALL
. The POST method also accepts an optionalnum_days
parameter specifying an integer number of days of transactions to update. The response from this endpoint can be in one of three forms:- If the
Accept
HTTP header is set toapplication/json
, return a JSON list of update results. Each list item is the JSON-ified value ofas_dict
. - If the
Accept
HTTP header is set totext/plain
, return a plain text human-readable summary of the update operation. - Otherwise, return a templated view of the update operation results, as would be returned to a browser.
- If the
-
_update
(ids: str, num_days: int = 30)[source]¶ Handle an update for Plaid accounts by instantiating a
PlaidUpdater
, calling itsupdate()
method with the proper arguments, and then returning the result in a form determined by theAccept
header.Parameters:
-
get
()[source]¶ Handle GET. If the
item_ids
query parameter is set, then return_update()
, else return_form()
.
-
methods
= {'GET', 'POST'}¶