diff --git a/.gitignore b/.gitignore
index 6f10372..2208e58 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,7 @@
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
+.idea/shelf
# Sensitive or high-churn files:
.idea/**/dataSources/
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0ab2cee..7891d42 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,13 +1,13 @@
-# Change Log
+# Changelog
-## [Unreleased](https://github.com/bunq/sdk_python/tree/HEAD)
+## [1.13.1](https://github.com/bunq/sdk_python/tree/1.13.1) (2020-02-21)
-[Full Changelog](https://github.com/bunq/sdk_python/compare/1.10.16...HEAD)
+[Full Changelog](https://github.com/bunq/sdk_python/compare/1.13.0...1.13.1)
**Implemented enhancements:**
+- Add type hint. [\#89](https://github.com/bunq/sdk_python/issues/89)
- Python SDK PSD2 [\#123](https://github.com/bunq/sdk_python/pull/123) ([angelomelonas](https://github.com/angelomelonas))
-- Python SDK Refactor [\#117](https://github.com/bunq/sdk_python/pull/117) ([angelomelonas](https://github.com/angelomelonas))
**Fixed bugs:**
@@ -24,7 +24,16 @@
- Feature/dependency upgrades [\#128](https://github.com/bunq/sdk_python/pull/128) ([angelomelonas](https://github.com/angelomelonas))
- Add internal NotificationFilters [\#127](https://github.com/bunq/sdk_python/pull/127) ([angelomelonas](https://github.com/angelomelonas))
+## [1.13.0](https://github.com/bunq/sdk_python/tree/1.13.0) (2020-02-19)
+
+[Full Changelog](https://github.com/bunq/sdk_python/compare/1.10.16...1.13.0)
+
+**Implemented enhancements:**
+
+- Python SDK Refactor [\#117](https://github.com/bunq/sdk_python/pull/117) ([angelomelonas](https://github.com/angelomelonas))
+
## [1.10.16](https://github.com/bunq/sdk_python/tree/1.10.16) (2019-06-17)
+
[Full Changelog](https://github.com/bunq/sdk_python/compare/1.10.2...1.10.16)
**Closed issues:**
@@ -36,6 +45,7 @@
- Markdown fix. \(bunq/sdk\_python\#113\) [\#114](https://github.com/bunq/sdk_python/pull/114) ([kojoru](https://github.com/kojoru))
## [1.10.2](https://github.com/bunq/sdk_python/tree/1.10.2) (2019-05-22)
+
[Full Changelog](https://github.com/bunq/sdk_python/compare/1.10.1...1.10.2)
**Closed issues:**
@@ -43,9 +53,11 @@
- MonetaryAccountJoint.list not availeble [\#112](https://github.com/bunq/sdk_python/issues/112)
## [1.10.1](https://github.com/bunq/sdk_python/tree/1.10.1) (2019-03-22)
+
[Full Changelog](https://github.com/bunq/sdk_python/compare/1.10.0...1.10.1)
## [1.10.0](https://github.com/bunq/sdk_python/tree/1.10.0) (2019-03-22)
+
[Full Changelog](https://github.com/bunq/sdk_python/compare/1.1.0...1.10.0)
**Closed issues:**
@@ -57,6 +69,7 @@
- Edits to allow Python 3.5.3 as minimum [\#109](https://github.com/bunq/sdk_python/pull/109) ([eavanvalkenburg](https://github.com/eavanvalkenburg))
## [1.1.0](https://github.com/bunq/sdk_python/tree/1.1.0) (2018-10-05)
+
[Full Changelog](https://github.com/bunq/sdk_python/compare/1.0.1...1.1.0)
**Closed issues:**
@@ -68,9 +81,11 @@
- Bunq/sdk\_python\#78/remove config dep [\#106](https://github.com/bunq/sdk_python/pull/106) ([OGKevin](https://github.com/OGKevin))
## [1.0.1](https://github.com/bunq/sdk_python/tree/1.0.1) (2018-09-01)
+
[Full Changelog](https://github.com/bunq/sdk_python/compare/1.0.0...1.0.1)
## [1.0.0](https://github.com/bunq/sdk_python/tree/1.0.0) (2018-07-24)
+
[Full Changelog](https://github.com/bunq/sdk_python/compare/0.13.1...1.0.0)
**Implemented enhancements:**
@@ -111,6 +126,7 @@
- Optimise test framework auto topup bunq/sdk\_python\#78 [\#81](https://github.com/bunq/sdk_python/pull/81) ([OGKevin](https://github.com/OGKevin))
## [0.13.1](https://github.com/bunq/sdk_python/tree/0.13.1) (2018-05-30)
+
[Full Changelog](https://github.com/bunq/sdk_python/compare/0.13.0...0.13.1)
**Closed issues:**
@@ -128,6 +144,7 @@
- Move to new sandbox bunq/sdk\_python\#98 [\#99](https://github.com/bunq/sdk_python/pull/99) ([OGKevin](https://github.com/OGKevin))
## [0.13.0](https://github.com/bunq/sdk_python/tree/0.13.0) (2018-03-20)
+
[Full Changelog](https://github.com/bunq/sdk_python/compare/0.12.4...0.13.0)
**Implemented enhancements:**
@@ -148,14 +165,17 @@
**Merged pull requests:**
+- Regenerate code for release [\#74](https://github.com/bunq/sdk_python/pull/74) ([OGKevin](https://github.com/OGKevin))
- Regenerated code to add object types. \(bunq/sdk\_python\#53\) [\#70](https://github.com/bunq/sdk_python/pull/70) ([OGKevin](https://github.com/OGKevin))
- Bunq/sdk python\#67 add missing token qr id field [\#69](https://github.com/bunq/sdk_python/pull/69) ([OGKevin](https://github.com/OGKevin))
+- Added missing id field to mastercard action. \(bunq/sdk\_python\#54\) [\#66](https://github.com/bunq/sdk_python/pull/66) ([OGKevin](https://github.com/OGKevin))
- Feature/bunq/sdk python\#59 add response id to request error [\#64](https://github.com/bunq/sdk_python/pull/64) ([OGKevin](https://github.com/OGKevin))
- Configure Zappr [\#63](https://github.com/bunq/sdk_python/pull/63) ([OGKevin](https://github.com/OGKevin))
- \(bunq/sdk\_python\#60\) improve issue and pr template [\#61](https://github.com/bunq/sdk_python/pull/61) ([OGKevin](https://github.com/OGKevin))
- Bunq update 7 [\#76](https://github.com/bunq/sdk_python/pull/76) ([OGKevin](https://github.com/OGKevin))
## [0.12.4](https://github.com/bunq/sdk_python/tree/0.12.4) (2017-12-21)
+
[Full Changelog](https://github.com/bunq/sdk_python/compare/0.12.3...0.12.4)
**Implemented enhancements:**
@@ -173,13 +193,12 @@
**Merged pull requests:**
-- Regenerate code for release [\#74](https://github.com/bunq/sdk_python/pull/74) ([OGKevin](https://github.com/OGKevin))
-- Added missing id field to mastercard action. \(bunq/sdk\_python\#54\) [\#66](https://github.com/bunq/sdk_python/pull/66) ([OGKevin](https://github.com/OGKevin))
- Feature/make sure headers are correctly cased bunq/sdk python\#51 [\#57](https://github.com/bunq/sdk_python/pull/57) ([OGKevin](https://github.com/OGKevin))
- Feature/improve decoder bunq/sdk python\#42 [\#56](https://github.com/bunq/sdk_python/pull/56) ([OGKevin](https://github.com/OGKevin))
- Renamed camelCase methods. \(bunq/sdk\_python\#45\) [\#48](https://github.com/bunq/sdk_python/pull/48) ([OGKevin](https://github.com/OGKevin))
## [0.12.3](https://github.com/bunq/sdk_python/tree/0.12.3) (2017-11-15)
+
[Full Changelog](https://github.com/bunq/sdk_python/compare/0.12.2...0.12.3)
**Implemented enhancements:**
@@ -192,6 +211,7 @@
- ScheduledPayment causes decode error due to Typo [\#44](https://github.com/bunq/sdk_python/issues/44)
## [0.12.2](https://github.com/bunq/sdk_python/tree/0.12.2) (2017-11-08)
+
[Full Changelog](https://github.com/bunq/sdk_python/compare/0.12.0...0.12.2)
**Implemented enhancements:**
@@ -212,6 +232,7 @@
- Feature/add missing cvc fields \#37 [\#38](https://github.com/bunq/sdk_python/pull/38) ([OGKevin](https://github.com/OGKevin))
## [0.12.0](https://github.com/bunq/sdk_python/tree/0.12.0) (2017-10-11)
+
[Full Changelog](https://github.com/bunq/sdk_python/compare/0.11.0...0.12.0)
**Implemented enhancements:**
@@ -228,6 +249,7 @@
- Feature/exception handler [\#26](https://github.com/bunq/sdk_python/pull/26) ([OGKevin](https://github.com/OGKevin))
## [0.11.0](https://github.com/bunq/sdk_python/tree/0.11.0) (2017-09-06)
+
[Full Changelog](https://github.com/bunq/sdk_python/compare/0.10.0...0.11.0)
**Implemented enhancements:**
@@ -237,6 +259,7 @@
- Add pagination [\#21](https://github.com/bunq/sdk_python/pull/21) ([dnl-blkv](https://github.com/dnl-blkv))
## [0.10.0](https://github.com/bunq/sdk_python/tree/0.10.0) (2017-08-22)
+
[Full Changelog](https://github.com/bunq/sdk_python/compare/0.9.1...0.10.0)
**Implemented enhancements:**
@@ -244,10 +267,10 @@
- Add proxy support to Python SDK [\#16](https://github.com/bunq/sdk_python/issues/16)
- Break the SDK's dependence on the bunq.conf file [\#11](https://github.com/bunq/sdk_python/issues/11)
- Response is missing response headers and pagination [\#9](https://github.com/bunq/sdk_python/issues/9)
-- cleanup tests \[\#18\] [\#19](https://github.com/bunq/sdk_python/pull/19) ([dnl-blkv](https://github.com/dnl-blkv))
- Changed test class name [\#14](https://github.com/bunq/sdk_python/pull/14) ([OGKevin](https://github.com/OGKevin))
- Load and Save an ApiContext from and to JSON Data [\#13](https://github.com/bunq/sdk_python/pull/13) ([PJUllrich](https://github.com/PJUllrich))
- \#9 Introduce BunqResponse [\#10](https://github.com/bunq/sdk_python/pull/10) ([dnl-blkv](https://github.com/dnl-blkv))
+- Readme for tests [\#5](https://github.com/bunq/sdk_python/pull/5) ([OGKevin](https://github.com/OGKevin))
**Closed issues:**
@@ -258,10 +281,13 @@
- Add proxy support \[\#16\] [\#17](https://github.com/bunq/sdk_python/pull/17) ([dnl-blkv](https://github.com/dnl-blkv))
## [0.9.1](https://github.com/bunq/sdk_python/tree/0.9.1) (2017-08-07)
+
+[Full Changelog](https://github.com/bunq/sdk_python/compare/4fb168bb3e1ed40b0b8ca00c8156b384debf2e29...0.9.1)
+
**Implemented enhancements:**
- Submit this as package to PyPi [\#2](https://github.com/bunq/sdk_python/issues/2)
-- Readme for tests [\#5](https://github.com/bunq/sdk_python/pull/5) ([OGKevin](https://github.com/OGKevin))
+- cleanup tests \[\#18\] [\#19](https://github.com/bunq/sdk_python/pull/19) ([dnl-blkv](https://github.com/dnl-blkv))
- Uploaded to PyPi [\#4](https://github.com/bunq/sdk_python/pull/4) ([OGKevin](https://github.com/OGKevin))
- Add first series of unit-tests [\#1](https://github.com/bunq/sdk_python/pull/1) ([OGKevin](https://github.com/OGKevin))
@@ -271,4 +297,4 @@
-\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
\ No newline at end of file
+\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
diff --git a/README.md b/README.md
index c8ae003..b5b887b 100644
--- a/README.md
+++ b/README.md
@@ -9,9 +9,11 @@ We're very happy to introduce yet another unique product: complete banking SDKs!
Now you can build even bigger and better apps and integrate them with your bank of the free! π
Before you dive into this brand new SDK, please consider:
-- Checking out our new developerβs page [https://bunq.com/en/developer](https://bunq.com/en/developer) π
-- Grabbing your production API key from the bunq app or generate a Sandbox API key using [Tinker](https://www.bunq.com/developer) π
-- Visiting [together.bunq.com](https://together.bunq.com) where you can share your creations,
+- Learning how bunq works and what objects you will work with by reading [the intro to our API](https://github.com/bunq/doc/blob/develop/README.md) π€
+- Checking out [our developer portal](https://developer.bunq.com/) π
+- Grabbing your Production API key from [our developer portal](https://developer.bunq.com/) or the bunq app π
+- Generating a Sandbox API key using [our developer portal](https://developer.bunq.com/) or [Tinker](https://www.bunq.com/developer) π
+- Visiting [our forum](https://together.bunq.com/t/api) where you can share your creations,
questions and experience π€
Give us your feedback, create pull requests, build your very own bunq apps and most importantly:
diff --git a/VERSION b/VERSION
index da38e07..cd99d38 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.13.1
\ No newline at end of file
+1.14.0
\ No newline at end of file
diff --git a/assets/attachment.jpg b/assets/attachment.jpg
deleted file mode 100644
index 8396e33..0000000
Binary files a/assets/attachment.jpg and /dev/null differ
diff --git a/bunq/sdk/http/api_client.py b/bunq/sdk/http/api_client.py
index 3459625..e6b7bde 100644
--- a/bunq/sdk/http/api_client.py
+++ b/bunq/sdk/http/api_client.py
@@ -59,7 +59,7 @@ class ApiClient:
HEADER_RESPONSE_ID_LOWER_CASED = 'x-bunq-client-response-id'
# Default header values
- USER_AGENT_BUNQ = 'bunq-sdk-python/1.13.1'
+ USER_AGENT_BUNQ = 'bunq-sdk-python/1.14.0'
GEOLOCATION_ZERO = '0 0 0 0 NL'
LANGUAGE_EN_US = 'en_US'
REGION_NL_NL = 'nl_NL'
diff --git a/bunq/sdk/model/generated/endpoint.py b/bunq/sdk/model/generated/endpoint.py
index c9e65f4..d0e3219 100644
--- a/bunq/sdk/model/generated/endpoint.py
+++ b/bunq/sdk/model/generated/endpoint.py
@@ -2192,261 +2192,6 @@ def from_json(json_str):
return converter.json_to_class(Avatar, json_str)
-class BancontactMerchantTransaction(BunqModel):
- """
- View for requesting Bancontact transactions and polling their status.
-
- :param _amount_requested: The requested amount of money to add.
- :type _amount_requested: object_.Amount
- :param _monetary_account_id: The id of the monetary account this bancontact
- merchant transaction links to.
- :type _monetary_account_id: int
- :param _alias: The alias of the monetary account to add money to.
- :type _alias: object_.MonetaryAccountReference
- :param _expiration: When the transaction will expire.
- :type _expiration: str
- :param _url_redirect: The URL to visit complete the bancontact transaction.
- :type _url_redirect: str
- :param _url_deep_link: The deep link to visit complete the bancontact
- transaction.
- :type _url_deep_link: str
- :param _status: The status of the transaction.
- :type _status: str
- :param _status_timestamp: When the status was last updated.
- :type _status_timestamp: str
- :param _transaction_id: The transaction ID of the bancontact transaction.
- :type _transaction_id: str
- """
-
- # Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/bancontact-merchant-transaction"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/bancontact-merchant-transaction/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/bancontact-merchant-transaction"
-
- # Field constants.
- FIELD_AMOUNT_REQUESTED = "amount_requested"
-
- # Object type.
- _OBJECT_TYPE_GET = "BancontactMerchantTransaction"
-
- _monetary_account_id = None
- _alias = None
- _amount_requested = None
- _expiration = None
- _url_redirect = None
- _url_deep_link = None
- _status = None
- _status_timestamp = None
- _transaction_id = None
- _amount_requested_field_for_request = None
-
- def __init__(self, amount_requested):
- """
- :param amount_requested: The requested amount of money to add.
- :type amount_requested: object_.Amount
- """
-
- self._amount_requested_field_for_request = amount_requested
-
- @classmethod
- def create(cls, amount_requested, monetary_account_id=None, custom_headers=None):
- """
- :type user_id: int
- :type monetary_account_id: int
- :param amount_requested: The requested amount of money to add.
- :type amount_requested: object_.Amount
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseInt
- """
-
- if custom_headers is None:
- custom_headers = {}
-
- request_map = {
- cls.FIELD_AMOUNT_REQUESTED: amount_requested
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
-
- api_client = ApiClient(cls._get_api_context())
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
- response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
-
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
- )
-
- @classmethod
- def get(cls, bancontact_merchant_transaction_id, monetary_account_id=None, custom_headers=None):
- """
- :type api_context: ApiContext
- :type user_id: int
- :type monetary_account_id: int
- :type bancontact_merchant_transaction_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseBancontactMerchantTransaction
- """
-
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- bancontact_merchant_transaction_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
-
- return BunqResponseBancontactMerchantTransaction.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
- )
-
- @classmethod
- def list(cls, monetary_account_id=None, params=None, custom_headers=None):
- """
- :type user_id: int
- :type monetary_account_id: int
- :type params: dict[str, str]|None
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseBancontactMerchantTransactionList
- """
-
- if params is None:
- params = {}
-
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
- response_raw = api_client.get(endpoint_url, params, custom_headers)
-
- return BunqResponseBancontactMerchantTransactionList.cast_from_bunq_response(
- cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
- )
-
- @property
- def monetary_account_id(self):
- """
- :rtype: int
- """
-
- return self._monetary_account_id
-
- @property
- def alias(self):
- """
- :rtype: object_.MonetaryAccountReference
- """
-
- return self._alias
-
- @property
- def amount_requested(self):
- """
- :rtype: object_.Amount
- """
-
- return self._amount_requested
-
- @property
- def expiration(self):
- """
- :rtype: str
- """
-
- return self._expiration
-
- @property
- def url_redirect(self):
- """
- :rtype: str
- """
-
- return self._url_redirect
-
- @property
- def url_deep_link(self):
- """
- :rtype: str
- """
-
- return self._url_deep_link
-
- @property
- def status(self):
- """
- :rtype: str
- """
-
- return self._status
-
- @property
- def status_timestamp(self):
- """
- :rtype: str
- """
-
- return self._status_timestamp
-
- @property
- def transaction_id(self):
- """
- :rtype: str
- """
-
- return self._transaction_id
-
- def is_all_field_none(self):
- """
- :rtype: bool
- """
-
- if self._monetary_account_id is not None:
- return False
-
- if self._alias is not None:
- return False
-
- if self._amount_requested is not None:
- return False
-
- if self._expiration is not None:
- return False
-
- if self._url_redirect is not None:
- return False
-
- if self._url_deep_link is not None:
- return False
-
- if self._status is not None:
- return False
-
- if self._status_timestamp is not None:
- return False
-
- if self._transaction_id is not None:
- return False
-
- return True
-
- @staticmethod
- def from_json(json_str):
- """
- :type json_str: str
-
- :rtype: BancontactMerchantTransaction
- """
-
- return converter.json_to_class(BancontactMerchantTransaction, json_str)
-
-
class BankSwitchServiceNetherlandsIncomingPayment(BunqModel):
"""
An incoming payment made towards an account of an external bank and
@@ -2543,16 +2288,16 @@ class BankSwitchServiceNetherlandsIncoming(BunqModel):
:type _counterparty_alias: object_.MonetaryAccountReference
:param _status: The status of the switch service.
:type _status: str
- :param _sub_status: The sub status of the switch service.
- :type _sub_status: str
- :param _time_start_actual: The timestamp when the switch service actually
- starts.
- :type _time_start_actual: str
:param _user_alias: The label of the user creator of this switch service.
:type _user_alias: object_.LabelUser
+ :param _sub_status: The sub status of the switch service.
+ :type _sub_status: str
:param _time_start_desired: The timestamp when the switch service desired to
be start.
:type _time_start_desired: str
+ :param _time_start_actual: The timestamp when the switch service actually
+ starts.
+ :type _time_start_actual: str
:param _time_end: The timestamp when the switch service ends.
:type _time_end: str
:param _attachment: Reference to the bank transfer form for this
@@ -2564,8 +2309,6 @@ class BankSwitchServiceNetherlandsIncoming(BunqModel):
FIELD_ALIAS = "alias"
FIELD_COUNTERPARTY_ALIAS = "counterparty_alias"
FIELD_STATUS = "status"
- FIELD_SUB_STATUS = "sub_status"
- FIELD_TIME_START_ACTUAL = "time_start_actual"
_user_alias = None
_alias = None
@@ -2579,10 +2322,8 @@ class BankSwitchServiceNetherlandsIncoming(BunqModel):
_alias_field_for_request = None
_counterparty_alias_field_for_request = None
_status_field_for_request = None
- _sub_status_field_for_request = None
- _time_start_actual_field_for_request = None
- def __init__(self, alias, counterparty_alias, status=None, sub_status=None, time_start_actual=None):
+ def __init__(self, alias, counterparty_alias, status=None):
"""
:param alias: The alias of the Monetary Account this switch service is for.
:type alias: object_.Pointer
@@ -2593,19 +2334,11 @@ def __init__(self, alias, counterparty_alias, status=None, sub_status=None, time
(always set to REQUESTED) can be CANCELLED in PUT requests to cancel the
switch service. Admin can set this to ACCEPTED, or REJECTED.
:type status: str
- :param sub_status: The substatus of the switch service. Only available in
- UPDATE. Can be NONE or CAPTURED
- :type sub_status: str
- :param time_start_actual: The timestamp when the switch service actually
- starts.
- :type time_start_actual: str
"""
self._alias_field_for_request = alias
self._counterparty_alias_field_for_request = counterparty_alias
self._status_field_for_request = status
- self._sub_status_field_for_request = sub_status
- self._time_start_actual_field_for_request = time_start_actual
@property
def user_alias(self):
@@ -2796,8 +2529,6 @@ class Payment(BunqModel):
:type _address_billing: object_.Address
:param _geolocation: The Geolocation where the Payment was done from.
:type _geolocation: object_.Geolocation
- :param _allow_chat: Whether or not chat messages are allowed.
- :type _allow_chat: bool
:param _request_reference_split_the_bill: The reference to the object used
for split the bill. Can be RequestInquiry or RequestInquiryBatch
:type _request_reference_split_the_bill:
@@ -2848,7 +2579,6 @@ class Payment(BunqModel):
_address_shipping = None
_address_billing = None
_geolocation = None
- _allow_chat = None
_request_reference_split_the_bill = None
_balance_after_mutation = None
_payment_auto_allocate_instance = None
@@ -3179,14 +2909,6 @@ def geolocation(self):
return self._geolocation
- @property
- def allow_chat(self):
- """
- :rtype: bool
- """
-
- return self._allow_chat
-
@property
def request_reference_split_the_bill(self):
"""
@@ -3282,9 +3004,6 @@ def is_all_field_none(self):
if self._geolocation is not None:
return False
- if self._allow_chat is not None:
- return False
-
if self._request_reference_split_the_bill is not None:
return False
@@ -4924,7 +4643,7 @@ class CardCredit(BunqModel):
:type _alias: object_.Pointer
:param _type_: The type of the card. Can is MASTERCARD.
:type _type_: str
- :param _product_type: The product type of the card to order.
+ :param _product_type: The product type of the card.
:type _product_type: str
:param _pin_code_assignment: Array of Types, PINs, account IDs assigned to
the card.
@@ -4949,8 +4668,11 @@ class CardCredit(BunqModel):
:param _sub_status: The sub-status of the card. Can be NONE or REPLACED.
:type _sub_status: str
:param _order_status: The order status of the card. Can be
- CARD_UPDATE_REQUESTED, CARD_UPDATE_SENT, CARD_UPDATE_ACCEPTED,
- ACCEPTED_FOR_PRODUCTION or DELIVERED_TO_CUSTOMER.
+ NEW_CARD_REQUEST_RECEIVED, CARD_REQUEST_PENDING, SENT_FOR_PRODUCTION,
+ ACCEPTED_FOR_PRODUCTION, DELIVERED_TO_CUSTOMER, CARD_UPDATE_REQUESTED,
+ CARD_UPDATE_PENDING, CARD_UPDATE_SENT, CARD_UPDATE_ACCEPTED,
+ VIRTUAL_DELIVERY, NEW_CARD_REQUEST_PENDING_USER_APPROVAL, SENT_FOR_DELIVERY
+ or NEW_CARD_REQUEST_CANCELLED.
:type _order_status: str
:param _expiry_date: Expiry date of the card.
:type _expiry_date: str
@@ -4970,6 +4692,9 @@ class CardCredit(BunqModel):
:param _country: The country that is domestic to the card. Defaults to
country of residence of user.
:type _country: str
+ :param _card_shipment_tracking_url: A tracking link provided by our shipment
+ provider.
+ :type _card_shipment_tracking_url: str
"""
# Endpoint constants.
@@ -4993,6 +4718,7 @@ class CardCredit(BunqModel):
_public_uuid = None
_type_ = None
_sub_type = None
+ _product_type = None
_second_line = None
_status = None
_sub_status = None
@@ -5007,6 +4733,7 @@ class CardCredit(BunqModel):
_pin_code_assignment = None
_monetary_account_id_fallback = None
_country = None
+ _card_shipment_tracking_url = None
_second_line_field_for_request = None
_name_on_card_field_for_request = None
_alias_field_for_request = None
@@ -5156,6 +4883,14 @@ def sub_type(self):
return self._sub_type
+ @property
+ def product_type(self):
+ """
+ :rtype: str
+ """
+
+ return self._product_type
+
@property
def second_line(self):
"""
@@ -5268,6 +5003,14 @@ def country(self):
return self._country
+ @property
+ def card_shipment_tracking_url(self):
+ """
+ :rtype: str
+ """
+
+ return self._card_shipment_tracking_url
+
def is_all_field_none(self):
"""
:rtype: bool
@@ -5291,6 +5034,9 @@ def is_all_field_none(self):
if self._sub_type is not None:
return False
+ if self._product_type is not None:
+ return False
+
if self._second_line is not None:
return False
@@ -5333,6 +5079,9 @@ def is_all_field_none(self):
if self._country is not None:
return False
+ if self._card_shipment_tracking_url is not None:
+ return False
+
return True
@staticmethod
@@ -5382,8 +5131,12 @@ class CardDebit(BunqModel):
:param _status: The status to set for the card. After ordering the card it
will be DEACTIVATED.
:type _status: str
- :param _order_status: The order status of the card. After ordering the card
- it will be NEW_CARD_REQUEST_RECEIVED.
+ :param _order_status: The order status of the card. Can be
+ NEW_CARD_REQUEST_RECEIVED, CARD_REQUEST_PENDING, SENT_FOR_PRODUCTION,
+ ACCEPTED_FOR_PRODUCTION, DELIVERED_TO_CUSTOMER, CARD_UPDATE_REQUESTED,
+ CARD_UPDATE_PENDING, CARD_UPDATE_SENT, CARD_UPDATE_ACCEPTED,
+ VIRTUAL_DELIVERY, NEW_CARD_REQUEST_PENDING_USER_APPROVAL, SENT_FOR_DELIVERY
+ or NEW_CARD_REQUEST_CANCELLED.
:type _order_status: str
:param _expiry_date: The expiry date of the card.
:type _expiry_date: str
@@ -5399,6 +5152,9 @@ class CardDebit(BunqModel):
:param _country: The country that is domestic to the card. Defaults to
country of residence of user.
:type _country: str
+ :param _card_shipment_tracking_url: A tracking link provided by our shipment
+ provider.
+ :type _card_shipment_tracking_url: str
"""
# Endpoint constants.
@@ -5434,6 +5190,7 @@ class CardDebit(BunqModel):
_pin_code_assignment = None
_monetary_account_id_fallback = None
_country = None
+ _card_shipment_tracking_url = None
_second_line_field_for_request = None
_name_on_card_field_for_request = None
_alias_field_for_request = None
@@ -5679,6 +5436,14 @@ def country(self):
return self._country
+ @property
+ def card_shipment_tracking_url(self):
+ """
+ :rtype: str
+ """
+
+ return self._card_shipment_tracking_url
+
def is_all_field_none(self):
"""
:rtype: bool
@@ -5738,6 +5503,9 @@ def is_all_field_none(self):
if self._country is not None:
return False
+ if self._card_shipment_tracking_url is not None:
+ return False
+
return True
@staticmethod
@@ -6249,11 +6017,16 @@ class Card(BunqModel):
:type _sub_type: str
:param _second_line: The second line of text on the card
:type _second_line: str
+ :param _user_id: ID of the user who is owner of the card.
+ :type _user_id: int
:param _sub_status: The sub-status of the card. Can be NONE or REPLACED.
:type _sub_status: str
:param _order_status: The order status of the card. Can be
- CARD_UPDATE_REQUESTED, CARD_UPDATE_SENT, CARD_UPDATE_ACCEPTED,
- ACCEPTED_FOR_PRODUCTION or DELIVERED_TO_CUSTOMER.
+ NEW_CARD_REQUEST_RECEIVED, CARD_REQUEST_PENDING, SENT_FOR_PRODUCTION,
+ ACCEPTED_FOR_PRODUCTION, DELIVERED_TO_CUSTOMER, CARD_UPDATE_REQUESTED,
+ CARD_UPDATE_PENDING, CARD_UPDATE_SENT, CARD_UPDATE_ACCEPTED,
+ VIRTUAL_DELIVERY, NEW_CARD_REQUEST_PENDING_USER_APPROVAL, SENT_FOR_DELIVERY
+ or NEW_CARD_REQUEST_CANCELLED.
:type _order_status: str
:param _expiry_date: Expiry date of the card.
:type _expiry_date: str
@@ -6268,6 +6041,11 @@ class Card(BunqModel):
:param _country: The country that is domestic to the card. Defaults to
country of residence of user.
:type _country: str
+ :param _card_shipment_tracking_url: A tracking link provided by our shipment
+ provider.
+ :type _card_shipment_tracking_url: str
+ :param _amount_saved_zero_fx: The amount saved through ZeroFX on this card.
+ :type _amount_saved_zero_fx: object_.Amount
"""
# Endpoint constants.
@@ -6297,6 +6075,7 @@ class Card(BunqModel):
_type_ = None
_sub_type = None
_second_line = None
+ _user_id = None
_status = None
_sub_status = None
_order_status = None
@@ -6311,6 +6090,8 @@ class Card(BunqModel):
_pin_code_assignment = None
_monetary_account_id_fallback = None
_country = None
+ _card_shipment_tracking_url = None
+ _amount_saved_zero_fx = None
_pin_code_field_for_request = None
_activation_code_field_for_request = None
_status_field_for_request = None
@@ -6551,6 +6332,14 @@ def second_line(self):
return self._second_line
+ @property
+ def user_id(self):
+ """
+ :rtype: int
+ """
+
+ return self._user_id
+
@property
def status(self):
"""
@@ -6663,6 +6452,22 @@ def country(self):
return self._country
+ @property
+ def card_shipment_tracking_url(self):
+ """
+ :rtype: str
+ """
+
+ return self._card_shipment_tracking_url
+
+ @property
+ def amount_saved_zero_fx(self):
+ """
+ :rtype: object_.Amount
+ """
+
+ return self._amount_saved_zero_fx
+
def is_all_field_none(self):
"""
:rtype: bool
@@ -6689,6 +6494,9 @@ def is_all_field_none(self):
if self._second_line is not None:
return False
+ if self._user_id is not None:
+ return False
+
if self._status is not None:
return False
@@ -6731,6 +6539,12 @@ def is_all_field_none(self):
if self._country is not None:
return False
+ if self._card_shipment_tracking_url is not None:
+ return False
+
+ if self._amount_saved_zero_fx is not None:
+ return False
+
return True
@staticmethod
@@ -9185,189 +8999,115 @@ def from_json(json_str):
return converter.json_to_class(CertificatePinned, json_str)
-class ConfirmationOfFunds(BunqModel):
+class Company(BunqModel):
"""
- Used to confirm availability of funds on an account.
+ Create and manage companies.
- :param _pointer_iban: The pointer (IBAN) of the account we're querying.
- :type _pointer_iban: object_.Pointer
- :param _amount: The amount we want to check for.
- :type _amount: object_.Amount
- :param _has_sufficient_funds: Whether the account has sufficient funds.
- :type _has_sufficient_funds: bool
+ :param _name: The company name.
+ :type _name: str
+ :param _address_main: The company's main address.
+ :type _address_main: object_.Address
+ :param _address_postal: The company's postal address.
+ :type _address_postal: object_.Address
+ :param _country: The country where the company is registered.
+ :type _country: str
+ :param _ubo: The names and birth dates of the company's ultimate beneficiary
+ owners. Minimum zero, maximum four.
+ :type _ubo: list[object_.Ubo]
+ :param _chamber_of_commerce_number: The company's chamber of commerce
+ number.
+ :type _chamber_of_commerce_number: str
+ :param _legal_form: The company's legal form.
+ :type _legal_form: str
+ :param _avatar_uuid: The public UUID of the company's avatar.
+ :type _avatar_uuid: str
+ :param _UserCompany:
+ :type _UserCompany: UserCompany
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/confirmation-of-funds"
+ _ENDPOINT_URL_CREATE = "user/{}/company"
+ _ENDPOINT_URL_READ = "user/{}/company/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/company"
+ _ENDPOINT_URL_UPDATE = "user/{}/company/{}"
# Field constants.
- FIELD_POINTER_IBAN = "pointer_iban"
- FIELD_AMOUNT = "amount"
+ FIELD_NAME = "name"
+ FIELD_ADDRESS_MAIN = "address_main"
+ FIELD_ADDRESS_POSTAL = "address_postal"
+ FIELD_COUNTRY = "country"
+ FIELD_UBO = "ubo"
+ FIELD_CHAMBER_OF_COMMERCE_NUMBER = "chamber_of_commerce_number"
+ FIELD_LEGAL_FORM = "legal_form"
+ FIELD_AVATAR_UUID = "avatar_uuid"
# Object type.
- _OBJECT_TYPE_POST = "ConfirmationOfFunds"
+ _OBJECT_TYPE_GET = "UserCompany"
- _has_sufficient_funds = None
- _pointer_iban_field_for_request = None
- _amount_field_for_request = None
+ _UserCompany = None
+ _name_field_for_request = None
+ _address_main_field_for_request = None
+ _address_postal_field_for_request = None
+ _country_field_for_request = None
+ _ubo_field_for_request = None
+ _chamber_of_commerce_number_field_for_request = None
+ _legal_form_field_for_request = None
+ _avatar_uuid_field_for_request = None
- def __init__(self, pointer_iban, amount):
+ def __init__(self, name, address_main, address_postal, country, legal_form, ubo=None,
+ chamber_of_commerce_number=None, avatar_uuid=None):
"""
- :param pointer_iban: The pointer (IBAN) of the account we're querying.
- :type pointer_iban: object_.Pointer
- :param amount: The amount we want to check for.
- :type amount: object_.Amount
+ :param name: The company name.
+ :type name: str
+ :param address_main: The company's main address.
+ :type address_main: object_.Address
+ :param address_postal: The company's postal address.
+ :type address_postal: object_.Address
+ :param country: The country where the company is registered.
+ :type country: str
+ :param legal_form: The company's legal form.
+ :type legal_form: str
+ :param ubo: The names and birth dates of the company's ultimate beneficiary
+ owners. Minimum zero, maximum four.
+ :type ubo: list[object_.Ubo]
+ :param chamber_of_commerce_number: The company's chamber of commerce number.
+ :type chamber_of_commerce_number: str
+ :param avatar_uuid: The public UUID of the company's avatar.
+ :type avatar_uuid: str
"""
- self._pointer_iban_field_for_request = pointer_iban
- self._amount_field_for_request = amount
+ self._name_field_for_request = name
+ self._address_main_field_for_request = address_main
+ self._address_postal_field_for_request = address_postal
+ self._country_field_for_request = country
+ self._legal_form_field_for_request = legal_form
+ self._ubo_field_for_request = ubo
+ self._chamber_of_commerce_number_field_for_request = chamber_of_commerce_number
+ self._avatar_uuid_field_for_request = avatar_uuid
@classmethod
- def create(cls, pointer_iban, amount, custom_headers=None):
+ def create(cls, name, address_main, address_postal, country, legal_form, ubo=None, chamber_of_commerce_number=None,
+ avatar_uuid=None, custom_headers=None):
"""
:type user_id: int
- :param pointer_iban: The pointer (IBAN) of the account we're querying.
- :type pointer_iban: object_.Pointer
- :param amount: The amount we want to check for.
- :type amount: object_.Amount
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseConfirmationOfFunds
- """
-
- if custom_headers is None:
- custom_headers = {}
-
- request_map = {
- cls.FIELD_POINTER_IBAN: pointer_iban,
- cls.FIELD_AMOUNT: amount
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
-
- api_client = ApiClient(cls._get_api_context())
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
- response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
-
- return BunqResponseConfirmationOfFunds.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_POST)
- )
-
- @property
- def has_sufficient_funds(self):
- """
- :rtype: bool
- """
-
- return self._has_sufficient_funds
-
- def is_all_field_none(self):
- """
- :rtype: bool
- """
-
- if self._has_sufficient_funds is not None:
- return False
-
- return True
-
- @staticmethod
- def from_json(json_str):
- """
- :type json_str: str
-
- :rtype: ConfirmationOfFunds
- """
-
- return converter.json_to_class(ConfirmationOfFunds, json_str)
-
-
-class DeviceServer(BunqModel):
- """
- After having created an Installation you can now create a DeviceServer. A
- DeviceServer is needed to do a login call with session-server.
-
- :param _description: The description of the DeviceServer.
- :type _description: str
- :param _secret: The API key. You can request an API key in the bunq app.
- :type _secret: str
- :param _permitted_ips: An array of IPs (v4 or v6) this DeviceServer will be
- able to do calls from. These will be linked to the API key.
- :type _permitted_ips: list[str]
- :param _id_: The id of the DeviceServer as created on the server.
- :type _id_: int
- :param _created: The timestamp of the DeviceServer's creation.
- :type _created: str
- :param _updated: The timestamp of the DeviceServer's last update.
- :type _updated: str
- :param _ip: The ip address which was used to create the DeviceServer.
- :type _ip: str
- :param _status: The status of the DeviceServer. Can be ACTIVE, BLOCKED,
- NEEDS_CONFIRMATION or OBSOLETE.
- :type _status: str
- """
-
- # Endpoint constants.
- _ENDPOINT_URL_CREATE = "device-server"
- _ENDPOINT_URL_READ = "device-server/{}"
- _ENDPOINT_URL_LISTING = "device-server"
-
- # Field constants.
- FIELD_DESCRIPTION = "description"
- FIELD_SECRET = "secret"
- FIELD_PERMITTED_IPS = "permitted_ips"
-
- # Object type.
- _OBJECT_TYPE_GET = "DeviceServer"
-
- _id_ = None
- _created = None
- _updated = None
- _description = None
- _ip = None
- _status = None
- _description_field_for_request = None
- _secret_field_for_request = None
- _permitted_ips_field_for_request = None
-
- def __init__(self, description, secret, permitted_ips=None):
- """
- :param description: The description of the DeviceServer. This is only for
- your own reference when reading the DeviceServer again.
- :type description: str
- :param secret: The API key. You can request an API key in the bunq app.
- :type secret: str
- :param permitted_ips: An array of IPs (v4 or v6) this DeviceServer will be
- able to do calls from. These will be linked to the API key.
- :type permitted_ips: list[str]
- """
-
- self._description_field_for_request = description
- self._secret_field_for_request = secret
- self._permitted_ips_field_for_request = permitted_ips
-
- @classmethod
- def create(cls, description, secret, permitted_ips=None, custom_headers=None):
- """
- Create a new DeviceServer providing the installation token in the header
- and signing the request with the private part of the key you used to
- create the installation. The API Key that you are using will be bound to
- the IP address of the DeviceServer which you have
- created.
Using a Wildcard API Key gives you the freedom to make
- API calls even if the IP address has changed after the POST
- device-server.
Find out more at this link https://bunq.com/en/apikey-dynamic-ip.
-
- :param description: The description of the DeviceServer. This is only
- for your own reference when reading the DeviceServer again.
- :type description: str
- :param secret: The API key. You can request an API key in the bunq app.
- :type secret: str
- :param permitted_ips: An array of IPs (v4 or v6) this DeviceServer will
- be able to do calls from. These will be linked to the API key.
- :type permitted_ips: list[str]
+ :param name: The company name.
+ :type name: str
+ :param address_main: The company's main address.
+ :type address_main: object_.Address
+ :param address_postal: The company's postal address.
+ :type address_postal: object_.Address
+ :param country: The country where the company is registered.
+ :type country: str
+ :param legal_form: The company's legal form.
+ :type legal_form: str
+ :param ubo: The names and birth dates of the company's ultimate
+ beneficiary owners. Minimum zero, maximum four.
+ :type ubo: list[object_.Ubo]
+ :param chamber_of_commerce_number: The company's chamber of commerce
+ number.
+ :type chamber_of_commerce_number: str
+ :param avatar_uuid: The public UUID of the company's avatar.
+ :type avatar_uuid: str
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -9377,16 +9117,21 @@ def create(cls, description, secret, permitted_ips=None, custom_headers=None):
custom_headers = {}
request_map = {
- cls.FIELD_DESCRIPTION: description,
- cls.FIELD_SECRET: secret,
- cls.FIELD_PERMITTED_IPS: permitted_ips
+ cls.FIELD_NAME: name,
+ cls.FIELD_ADDRESS_MAIN: address_main,
+ cls.FIELD_ADDRESS_POSTAL: address_postal,
+ cls.FIELD_COUNTRY: country,
+ cls.FIELD_UBO: ubo,
+ cls.FIELD_CHAMBER_OF_COMMERCE_NUMBER: chamber_of_commerce_number,
+ cls.FIELD_LEGAL_FORM: legal_form,
+ cls.FIELD_AVATAR_UUID: avatar_uuid
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
api_client = ApiClient(cls._get_api_context())
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -9394,37 +9139,35 @@ def create(cls, description, secret, permitted_ips=None, custom_headers=None):
)
@classmethod
- def get(cls, device_server_id, custom_headers=None):
+ def get(cls, company_id, custom_headers=None):
"""
- Get one of your DeviceServers.
-
:type api_context: ApiContext
- :type device_server_id: int
+ :type user_id: int
+ :type company_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseDeviceServer
+ :rtype: BunqResponseCompany
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(device_server_id)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), company_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseDeviceServer.cast_from_bunq_response(
+ return BunqResponseCompany.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
def list(cls, params=None, custom_headers=None):
"""
- Get a collection of all the DeviceServers you have created.
-
+ :type user_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseDeviceServerList
+ :rtype: BunqResponseCompanyList
"""
if params is None:
@@ -9434,192 +9177,58 @@ def list(cls, params=None, custom_headers=None):
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseDeviceServerList.cast_from_bunq_response(
+ return BunqResponseCompanyList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
- @property
- def id_(self):
- """
- :rtype: int
- """
-
- return self._id_
-
- @property
- def created(self):
- """
- :rtype: str
- """
-
- return self._created
-
- @property
- def updated(self):
- """
- :rtype: str
- """
-
- return self._updated
-
- @property
- def description(self):
- """
- :rtype: str
- """
-
- return self._description
-
- @property
- def ip(self):
- """
- :rtype: str
- """
-
- return self._ip
-
- @property
- def status(self):
- """
- :rtype: str
- """
-
- return self._status
-
- def is_all_field_none(self):
- """
- :rtype: bool
- """
-
- if self._id_ is not None:
- return False
-
- if self._created is not None:
- return False
-
- if self._updated is not None:
- return False
-
- if self._description is not None:
- return False
-
- if self._ip is not None:
- return False
-
- if self._status is not None:
- return False
-
- return True
-
- @staticmethod
- def from_json(json_str):
- """
- :type json_str: str
-
- :rtype: DeviceServer
- """
-
- return converter.json_to_class(DeviceServer, json_str)
-
-
-class Device(BunqModel, AnchorObjectInterface):
- """
- Used to get a Device or a listing of Devices. Creating a DeviceServer should
- happen via /device-server
-
- :param _DeviceServer:
- :type _DeviceServer: DeviceServer
- """
-
- # Error constants.
- _ERROR_NULL_FIELDS = "All fields of an extended model or object are null."
-
- # Endpoint constants.
- _ENDPOINT_URL_READ = "device/{}"
- _ENDPOINT_URL_LISTING = "device"
-
- # Object type.
- _OBJECT_TYPE_GET = "Device"
-
- _DeviceServer = None
-
@classmethod
- def get(cls, device_id, custom_headers=None):
+ def update(cls, company_id, avatar_uuid=None, custom_headers=None):
"""
- Get a single Device. A Device is either a DevicePhone or a DeviceServer.
-
- :type api_context: ApiContext
- :type device_id: int
+ :type user_id: int
+ :type company_id: int
+ :param avatar_uuid: The public UUID of the company's avatar.
+ :type avatar_uuid: str
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseDevice
+ :rtype: BunqResponseInt
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(device_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
-
- return BunqResponseDevice.cast_from_bunq_response(
- cls._from_json(response_raw)
- )
-
- @classmethod
- def list(cls, params=None, custom_headers=None):
- """
- Get a collection of Devices. A Device is either a DevicePhone or a
- DeviceServer.
-
- :type params: dict[str, str]|None
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseDeviceList
- """
-
- if params is None:
- params = {}
- if custom_headers is None:
- custom_headers = {}
+ request_map = {
+ cls.FIELD_AVATAR_UUID: avatar_uuid
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING
- response_raw = api_client.get(endpoint_url, params, custom_headers)
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(), company_id)
+ response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
- return BunqResponseDeviceList.cast_from_bunq_response(
- cls._from_json_list(response_raw)
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
)
@property
- def DeviceServer(self):
- """
- :rtype: DeviceServer
- """
-
- return self._DeviceServer
-
- def get_referenced_object(self):
+ def UserCompany(self):
"""
- :rtype: BunqModel
- :raise: BunqException
+ :rtype: UserCompany
"""
- if self._DeviceServer is not None:
- return self._DeviceServer
-
- raise BunqException(self._ERROR_NULL_FIELDS)
+ return self._UserCompany
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._DeviceServer is not None:
+ if self._UserCompany is not None:
return False
return True
@@ -9629,182 +9238,310 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: Device
+ :rtype: Company
"""
- return converter.json_to_class(Device, json_str)
+ return converter.json_to_class(Company, json_str)
-class DraftPayment(BunqModel):
+class UserCompany(BunqModel):
"""
- A DraftPayment is like a regular Payment, but it needs to be accepted by the
- sending party before the actual Payment is done.
+ With UserCompany you can retrieve information regarding the authenticated
+ UserCompany and update specific fields.
Notification filters can be
+ set on a UserCompany level to receive callbacks. For more information check
+ the dedicated callbacks page.
- :param _status: The status of the DraftPayment.
- :type _status: str
- :param _entries: The entries in the DraftPayment.
- :type _entries: list[object_.DraftPaymentEntry]
- :param _previous_updated_timestamp: The last updated_timestamp that you
- received for this DraftPayment. This needs to be provided to prevent race
- conditions.
- :type _previous_updated_timestamp: str
- :param _number_of_required_accepts: The number of accepts that are required
- for the draft payment to receive status ACCEPTED. Currently only 1 is valid.
- :type _number_of_required_accepts: int
- :param _schedule: The schedule details.
- :type _schedule: Schedule
- :param _id_: The id of the created DrafPayment.
- :type _id_: int
- :param _monetary_account_id: The id of the MonetaryAccount the DraftPayment
- applies to.
- :type _monetary_account_id: int
- :param _user_alias_created: The label of the User who created the
- DraftPayment.
- :type _user_alias_created: object_.LabelUser
- :param _responses: All responses to this draft payment.
- :type _responses: list[object_.DraftPaymentResponse]
- :param _type_: The type of the DraftPayment.
- :type _type_: str
- :param _object_: The Payment or PaymentBatch. This will only be present
- after the DraftPayment has been accepted.
- :type _object_: object_.DraftPaymentAnchorObject
- :param _request_reference_split_the_bill: The reference to the object used
- for split the bill. Can be RequestInquiry or RequestInquiryBatch
- :type _request_reference_split_the_bill:
- list[object_.RequestInquiryReference]
+ :param _name: The company name.
+ :type _name: str
+ :param _public_nick_name: The company's public nick name.
+ :type _public_nick_name: str
+ :param _avatar_uuid: The public UUID of the company's avatar.
+ :type _avatar_uuid: str
+ :param _address_main: The company's main address.
+ :type _address_main: object_.Address
+ :param _address_postal: The company's postal address.
+ :type _address_postal: object_.Address
+ :param _language: The person's preferred language. Formatted as a ISO 639-1
+ language code plus a ISO 3166-1 alpha-2 country code, seperated by an
+ underscore.
+ :type _language: str
+ :param _region: The person's preferred region. Formatted as a ISO 639-1
+ language code plus a ISO 3166-1 alpha-2 country code, seperated by an
+ underscore.
+ :type _region: str
+ :param _country: The country as an ISO 3166-1 alpha-2 country code.
+ :type _country: str
+ :param _ubo: The names of the company's ultimate beneficiary owners. Minimum
+ zero, maximum four.
+ :type _ubo: list[object_.Ubo]
+ :param _chamber_of_commerce_number: The company's chamber of commerce
+ number.
+ :type _chamber_of_commerce_number: str
+ :param _legal_form: The company's legal form.
+ :type _legal_form: str
+ :param _status: The user status. Can be: ACTIVE, SIGNUP, RECOVERY.
+ :type _status: str
+ :param _sub_status: The user sub-status. Can be: NONE, FACE_RESET, APPROVAL,
+ APPROVAL_DIRECTOR, APPROVAL_PARENT, APPROVAL_SUPPORT, COUNTER_IBAN, IDEAL or
+ SUBMIT.
+ :type _sub_status: str
+ :param _session_timeout: The setting for the session timeout of the company
+ in seconds.
+ :type _session_timeout: int
+ :param _daily_limit_without_confirmation_login: The amount the company can
+ pay in the session without asking for credentials.
+ :type _daily_limit_without_confirmation_login: object_.Amount
+ :param _id_: The id of the modified company.
+ :type _id_: int
+ :param _created: The timestamp of the company object's creation.
+ :type _created: str
+ :param _updated: The timestamp of the company object's last update.
+ :type _updated: str
+ :param _public_uuid: The company's public UUID.
+ :type _public_uuid: str
+ :param _display_name: The company's display name.
+ :type _display_name: str
+ :param _alias: The aliases of the account.
+ :type _alias: list[object_.Pointer]
+ :param _type_of_business_entity: The type of business entity.
+ :type _type_of_business_entity: str
+ :param _sector_of_industry: The sector of industry.
+ :type _sector_of_industry: str
+ :param _counter_bank_iban: The company's other bank account IBAN, through
+ which we verify it.
+ :type _counter_bank_iban: str
+ :param _avatar: The company's avatar.
+ :type _avatar: object_.Avatar
+ :param _version_terms_of_service: The version of the terms of service
+ accepted by the user.
+ :type _version_terms_of_service: str
+ :param _director_alias: The existing bunq alias for the company's primary
+ director.
+ :type _director_alias: object_.LabelUser
+ :param _directors: The existing bunq aliases for the company's directors.
+ :type _directors: list[object_.LabelUser]
+ :param _notification_filters: The types of notifications that will result in
+ a push notification or URL callback for this UserCompany.
+ :type _notification_filters: list[object_.NotificationFilter]
+ :param _customer: The customer profile of the company.
+ :type _customer: Customer
+ :param _customer_limit: The customer limits of the company.
+ :type _customer_limit: CustomerLimit
+ :param _billing_contract: The subscription of the company.
+ :type _billing_contract: list[BillingContractSubscription]
+ :param _deny_reason: The user deny reason.
+ :type _deny_reason: str
+ :param _relations: The relations for this user.
+ :type _relations: list[RelationUser]
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/draft-payment"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/draft-payment/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/draft-payment"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/draft-payment/{}"
+ _ENDPOINT_URL_READ = "user-company/{}"
+ _ENDPOINT_URL_UPDATE = "user-company/{}"
# Field constants.
+ FIELD_NAME = "name"
+ FIELD_PUBLIC_NICK_NAME = "public_nick_name"
+ FIELD_AVATAR_UUID = "avatar_uuid"
+ FIELD_ADDRESS_MAIN = "address_main"
+ FIELD_ADDRESS_POSTAL = "address_postal"
+ FIELD_LANGUAGE = "language"
+ FIELD_REGION = "region"
+ FIELD_COUNTRY = "country"
+ FIELD_UBO = "ubo"
+ FIELD_CHAMBER_OF_COMMERCE_NUMBER = "chamber_of_commerce_number"
+ FIELD_LEGAL_FORM = "legal_form"
FIELD_STATUS = "status"
- FIELD_ENTRIES = "entries"
- FIELD_PREVIOUS_UPDATED_TIMESTAMP = "previous_updated_timestamp"
- FIELD_NUMBER_OF_REQUIRED_ACCEPTS = "number_of_required_accepts"
- FIELD_SCHEDULE = "schedule"
+ FIELD_SUB_STATUS = "sub_status"
+ FIELD_SESSION_TIMEOUT = "session_timeout"
+ FIELD_DAILY_LIMIT_WITHOUT_CONFIRMATION_LOGIN = "daily_limit_without_confirmation_login"
# Object type.
- _OBJECT_TYPE_GET = "DraftPayment"
+ _OBJECT_TYPE_GET = "UserCompany"
_id_ = None
- _monetary_account_id = None
- _user_alias_created = None
- _responses = None
+ _created = None
+ _updated = None
+ _public_uuid = None
+ _name = None
+ _display_name = None
+ _public_nick_name = None
+ _alias = None
+ _chamber_of_commerce_number = None
+ _legal_form = None
+ _type_of_business_entity = None
+ _sector_of_industry = None
+ _counter_bank_iban = None
+ _avatar = None
+ _address_main = None
+ _address_postal = None
+ _version_terms_of_service = None
+ _director_alias = None
+ _directors = None
+ _language = None
+ _country = None
+ _region = None
+ _ubo = None
_status = None
- _type_ = None
- _entries = None
- _object_ = None
- _request_reference_split_the_bill = None
- _schedule = None
+ _sub_status = None
+ _session_timeout = None
+ _daily_limit_without_confirmation_login = None
+ _notification_filters = None
+ _customer = None
+ _customer_limit = None
+ _billing_contract = None
+ _deny_reason = None
+ _relations = None
+ _name_field_for_request = None
+ _public_nick_name_field_for_request = None
+ _avatar_uuid_field_for_request = None
+ _address_main_field_for_request = None
+ _address_postal_field_for_request = None
+ _language_field_for_request = None
+ _region_field_for_request = None
+ _country_field_for_request = None
+ _ubo_field_for_request = None
+ _chamber_of_commerce_number_field_for_request = None
+ _legal_form_field_for_request = None
_status_field_for_request = None
- _entries_field_for_request = None
- _previous_updated_timestamp_field_for_request = None
- _number_of_required_accepts_field_for_request = None
- _schedule_field_for_request = None
+ _sub_status_field_for_request = None
+ _session_timeout_field_for_request = None
+ _daily_limit_without_confirmation_login_field_for_request = None
- def __init__(self, number_of_required_accepts, entries=None, status=None, previous_updated_timestamp=None,
- schedule=None):
+ def __init__(self, address_main=None, language=None, region=None, name=None, public_nick_name=None,
+ avatar_uuid=None, address_postal=None, country=None, ubo=None, chamber_of_commerce_number=None,
+ legal_form=None, status=None, sub_status=None, session_timeout=None,
+ daily_limit_without_confirmation_login=None):
"""
- :param entries: The list of entries in the DraftPayment. Each entry will
- result in a payment when the DraftPayment is accepted.
- :type entries: list[object_.DraftPaymentEntry]
- :param number_of_required_accepts: The number of accepts that are required
- for the draft payment to receive status ACCEPTED. Currently only 1 is valid.
- :type number_of_required_accepts: int
- :param status: The status of the DraftPayment.
+ :param address_main: The user's main address.
+ :type address_main: object_.Address
+ :param language: The person's preferred language. Formatted as a ISO 639-1
+ language code plus a ISO 3166-1 alpha-2 country code, seperated by an
+ underscore.
+ :type language: str
+ :param region: The person's preferred region. Formatted as a ISO 639-1
+ language code plus a ISO 3166-1 alpha-2 country code, seperated by an
+ underscore.
+ :type region: str
+ :param name: The company name.
+ :type name: str
+ :param public_nick_name: The company's nick name.
+ :type public_nick_name: str
+ :param avatar_uuid: The public UUID of the company's avatar.
+ :type avatar_uuid: str
+ :param address_postal: The company's postal address.
+ :type address_postal: object_.Address
+ :param country: The country where the company is registered.
+ :type country: str
+ :param ubo: The names and birth dates of the company's ultimate beneficiary
+ owners. Minimum zero, maximum four.
+ :type ubo: list[object_.Ubo]
+ :param chamber_of_commerce_number: The company's chamber of commerce number.
+ :type chamber_of_commerce_number: str
+ :param legal_form: The company's legal form.
+ :type legal_form: str
+ :param status: The user status. Can be: ACTIVE, SIGNUP, RECOVERY.
:type status: str
- :param previous_updated_timestamp: The last updated_timestamp that you
- received for this DraftPayment. This needs to be provided to prevent race
- conditions.
- :type previous_updated_timestamp: str
- :param schedule: The schedule details when creating or updating a scheduled
- payment.
- :type schedule: Schedule
+ :param sub_status: The user sub-status. Can be: NONE, FACE_RESET, APPROVAL,
+ APPROVAL_DIRECTOR, APPROVAL_PARENT, APPROVAL_SUPPORT, COUNTER_IBAN, IDEAL or
+ SUBMIT.
+ :type sub_status: str
+ :param session_timeout: The setting for the session timeout of the company
+ in seconds.
+ :type session_timeout: int
+ :param daily_limit_without_confirmation_login: The amount the company can
+ pay in the session without asking for credentials.
+ :type daily_limit_without_confirmation_login: object_.Amount
"""
- self._entries_field_for_request = entries
- self._number_of_required_accepts_field_for_request = number_of_required_accepts
+ self._address_main_field_for_request = address_main
+ self._language_field_for_request = language
+ self._region_field_for_request = region
+ self._name_field_for_request = name
+ self._public_nick_name_field_for_request = public_nick_name
+ self._avatar_uuid_field_for_request = avatar_uuid
+ self._address_postal_field_for_request = address_postal
+ self._country_field_for_request = country
+ self._ubo_field_for_request = ubo
+ self._chamber_of_commerce_number_field_for_request = chamber_of_commerce_number
+ self._legal_form_field_for_request = legal_form
self._status_field_for_request = status
- self._previous_updated_timestamp_field_for_request = previous_updated_timestamp
- self._schedule_field_for_request = schedule
+ self._sub_status_field_for_request = sub_status
+ self._session_timeout_field_for_request = session_timeout
+ self._daily_limit_without_confirmation_login_field_for_request = daily_limit_without_confirmation_login
@classmethod
- def create(cls, entries, number_of_required_accepts, monetary_account_id=None, status=None,
- previous_updated_timestamp=None, schedule=None, custom_headers=None):
+ def get(cls, custom_headers=None):
"""
- Create a new DraftPayment.
+ Get a specific company.
- :type user_id: int
- :type monetary_account_id: int
- :param entries: The list of entries in the DraftPayment. Each entry will
- result in a payment when the DraftPayment is accepted.
- :type entries: list[object_.DraftPaymentEntry]
- :param number_of_required_accepts: The number of accepts that are
- required for the draft payment to receive status ACCEPTED. Currently
- only 1 is valid.
- :type number_of_required_accepts: int
- :param status: The status of the DraftPayment.
- :type status: str
- :param previous_updated_timestamp: The last updated_timestamp that you
- received for this DraftPayment. This needs to be provided to prevent
- race conditions.
- :type previous_updated_timestamp: str
- :param schedule: The schedule details when creating or updating a
- scheduled payment.
- :type schedule: Schedule
+ :type api_context: ApiContext
+ :type user_company_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseInt
+ :rtype: BunqResponseUserCompany
"""
if custom_headers is None:
custom_headers = {}
- request_map = {
- cls.FIELD_STATUS: status,
- cls.FIELD_ENTRIES: entries,
- cls.FIELD_PREVIOUS_UPDATED_TIMESTAMP: previous_updated_timestamp,
- cls.FIELD_NUMBER_OF_REQUIRED_ACCEPTS: number_of_required_accepts,
- cls.FIELD_SCHEDULE: schedule
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
-
api_client = ApiClient(cls._get_api_context())
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
- response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id())
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
+ return BunqResponseUserCompany.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def update(cls, draft_payment_id, monetary_account_id=None, status=None, entries=None,
- previous_updated_timestamp=None, schedule=None, custom_headers=None):
+ def update(cls, name=None, public_nick_name=None, avatar_uuid=None, address_main=None, address_postal=None,
+ language=None, region=None, country=None, ubo=None, chamber_of_commerce_number=None, legal_form=None,
+ status=None, sub_status=None, session_timeout=None, daily_limit_without_confirmation_login=None,
+ custom_headers=None):
"""
- Update a DraftPayment.
+ Modify a specific company's data.
- :type user_id: int
- :type monetary_account_id: int
- :type draft_payment_id: int
- :param status: The status of the DraftPayment.
+ :type user_company_id: int
+ :param name: The company name.
+ :type name: str
+ :param public_nick_name: The company's nick name.
+ :type public_nick_name: str
+ :param avatar_uuid: The public UUID of the company's avatar.
+ :type avatar_uuid: str
+ :param address_main: The user's main address.
+ :type address_main: object_.Address
+ :param address_postal: The company's postal address.
+ :type address_postal: object_.Address
+ :param language: The person's preferred language. Formatted as a ISO
+ 639-1 language code plus a ISO 3166-1 alpha-2 country code, seperated by
+ an underscore.
+ :type language: str
+ :param region: The person's preferred region. Formatted as a ISO 639-1
+ language code plus a ISO 3166-1 alpha-2 country code, seperated by an
+ underscore.
+ :type region: str
+ :param country: The country where the company is registered.
+ :type country: str
+ :param ubo: The names and birth dates of the company's ultimate
+ beneficiary owners. Minimum zero, maximum four.
+ :type ubo: list[object_.Ubo]
+ :param chamber_of_commerce_number: The company's chamber of commerce
+ number.
+ :type chamber_of_commerce_number: str
+ :param legal_form: The company's legal form.
+ :type legal_form: str
+ :param status: The user status. Can be: ACTIVE, SIGNUP, RECOVERY.
:type status: str
- :param entries: The list of entries in the DraftPayment. Each entry will
- result in a payment when the DraftPayment is accepted.
- :type entries: list[object_.DraftPaymentEntry]
- :param previous_updated_timestamp: The last updated_timestamp that you
- received for this DraftPayment. This needs to be provided to prevent
- race conditions.
- :type previous_updated_timestamp: str
- :param schedule: The schedule details when creating or updating a
- scheduled payment.
- :type schedule: Schedule
+ :param sub_status: The user sub-status. Can be: NONE, FACE_RESET,
+ APPROVAL, APPROVAL_DIRECTOR, APPROVAL_PARENT, APPROVAL_SUPPORT,
+ COUNTER_IBAN, IDEAL or SUBMIT.
+ :type sub_status: str
+ :param session_timeout: The setting for the session timeout of the
+ company in seconds.
+ :type session_timeout: int
+ :param daily_limit_without_confirmation_login: The amount the company
+ can pay in the session without asking for credentials.
+ :type daily_limit_without_confirmation_login: object_.Amount
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -9816,192 +9553,399 @@ def update(cls, draft_payment_id, monetary_account_id=None, status=None, entries
api_client = ApiClient(cls._get_api_context())
request_map = {
+ cls.FIELD_NAME: name,
+ cls.FIELD_PUBLIC_NICK_NAME: public_nick_name,
+ cls.FIELD_AVATAR_UUID: avatar_uuid,
+ cls.FIELD_ADDRESS_MAIN: address_main,
+ cls.FIELD_ADDRESS_POSTAL: address_postal,
+ cls.FIELD_LANGUAGE: language,
+ cls.FIELD_REGION: region,
+ cls.FIELD_COUNTRY: country,
+ cls.FIELD_UBO: ubo,
+ cls.FIELD_CHAMBER_OF_COMMERCE_NUMBER: chamber_of_commerce_number,
+ cls.FIELD_LEGAL_FORM: legal_form,
cls.FIELD_STATUS: status,
- cls.FIELD_ENTRIES: entries,
- cls.FIELD_PREVIOUS_UPDATED_TIMESTAMP: previous_updated_timestamp,
- cls.FIELD_SCHEDULE: schedule
+ cls.FIELD_SUB_STATUS: sub_status,
+ cls.FIELD_SESSION_TIMEOUT: session_timeout,
+ cls.FIELD_DAILY_LIMIT_WITHOUT_CONFIRMATION_LOGIN: daily_limit_without_confirmation_login
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- draft_payment_id)
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id())
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
cls._process_for_id(response_raw)
)
- @classmethod
- def list(cls, monetary_account_id=None, params=None, custom_headers=None):
+ @property
+ def id_(self):
"""
- Get a listing of all DraftPayments from a given MonetaryAccount.
-
- :type user_id: int
- :type monetary_account_id: int
- :type params: dict[str, str]|None
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseDraftPaymentList
+ :rtype: int
"""
- if params is None:
- params = {}
+ return self._id_
- if custom_headers is None:
- custom_headers = {}
+ @property
+ def created(self):
+ """
+ :rtype: str
+ """
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
- response_raw = api_client.get(endpoint_url, params, custom_headers)
+ return self._created
- return BunqResponseDraftPaymentList.cast_from_bunq_response(
- cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
- )
+ @property
+ def updated(self):
+ """
+ :rtype: str
+ """
- @classmethod
- def get(cls, draft_payment_id, monetary_account_id=None, custom_headers=None):
+ return self._updated
+
+ @property
+ def public_uuid(self):
"""
- Get a specific DraftPayment.
-
- :type api_context: ApiContext
- :type user_id: int
- :type monetary_account_id: int
- :type draft_payment_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseDraftPayment
+ :rtype: str
"""
- if custom_headers is None:
- custom_headers = {}
+ return self._public_uuid
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- draft_payment_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
+ @property
+ def name(self):
+ """
+ :rtype: str
+ """
- return BunqResponseDraftPayment.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
- )
+ return self._name
@property
- def id_(self):
+ def display_name(self):
"""
- :rtype: int
+ :rtype: str
"""
- return self._id_
+ return self._display_name
@property
- def monetary_account_id(self):
+ def public_nick_name(self):
"""
- :rtype: int
+ :rtype: str
"""
- return self._monetary_account_id
+ return self._public_nick_name
@property
- def user_alias_created(self):
+ def alias(self):
"""
- :rtype: object_.LabelUser
+ :rtype: list[object_.Pointer]
"""
- return self._user_alias_created
+ return self._alias
@property
- def responses(self):
+ def chamber_of_commerce_number(self):
"""
- :rtype: list[object_.DraftPaymentResponse]
+ :rtype: str
"""
- return self._responses
+ return self._chamber_of_commerce_number
@property
- def status(self):
+ def legal_form(self):
"""
:rtype: str
"""
- return self._status
+ return self._legal_form
@property
- def type_(self):
+ def type_of_business_entity(self):
"""
:rtype: str
"""
- return self._type_
+ return self._type_of_business_entity
@property
- def entries(self):
+ def sector_of_industry(self):
"""
- :rtype: list[object_.DraftPaymentEntry]
+ :rtype: str
"""
- return self._entries
+ return self._sector_of_industry
@property
- def object_(self):
+ def counter_bank_iban(self):
"""
- :rtype: object_.DraftPaymentAnchorObject
+ :rtype: str
"""
- return self._object_
+ return self._counter_bank_iban
@property
- def request_reference_split_the_bill(self):
+ def avatar(self):
"""
- :rtype: list[object_.RequestInquiryReference]
+ :rtype: object_.Avatar
"""
- return self._request_reference_split_the_bill
+ return self._avatar
@property
- def schedule(self):
+ def address_main(self):
"""
- :rtype: Schedule
+ :rtype: object_.Address
"""
- return self._schedule
+ return self._address_main
- def is_all_field_none(self):
+ @property
+ def address_postal(self):
"""
- :rtype: bool
+ :rtype: object_.Address
"""
- if self._id_ is not None:
- return False
+ return self._address_postal
- if self._monetary_account_id is not None:
- return False
+ @property
+ def version_terms_of_service(self):
+ """
+ :rtype: str
+ """
- if self._user_alias_created is not None:
- return False
+ return self._version_terms_of_service
- if self._responses is not None:
+ @property
+ def director_alias(self):
+ """
+ :rtype: object_.LabelUser
+ """
+
+ return self._director_alias
+
+ @property
+ def directors(self):
+ """
+ :rtype: list[object_.LabelUser]
+ """
+
+ return self._directors
+
+ @property
+ def language(self):
+ """
+ :rtype: str
+ """
+
+ return self._language
+
+ @property
+ def country(self):
+ """
+ :rtype: str
+ """
+
+ return self._country
+
+ @property
+ def region(self):
+ """
+ :rtype: str
+ """
+
+ return self._region
+
+ @property
+ def ubo(self):
+ """
+ :rtype: list[object_.Ubo]
+ """
+
+ return self._ubo
+
+ @property
+ def status(self):
+ """
+ :rtype: str
+ """
+
+ return self._status
+
+ @property
+ def sub_status(self):
+ """
+ :rtype: str
+ """
+
+ return self._sub_status
+
+ @property
+ def session_timeout(self):
+ """
+ :rtype: int
+ """
+
+ return self._session_timeout
+
+ @property
+ def daily_limit_without_confirmation_login(self):
+ """
+ :rtype: object_.Amount
+ """
+
+ return self._daily_limit_without_confirmation_login
+
+ @property
+ def notification_filters(self):
+ """
+ :rtype: list[object_.NotificationFilter]
+ """
+
+ return self._notification_filters
+
+ @property
+ def customer(self):
+ """
+ :rtype: Customer
+ """
+
+ return self._customer
+
+ @property
+ def customer_limit(self):
+ """
+ :rtype: CustomerLimit
+ """
+
+ return self._customer_limit
+
+ @property
+ def billing_contract(self):
+ """
+ :rtype: list[BillingContractSubscription]
+ """
+
+ return self._billing_contract
+
+ @property
+ def deny_reason(self):
+ """
+ :rtype: str
+ """
+
+ return self._deny_reason
+
+ @property
+ def relations(self):
+ """
+ :rtype: list[RelationUser]
+ """
+
+ return self._relations
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._id_ is not None:
+ return False
+
+ if self._created is not None:
+ return False
+
+ if self._updated is not None:
+ return False
+
+ if self._public_uuid is not None:
+ return False
+
+ if self._name is not None:
+ return False
+
+ if self._display_name is not None:
+ return False
+
+ if self._public_nick_name is not None:
+ return False
+
+ if self._alias is not None:
+ return False
+
+ if self._chamber_of_commerce_number is not None:
+ return False
+
+ if self._legal_form is not None:
+ return False
+
+ if self._type_of_business_entity is not None:
+ return False
+
+ if self._sector_of_industry is not None:
+ return False
+
+ if self._counter_bank_iban is not None:
+ return False
+
+ if self._avatar is not None:
+ return False
+
+ if self._address_main is not None:
+ return False
+
+ if self._address_postal is not None:
+ return False
+
+ if self._version_terms_of_service is not None:
+ return False
+
+ if self._director_alias is not None:
+ return False
+
+ if self._directors is not None:
+ return False
+
+ if self._language is not None:
+ return False
+
+ if self._country is not None:
+ return False
+
+ if self._region is not None:
+ return False
+
+ if self._ubo is not None:
return False
if self._status is not None:
return False
- if self._type_ is not None:
+ if self._sub_status is not None:
return False
- if self._entries is not None:
+ if self._session_timeout is not None:
return False
- if self._object_ is not None:
+ if self._daily_limit_without_confirmation_login is not None:
return False
- if self._request_reference_split_the_bill is not None:
+ if self._notification_filters is not None:
return False
- if self._schedule is not None:
+ if self._customer is not None:
+ return False
+
+ if self._customer_limit is not None:
+ return False
+
+ if self._billing_contract is not None:
+ return False
+
+ if self._deny_reason is not None:
+ return False
+
+ if self._relations is not None:
return False
return True
@@ -10011,203 +9955,220 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: DraftPayment
+ :rtype: UserCompany
"""
- return converter.json_to_class(DraftPayment, json_str)
+ return converter.json_to_class(UserCompany, json_str)
-class Schedule(BunqModel):
+class Customer(BunqModel):
"""
- view for reading the scheduled definitions.
+ Used to view a customer.
- :param _time_start: The schedule start time (UTC).
- :type _time_start: str
- :param _time_end: The schedule end time (UTC).
- :type _time_end: str
- :param _recurrence_unit: The schedule recurrence unit, options: ONCE,
- HOURLY, DAILY, WEEKLY, MONTHLY, YEARLY
- :type _recurrence_unit: str
- :param _recurrence_size: The schedule recurrence size. For example size 4
- and unit WEEKLY means the recurrence is every 4 weeks.
- :type _recurrence_size: int
- :param _status: The schedule status, options: ACTIVE, FINISHED, CANCELLED.
- :type _status: str
- :param _object_: The scheduled object. (Payment, PaymentBatch)
- :type _object_: object_.ScheduleAnchorObject
+ :param _billing_account_id: The primary billing account account's id.
+ :type _billing_account_id: str
+ :param _invoice_notification_preference: The preferred notification type for
+ invoices.
+ :type _invoice_notification_preference: str
+ :param _id_: The id of the customer.
+ :type _id_: int
+ :param _created: The timestamp of the customer object's creation.
+ :type _created: str
+ :param _updated: The timestamp of the customer object's last update.
+ :type _updated: str
"""
- # Endpoint constants.
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/schedule/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/schedule"
-
# Field constants.
- FIELD_TIME_START = "time_start"
- FIELD_TIME_END = "time_end"
- FIELD_RECURRENCE_UNIT = "recurrence_unit"
- FIELD_RECURRENCE_SIZE = "recurrence_size"
+ FIELD_BILLING_ACCOUNT_ID = "billing_account_id"
+ FIELD_INVOICE_NOTIFICATION_PREFERENCE = "invoice_notification_preference"
- # Object type.
- _OBJECT_TYPE_GET = "Schedule"
+ _id_ = None
+ _created = None
+ _updated = None
+ _billing_account_id = None
+ _invoice_notification_preference = None
+ _billing_account_id_field_for_request = None
+ _invoice_notification_preference_field_for_request = None
- _time_start = None
- _time_end = None
- _recurrence_unit = None
- _recurrence_size = None
- _status = None
- _object_ = None
- _time_start_field_for_request = None
- _time_end_field_for_request = None
- _recurrence_unit_field_for_request = None
- _recurrence_size_field_for_request = None
+ def __init__(self, billing_account_id=None, invoice_notification_preference=None):
+ """
+ :param billing_account_id: The primary billing account account's id.
+ :type billing_account_id: str
+ :param invoice_notification_preference: The preferred notification type for
+ invoices
+ :type invoice_notification_preference: str
+ """
- def __init__(self, time_start=None, recurrence_unit=None, recurrence_size=None, time_end=None):
+ self._billing_account_id_field_for_request = billing_account_id
+ self._invoice_notification_preference_field_for_request = invoice_notification_preference
+
+ @property
+ def id_(self):
"""
- :param time_start: The schedule start time (UTC).
- :type time_start: str
- :param recurrence_unit: The schedule recurrence unit, options: ONCE, HOURLY,
- DAILY, WEEKLY, MONTHLY, YEARLY
- :type recurrence_unit: str
- :param recurrence_size: The schedule recurrence size. For example size 4 and
- unit WEEKLY means the recurrence is every 4 weeks.
- :type recurrence_size: int
- :param time_end: The schedule end time (UTC).
- :type time_end: str
+ :rtype: int
"""
- self._time_start_field_for_request = time_start
- self._recurrence_unit_field_for_request = recurrence_unit
- self._recurrence_size_field_for_request = recurrence_size
- self._time_end_field_for_request = time_end
+ return self._id_
- @classmethod
- def get(cls, schedule_id, monetary_account_id=None, custom_headers=None):
+ @property
+ def created(self):
"""
- Get a specific schedule definition for a given monetary account.
-
- :type api_context: ApiContext
- :type user_id: int
- :type monetary_account_id: int
- :type schedule_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseSchedule
+ :rtype: str
"""
- if custom_headers is None:
- custom_headers = {}
+ return self._created
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- schedule_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
+ @property
+ def updated(self):
+ """
+ :rtype: str
+ """
- return BunqResponseSchedule.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
- )
+ return self._updated
- @classmethod
- def list(cls, monetary_account_id=None, params=None, custom_headers=None):
+ @property
+ def billing_account_id(self):
"""
- Get a collection of scheduled definition for a given monetary account.
- You can add the parameter type to filter the response. When
- type={SCHEDULE_DEFINITION_PAYMENT,SCHEDULE_DEFINITION_PAYMENT_BATCH} is
- provided only schedule definition object that relate to these
- definitions are returned.
-
- :type user_id: int
- :type monetary_account_id: int
- :type params: dict[str, str]|None
- :type custom_headers: dict[str, str]|None
+ :rtype: str
+ """
+
+ return self._billing_account_id
+
+ @property
+ def invoice_notification_preference(self):
+ """
+ :rtype: str
+ """
+
+ return self._invoice_notification_preference
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._id_ is not None:
+ return False
+
+ if self._created is not None:
+ return False
+
+ if self._updated is not None:
+ return False
+
+ if self._billing_account_id is not None:
+ return False
+
+ if self._invoice_notification_preference is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
- :rtype: BunqResponseScheduleList
+ :rtype: Customer
"""
- if params is None:
- params = {}
+ return converter.json_to_class(Customer, json_str)
- if custom_headers is None:
- custom_headers = {}
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
- response_raw = api_client.get(endpoint_url, params, custom_headers)
+class RelationUser(BunqModel):
+ """
+ Manage the relation user details.
+
+ :param _user_id: The user's ID.
+ :type _user_id: str
+ :param _counter_user_id: The counter user's ID.
+ :type _counter_user_id: str
+ :param _label_user: The user's label.
+ :type _label_user: object_.LabelUser
+ :param _counter_label_user: The counter user's label.
+ :type _counter_label_user: object_.LabelUser
+ :param _relationship: The requested relation type.
+ :type _relationship: str
+ :param _status: The request's status, only for UPDATE.
+ :type _status: str
+ """
- return BunqResponseScheduleList.cast_from_bunq_response(
- cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
- )
+ _user_id = None
+ _counter_user_id = None
+ _label_user = None
+ _counter_label_user = None
+ _relationship = None
+ _status = None
@property
- def time_start(self):
+ def user_id(self):
"""
:rtype: str
"""
- return self._time_start
+ return self._user_id
@property
- def time_end(self):
+ def counter_user_id(self):
"""
:rtype: str
"""
- return self._time_end
+ return self._counter_user_id
@property
- def recurrence_unit(self):
+ def label_user(self):
"""
- :rtype: str
+ :rtype: object_.LabelUser
"""
- return self._recurrence_unit
+ return self._label_user
@property
- def recurrence_size(self):
+ def counter_label_user(self):
"""
- :rtype: int
+ :rtype: object_.LabelUser
"""
- return self._recurrence_size
+ return self._counter_label_user
@property
- def status(self):
+ def relationship(self):
"""
:rtype: str
"""
- return self._status
+ return self._relationship
@property
- def object_(self):
+ def status(self):
"""
- :rtype: object_.ScheduleAnchorObject
+ :rtype: str
"""
- return self._object_
+ return self._status
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._time_start is not None:
+ if self._user_id is not None:
return False
- if self._time_end is not None:
+ if self._counter_user_id is not None:
return False
- if self._recurrence_unit is not None:
+ if self._label_user is not None:
return False
- if self._recurrence_size is not None:
+ if self._counter_label_user is not None:
return False
- if self._status is not None:
+ if self._relationship is not None:
return False
- if self._object_ is not None:
+ if self._status is not None:
return False
return True
@@ -10217,55 +10178,97 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: Schedule
+ :rtype: RelationUser
"""
- return converter.json_to_class(Schedule, json_str)
+ return converter.json_to_class(RelationUser, json_str)
-class DraftShareInviteBankQrCodeContent(BunqModel):
+class ConfirmationOfFunds(BunqModel):
"""
- This call returns the raw content of the QR code that links to this draft
- share invite. When a bunq user scans this QR code with the bunq app the
- draft share invite will be shown on his/her device.
+ Used to confirm availability of funds on an account.
+
+ :param _pointer_iban: The pointer (IBAN) of the account we're querying.
+ :type _pointer_iban: object_.Pointer
+ :param _amount: The amount we want to check for.
+ :type _amount: object_.Amount
+ :param _has_sufficient_funds: Whether the account has sufficient funds.
+ :type _has_sufficient_funds: bool
"""
# Endpoint constants.
- _ENDPOINT_URL_LISTING = "user/{}/draft-share-invite-bank/{}/qr-code-content"
+ _ENDPOINT_URL_CREATE = "user/{}/confirmation-of-funds"
+
+ # Field constants.
+ FIELD_POINTER_IBAN = "pointer_iban"
+ FIELD_AMOUNT = "amount"
# Object type.
- _OBJECT_TYPE_GET = "DraftShareInviteBankQrCodeContent"
+ _OBJECT_TYPE_POST = "ConfirmationOfFunds"
+
+ _has_sufficient_funds = None
+ _pointer_iban_field_for_request = None
+ _amount_field_for_request = None
+
+ def __init__(self, pointer_iban, amount):
+ """
+ :param pointer_iban: The pointer (IBAN) of the account we're querying.
+ :type pointer_iban: object_.Pointer
+ :param amount: The amount we want to check for.
+ :type amount: object_.Amount
+ """
+
+ self._pointer_iban_field_for_request = pointer_iban
+ self._amount_field_for_request = amount
@classmethod
- def list(cls, draft_share_invite_bank_id, custom_headers=None):
+ def create(cls, pointer_iban, amount, custom_headers=None):
"""
- Returns the raw content of the QR code that links to this draft share
- invite. The raw content is the binary representation of a file, without
- any JSON wrapping.
-
:type user_id: int
- :type draft_share_invite_bank_id: int
+ :param pointer_iban: The pointer (IBAN) of the account we're querying.
+ :type pointer_iban: object_.Pointer
+ :param amount: The amount we want to check for.
+ :type amount: object_.Amount
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseBytes
+ :rtype: BunqResponseConfirmationOfFunds
"""
if custom_headers is None:
custom_headers = {}
+ request_map = {
+ cls.FIELD_POINTER_IBAN: pointer_iban,
+ cls.FIELD_AMOUNT: amount
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(), draft_share_invite_bank_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
- return BunqResponseBytes.cast_from_bunq_response(
- BunqResponse(response_raw.body_bytes, response_raw.headers)
+ return BunqResponseConfirmationOfFunds.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_POST)
)
- def is_all_field_none(self):
+ @property
+ def has_sufficient_funds(self):
"""
:rtype: bool
"""
+ return self._has_sufficient_funds
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._has_sufficient_funds is not None:
+ return False
+
return True
@staticmethod
@@ -10273,89 +10276,97 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: DraftShareInviteBankQrCodeContent
+ :rtype: ConfirmationOfFunds
"""
- return converter.json_to_class(DraftShareInviteBankQrCodeContent, json_str)
+ return converter.json_to_class(ConfirmationOfFunds, json_str)
-class DraftShareInviteBank(BunqModel):
+class DeviceServer(BunqModel):
"""
- Used to create a draft share invite for a monetary account with another bunq
- user, as in the 'Connect' feature in the bunq app. The user that accepts the
- invite can share one of their MonetaryAccounts with the user that created
- the invite.
+ After having created an Installation you can now create a DeviceServer. A
+ DeviceServer is needed to do a login call with session-server.
- :param _status: The status of the draft share invite. Can be USED, CANCELLED
- and PENDING.
- :type _status: str
- :param _expiration: The moment when this draft share invite expires.
- :type _expiration: str
- :param _draft_share_settings: The draft share invite details.
- :type _draft_share_settings: object_.DraftShareInviteEntry
- :param _user_alias_created: The user who created the draft share invite.
- :type _user_alias_created: object_.LabelUser
- :param _share_invite_bank_response_id: The id of the share invite bank
- response this draft share belongs to.
- :type _share_invite_bank_response_id: int
- :param _draft_share_url: The URL redirecting user to the draft share invite
- in the app. Only works on mobile devices.
- :type _draft_share_url: str
- :param _id_: The id of the newly created draft share invite.
+ :param _description: The description of the DeviceServer.
+ :type _description: str
+ :param _secret: The API key. You can request an API key in the bunq app.
+ :type _secret: str
+ :param _permitted_ips: An array of IPs (v4 or v6) this DeviceServer will be
+ able to do calls from. These will be linked to the API key.
+ :type _permitted_ips: list[str]
+ :param _id_: The id of the DeviceServer as created on the server.
:type _id_: int
+ :param _created: The timestamp of the DeviceServer's creation.
+ :type _created: str
+ :param _updated: The timestamp of the DeviceServer's last update.
+ :type _updated: str
+ :param _ip: The ip address which was used to create the DeviceServer.
+ :type _ip: str
+ :param _status: The status of the DeviceServer. Can be ACTIVE, BLOCKED,
+ NEEDS_CONFIRMATION or OBSOLETE.
+ :type _status: str
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/draft-share-invite-bank"
- _ENDPOINT_URL_READ = "user/{}/draft-share-invite-bank/{}"
- _ENDPOINT_URL_UPDATE = "user/{}/draft-share-invite-bank/{}"
- _ENDPOINT_URL_LISTING = "user/{}/draft-share-invite-bank"
+ _ENDPOINT_URL_CREATE = "device-server"
+ _ENDPOINT_URL_READ = "device-server/{}"
+ _ENDPOINT_URL_LISTING = "device-server"
# Field constants.
- FIELD_STATUS = "status"
- FIELD_EXPIRATION = "expiration"
- FIELD_DRAFT_SHARE_SETTINGS = "draft_share_settings"
+ FIELD_DESCRIPTION = "description"
+ FIELD_SECRET = "secret"
+ FIELD_PERMITTED_IPS = "permitted_ips"
# Object type.
- _OBJECT_TYPE_GET = "DraftShareInviteBank"
+ _OBJECT_TYPE_GET = "DeviceServer"
- _user_alias_created = None
- _status = None
- _expiration = None
- _share_invite_bank_response_id = None
- _draft_share_url = None
- _draft_share_settings = None
_id_ = None
- _status_field_for_request = None
- _expiration_field_for_request = None
- _draft_share_settings_field_for_request = None
+ _created = None
+ _updated = None
+ _description = None
+ _ip = None
+ _status = None
+ _description_field_for_request = None
+ _secret_field_for_request = None
+ _permitted_ips_field_for_request = None
- def __init__(self, expiration=None, draft_share_settings=None, status=None):
+ def __init__(self, description, secret, permitted_ips=None):
"""
- :param expiration: The moment when this draft share invite expires.
- :type expiration: str
- :param draft_share_settings: The draft share invite details.
- :type draft_share_settings: object_.DraftShareInviteEntry
- :param status: The status of the draft share invite. Can be CANCELLED (the
- user cancels the draft share before it's used).
- :type status: str
+ :param description: The description of the DeviceServer. This is only for
+ your own reference when reading the DeviceServer again.
+ :type description: str
+ :param secret: The API key. You can request an API key in the bunq app.
+ :type secret: str
+ :param permitted_ips: An array of IPs (v4 or v6) this DeviceServer will be
+ able to do calls from. These will be linked to the API key.
+ :type permitted_ips: list[str]
"""
- self._expiration_field_for_request = expiration
- self._draft_share_settings_field_for_request = draft_share_settings
- self._status_field_for_request = status
+ self._description_field_for_request = description
+ self._secret_field_for_request = secret
+ self._permitted_ips_field_for_request = permitted_ips
@classmethod
- def create(cls, expiration, draft_share_settings, status=None, custom_headers=None):
+ def create(cls, description, secret, permitted_ips=None, custom_headers=None):
"""
- :type user_id: int
- :param expiration: The moment when this draft share invite expires.
- :type expiration: str
- :param draft_share_settings: The draft share invite details.
- :type draft_share_settings: object_.DraftShareInviteEntry
- :param status: The status of the draft share invite. Can be CANCELLED
- (the user cancels the draft share before it's used).
- :type status: str
+ Create a new DeviceServer providing the installation token in the header
+ and signing the request with the private part of the key you used to
+ create the installation. The API Key that you are using will be bound to
+ the IP address of the DeviceServer which you have
+ created.
Using a Wildcard API Key gives you the freedom to make
+ API calls even if the IP address has changed after the POST
+ device-server.
Find out more at this link https://bunq.com/en/apikey-dynamic-ip.
+
+ :param description: The description of the DeviceServer. This is only
+ for your own reference when reading the DeviceServer again.
+ :type description: str
+ :param secret: The API key. You can request an API key in the bunq app.
+ :type secret: str
+ :param permitted_ips: An array of IPs (v4 or v6) this DeviceServer will
+ be able to do calls from. These will be linked to the API key.
+ :type permitted_ips: list[str]
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -10365,16 +10376,16 @@ def create(cls, expiration, draft_share_settings, status=None, custom_headers=No
custom_headers = {}
request_map = {
- cls.FIELD_STATUS: status,
- cls.FIELD_EXPIRATION: expiration,
- cls.FIELD_DRAFT_SHARE_SETTINGS: draft_share_settings
+ cls.FIELD_DESCRIPTION: description,
+ cls.FIELD_SECRET: secret,
+ cls.FIELD_PERMITTED_IPS: permitted_ips
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
api_client = ApiClient(cls._get_api_context())
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
+ endpoint_url = cls._ENDPOINT_URL_CREATE
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -10382,79 +10393,37 @@ def create(cls, expiration, draft_share_settings, status=None, custom_headers=No
)
@classmethod
- def get(cls, draft_share_invite_bank_id, custom_headers=None):
+ def get(cls, device_server_id, custom_headers=None):
"""
- Get the details of a specific draft of a share invite.
+ Get one of your DeviceServers.
:type api_context: ApiContext
- :type user_id: int
- :type draft_share_invite_bank_id: int
+ :type device_server_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseDraftShareInviteBank
+ :rtype: BunqResponseDeviceServer
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), draft_share_invite_bank_id)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(device_server_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseDraftShareInviteBank.cast_from_bunq_response(
+ return BunqResponseDeviceServer.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
- @classmethod
- def update(cls, draft_share_invite_bank_id, status=None, expiration=None, draft_share_settings=None,
- custom_headers=None):
- """
- Update a draft share invite. When sending status CANCELLED it is
- possible to cancel the draft share invite.
-
- :type user_id: int
- :type draft_share_invite_bank_id: int
- :param status: The status of the draft share invite. Can be CANCELLED
- (the user cancels the draft share before it's used).
- :type status: str
- :param expiration: The moment when this draft share invite expires.
- :type expiration: str
- :param draft_share_settings: The draft share invite details.
- :type draft_share_settings: object_.DraftShareInviteEntry
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseInt
- """
-
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
-
- request_map = {
- cls.FIELD_STATUS: status,
- cls.FIELD_EXPIRATION: expiration,
- cls.FIELD_DRAFT_SHARE_SETTINGS: draft_share_settings
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
-
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(), draft_share_invite_bank_id)
- response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
-
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
- )
-
@classmethod
def list(cls, params=None, custom_headers=None):
"""
- :type user_id: int
+ Get a collection of all the DeviceServers you have created.
+
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseDraftShareInviteBankList
+ :rtype: BunqResponseDeviceServerList
"""
if params is None:
@@ -10464,93 +10433,82 @@ def list(cls, params=None, custom_headers=None):
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ endpoint_url = cls._ENDPOINT_URL_LISTING
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseDraftShareInviteBankList.cast_from_bunq_response(
+ return BunqResponseDeviceServerList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@property
- def user_alias_created(self):
+ def id_(self):
"""
- :rtype: object_.LabelUser
+ :rtype: int
"""
- return self._user_alias_created
+ return self._id_
@property
- def status(self):
+ def created(self):
"""
:rtype: str
"""
- return self._status
+ return self._created
@property
- def expiration(self):
+ def updated(self):
"""
:rtype: str
"""
- return self._expiration
-
- @property
- def share_invite_bank_response_id(self):
- """
- :rtype: int
- """
-
- return self._share_invite_bank_response_id
+ return self._updated
@property
- def draft_share_url(self):
+ def description(self):
"""
:rtype: str
"""
- return self._draft_share_url
+ return self._description
@property
- def draft_share_settings(self):
+ def ip(self):
"""
- :rtype: object_.DraftShareInviteEntry
+ :rtype: str
"""
- return self._draft_share_settings
+ return self._ip
@property
- def id_(self):
+ def status(self):
"""
- :rtype: int
+ :rtype: str
"""
- return self._id_
+ return self._status
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._user_alias_created is not None:
- return False
-
- if self._status is not None:
+ if self._id_ is not None:
return False
- if self._expiration is not None:
+ if self._created is not None:
return False
- if self._share_invite_bank_response_id is not None:
+ if self._updated is not None:
return False
- if self._draft_share_url is not None:
+ if self._description is not None:
return False
- if self._draft_share_settings is not None:
+ if self._ip is not None:
return False
- if self._id_ is not None:
+ if self._status is not None:
return False
return True
@@ -10560,102 +10518,66 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: DraftShareInviteBank
+ :rtype: DeviceServer
"""
- return converter.json_to_class(DraftShareInviteBank, json_str)
+ return converter.json_to_class(DeviceServer, json_str)
-class Event(BunqModel):
+class Device(BunqModel, AnchorObjectInterface):
"""
- Used to view events. Events are automatically created and contain
- information about everything that happens to your bunq account. In the bunq
- app events are shown in your 'overview'. Examples of when events are created
- or modified: payment sent, payment received, request for payment received or
- connect invite received.
+ Used to get a Device or a listing of Devices. Creating a DeviceServer should
+ happen via /device-server
- :param _id_: The id of the event.
- :type _id_: int
- :param _created: The timestamp of the event's creation.
- :type _created: str
- :param _updated: The timestamp of the event's last update.
- :type _updated: str
- :param _action: The performed action. Can be: CREATE or UPDATE.
- :type _action: str
- :param _user_id: The id of the user the event applied to (if it was a user
- event).
- :type _user_id: str
- :param _monetary_account_id: The id of the monetary account the event
- applied to (if it was a monetary account event).
- :type _monetary_account_id: str
- :param _object_: The details of the external object the event was created
- for.
- :type _object_: object_.EventObject
- :param _status: The event status. Can be: FINALIZED or AWAITING_REPLY. An
- example of FINALIZED event is a payment received event, while an
- AWAITING_REPLY event is a request received event.
- :type _status: str
+ :param _DeviceServer:
+ :type _DeviceServer: DeviceServer
"""
+ # Error constants.
+ _ERROR_NULL_FIELDS = "All fields of an extended model or object are null."
+
# Endpoint constants.
- _ENDPOINT_URL_READ = "user/{}/event/{}"
- _ENDPOINT_URL_LISTING = "user/{}/event"
+ _ENDPOINT_URL_READ = "device/{}"
+ _ENDPOINT_URL_LISTING = "device"
# Object type.
- _OBJECT_TYPE_GET = "Event"
+ _OBJECT_TYPE_GET = "Device"
- _id_ = None
- _created = None
- _updated = None
- _action = None
- _user_id = None
- _monetary_account_id = None
- _object_ = None
- _status = None
+ _DeviceServer = None
@classmethod
- def get(cls, event_id, custom_headers=None):
+ def get(cls, device_id, custom_headers=None):
"""
- Get a specific event for a given user.
+ Get a single Device. A Device is either a DevicePhone or a DeviceServer.
:type api_context: ApiContext
- :type user_id: int
- :type event_id: int
+ :type device_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseEvent
+ :rtype: BunqResponseDevice
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), event_id)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(device_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseEvent.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ return BunqResponseDevice.cast_from_bunq_response(
+ cls._from_json(response_raw)
)
@classmethod
def list(cls, params=None, custom_headers=None):
"""
- Get a collection of events for a given user. You can add query the
- parameters monetary_account_id, status and/or display_user_event to
- filter the response. When monetary_account_id={id,id} is provided only
- events that relate to these monetary account ids are returned. When
- status={AWAITING_REPLY/FINALIZED} is provided the response only contains
- events with the status AWAITING_REPLY or FINALIZED. When
- display_user_event={true/false} is set to false user events are excluded
- from the response, when not provided user events are displayed. User
- events are events that are not related to a monetary account (for
- example: connect invites).
+ Get a collection of Devices. A Device is either a DevicePhone or a
+ DeviceServer.
- :type user_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseEventList
+ :rtype: BunqResponseDeviceList
"""
if params is None:
@@ -10665,104 +10587,38 @@ def list(cls, params=None, custom_headers=None):
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ endpoint_url = cls._ENDPOINT_URL_LISTING
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseEventList.cast_from_bunq_response(
- cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ return BunqResponseDeviceList.cast_from_bunq_response(
+ cls._from_json_list(response_raw)
)
@property
- def id_(self):
- """
- :rtype: int
- """
-
- return self._id_
-
- @property
- def created(self):
- """
- :rtype: str
- """
-
- return self._created
-
- @property
- def updated(self):
- """
- :rtype: str
- """
-
- return self._updated
-
- @property
- def action(self):
- """
- :rtype: str
- """
-
- return self._action
-
- @property
- def user_id(self):
- """
- :rtype: str
- """
-
- return self._user_id
-
- @property
- def monetary_account_id(self):
+ def DeviceServer(self):
"""
- :rtype: str
+ :rtype: DeviceServer
"""
- return self._monetary_account_id
+ return self._DeviceServer
- @property
- def object_(self):
+ def get_referenced_object(self):
"""
- :rtype: object_.EventObject
+ :rtype: BunqModel
+ :raise: BunqException
"""
- return self._object_
-
- @property
- def status(self):
- """
- :rtype: str
- """
+ if self._DeviceServer is not None:
+ return self._DeviceServer
- return self._status
+ raise BunqException(self._ERROR_NULL_FIELDS)
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._id_ is not None:
- return False
-
- if self._created is not None:
- return False
-
- if self._updated is not None:
- return False
-
- if self._action is not None:
- return False
-
- if self._user_id is not None:
- return False
-
- if self._monetary_account_id is not None:
- return False
-
- if self._object_ is not None:
- return False
-
- if self._status is not None:
+ if self._DeviceServer is not None:
return False
return True
@@ -10772,194 +10628,133 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: Event
+ :rtype: Device
"""
- return converter.json_to_class(Event, json_str)
+ return converter.json_to_class(Device, json_str)
-class FeatureAnnouncement(BunqModel):
+class DraftPayment(BunqModel):
"""
- view for updating the feature display.
+ A DraftPayment is like a regular Payment, but it needs to be accepted by the
+ sending party before the actual Payment is done.
- :param _avatar: The Avatar of the event overview.
- :type _avatar: object_.Avatar
- :param _title: The event overview title of the feature display
- :type _title: str
- :param _sub_title: The event overview subtitle of the feature display
- :type _sub_title: str
+ :param _status: The status of the DraftPayment.
+ :type _status: str
+ :param _entries: The entries in the DraftPayment.
+ :type _entries: list[object_.DraftPaymentEntry]
+ :param _previous_updated_timestamp: The last updated_timestamp that you
+ received for this DraftPayment. This needs to be provided to prevent race
+ conditions.
+ :type _previous_updated_timestamp: str
+ :param _number_of_required_accepts: The number of accepts that are required
+ for the draft payment to receive status ACCEPTED. Currently only 1 is valid.
+ :type _number_of_required_accepts: int
+ :param _schedule: The schedule details.
+ :type _schedule: Schedule
+ :param _id_: The id of the created DrafPayment.
+ :type _id_: int
+ :param _monetary_account_id: The id of the MonetaryAccount the DraftPayment
+ applies to.
+ :type _monetary_account_id: int
+ :param _user_alias_created: The label of the User who created the
+ DraftPayment.
+ :type _user_alias_created: object_.LabelUser
+ :param _responses: All responses to this draft payment.
+ :type _responses: list[object_.DraftPaymentResponse]
+ :param _type_: The type of the DraftPayment.
+ :type _type_: str
+ :param _object_: The Payment or PaymentBatch. This will only be present
+ after the DraftPayment has been accepted.
+ :type _object_: object_.DraftPaymentAnchorObject
+ :param _request_reference_split_the_bill: The reference to the object used
+ for split the bill. Can be RequestInquiry or RequestInquiryBatch
+ :type _request_reference_split_the_bill:
+ list[object_.RequestInquiryReference]
"""
# Endpoint constants.
- _ENDPOINT_URL_READ = "user/{}/feature-announcement/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/draft-payment"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/draft-payment/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/draft-payment"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/draft-payment/{}"
- # Object type.
- _OBJECT_TYPE_GET = "FeatureAnnouncement"
+ # Field constants.
+ FIELD_STATUS = "status"
+ FIELD_ENTRIES = "entries"
+ FIELD_PREVIOUS_UPDATED_TIMESTAMP = "previous_updated_timestamp"
+ FIELD_NUMBER_OF_REQUIRED_ACCEPTS = "number_of_required_accepts"
+ FIELD_SCHEDULE = "schedule"
- _avatar = None
- _title = None
- _sub_title = None
-
- @classmethod
- def get(cls, feature_announcement_id, custom_headers=None):
- """
- :type api_context: ApiContext
- :type user_id: int
- :type feature_announcement_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseFeatureAnnouncement
- """
-
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), feature_announcement_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
-
- return BunqResponseFeatureAnnouncement.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
- )
-
- @property
- def avatar(self):
- """
- :rtype: object_.Avatar
- """
-
- return self._avatar
-
- @property
- def title(self):
- """
- :rtype: str
- """
-
- return self._title
-
- @property
- def sub_title(self):
- """
- :rtype: str
- """
-
- return self._sub_title
-
- def is_all_field_none(self):
- """
- :rtype: bool
- """
-
- if self._avatar is not None:
- return False
-
- if self._title is not None:
- return False
-
- if self._sub_title is not None:
- return False
-
- return True
-
- @staticmethod
- def from_json(json_str):
- """
- :type json_str: str
-
- :rtype: FeatureAnnouncement
- """
-
- return converter.json_to_class(FeatureAnnouncement, json_str)
-
-
-class IdealMerchantTransaction(BunqModel):
- """
- View for requesting iDEAL transactions and polling their status.
-
- :param _amount_requested: The requested amount of money to add.
- :type _amount_requested: object_.Amount
- :param _issuer: The BIC of the issuer.
- :type _issuer: str
- :param _monetary_account_id: The id of the monetary account this ideal
- merchant transaction links to.
- :type _monetary_account_id: int
- :param _alias: The alias of the monetary account to add money to.
- :type _alias: object_.MonetaryAccountReference
- :param _counterparty_alias: The alias of the monetary account the money
- comes from.
- :type _counterparty_alias: object_.MonetaryAccountReference
- :param _amount_guaranteed: In case of a successful transaction, the amount
- of money that will be transferred.
- :type _amount_guaranteed: object_.Amount
- :param _expiration: When the transaction will expire.
- :type _expiration: str
- :param _issuer_name: The Name of the issuer.
- :type _issuer_name: str
- :param _issuer_authentication_url: The URL to visit to
- :type _issuer_authentication_url: str
- :param _purchase_identifier: The 'purchase ID' of the iDEAL transaction.
- :type _purchase_identifier: str
- :param _status: The status of the transaction.
- :type _status: str
- :param _status_timestamp: When the status was last updated.
- :type _status_timestamp: str
- :param _transaction_identifier: The 'transaction ID' of the iDEAL
- transaction.
- :type _transaction_identifier: str
- :param _allow_chat: Whether or not chat messages are allowed.
- :type _allow_chat: bool
- """
-
- # Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/ideal-merchant-transaction"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/ideal-merchant-transaction"
-
- # Field constants.
- FIELD_AMOUNT_REQUESTED = "amount_requested"
- FIELD_ISSUER = "issuer"
-
- # Object type.
- _OBJECT_TYPE_GET = "IdealMerchantTransaction"
+ # Object type.
+ _OBJECT_TYPE_GET = "DraftPayment"
+ _id_ = None
_monetary_account_id = None
- _alias = None
- _counterparty_alias = None
- _amount_guaranteed = None
- _amount_requested = None
- _expiration = None
- _issuer = None
- _issuer_name = None
- _issuer_authentication_url = None
- _purchase_identifier = None
+ _user_alias_created = None
+ _responses = None
_status = None
- _status_timestamp = None
- _transaction_identifier = None
- _allow_chat = None
- _amount_requested_field_for_request = None
- _issuer_field_for_request = None
+ _type_ = None
+ _entries = None
+ _object_ = None
+ _request_reference_split_the_bill = None
+ _schedule = None
+ _status_field_for_request = None
+ _entries_field_for_request = None
+ _previous_updated_timestamp_field_for_request = None
+ _number_of_required_accepts_field_for_request = None
+ _schedule_field_for_request = None
- def __init__(self, amount_requested, issuer):
+ def __init__(self, number_of_required_accepts, entries=None, status=None, previous_updated_timestamp=None,
+ schedule=None):
"""
- :param amount_requested: The requested amount of money to add.
- :type amount_requested: object_.Amount
- :param issuer: The BIC of the issuing bank to ask for money.
- :type issuer: str
+ :param entries: The list of entries in the DraftPayment. Each entry will
+ result in a payment when the DraftPayment is accepted.
+ :type entries: list[object_.DraftPaymentEntry]
+ :param number_of_required_accepts: The number of accepts that are required
+ for the draft payment to receive status ACCEPTED. Currently only 1 is valid.
+ :type number_of_required_accepts: int
+ :param status: The status of the DraftPayment.
+ :type status: str
+ :param previous_updated_timestamp: The last updated_timestamp that you
+ received for this DraftPayment. This needs to be provided to prevent race
+ conditions.
+ :type previous_updated_timestamp: str
+ :param schedule: The schedule details when creating or updating a scheduled
+ payment.
+ :type schedule: Schedule
"""
- self._amount_requested_field_for_request = amount_requested
- self._issuer_field_for_request = issuer
+ self._entries_field_for_request = entries
+ self._number_of_required_accepts_field_for_request = number_of_required_accepts
+ self._status_field_for_request = status
+ self._previous_updated_timestamp_field_for_request = previous_updated_timestamp
+ self._schedule_field_for_request = schedule
@classmethod
- def create(cls, amount_requested, issuer, monetary_account_id=None, custom_headers=None):
+ def create(cls, entries, number_of_required_accepts, monetary_account_id=None, status=None,
+ previous_updated_timestamp=None, schedule=None, custom_headers=None):
"""
+ Create a new DraftPayment.
+
:type user_id: int
:type monetary_account_id: int
- :param amount_requested: The requested amount of money to add.
- :type amount_requested: object_.Amount
- :param issuer: The BIC of the issuing bank to ask for money.
- :type issuer: str
+ :param entries: The list of entries in the DraftPayment. Each entry will
+ result in a payment when the DraftPayment is accepted.
+ :type entries: list[object_.DraftPaymentEntry]
+ :param number_of_required_accepts: The number of accepts that are
+ required for the draft payment to receive status ACCEPTED. Currently
+ only 1 is valid.
+ :type number_of_required_accepts: int
+ :param status: The status of the DraftPayment.
+ :type status: str
+ :param previous_updated_timestamp: The last updated_timestamp that you
+ received for this DraftPayment. This needs to be provided to prevent
+ race conditions.
+ :type previous_updated_timestamp: str
+ :param schedule: The schedule details when creating or updating a
+ scheduled payment.
+ :type schedule: Schedule
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -10969,8 +10764,11 @@ def create(cls, amount_requested, issuer, monetary_account_id=None, custom_heade
custom_headers = {}
request_map = {
- cls.FIELD_AMOUNT_REQUESTED: amount_requested,
- cls.FIELD_ISSUER: issuer
+ cls.FIELD_STATUS: status,
+ cls.FIELD_ENTRIES: entries,
+ cls.FIELD_PREVIOUS_UPDATED_TIMESTAMP: previous_updated_timestamp,
+ cls.FIELD_NUMBER_OF_REQUIRED_ACCEPTS: number_of_required_accepts,
+ cls.FIELD_SCHEDULE: schedule
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
@@ -10986,39 +10784,66 @@ def create(cls, amount_requested, issuer, monetary_account_id=None, custom_heade
)
@classmethod
- def get(cls, ideal_merchant_transaction_id, monetary_account_id=None, custom_headers=None):
+ def update(cls, draft_payment_id, monetary_account_id=None, status=None, entries=None,
+ previous_updated_timestamp=None, schedule=None, custom_headers=None):
"""
- :type api_context: ApiContext
+ Update a DraftPayment.
+
:type user_id: int
:type monetary_account_id: int
- :type ideal_merchant_transaction_id: int
+ :type draft_payment_id: int
+ :param status: The status of the DraftPayment.
+ :type status: str
+ :param entries: The list of entries in the DraftPayment. Each entry will
+ result in a payment when the DraftPayment is accepted.
+ :type entries: list[object_.DraftPaymentEntry]
+ :param previous_updated_timestamp: The last updated_timestamp that you
+ received for this DraftPayment. This needs to be provided to prevent
+ race conditions.
+ :type previous_updated_timestamp: str
+ :param schedule: The schedule details when creating or updating a
+ scheduled payment.
+ :type schedule: Schedule
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseIdealMerchantTransaction
+ :rtype: BunqResponseInt
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- ideal_merchant_transaction_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseIdealMerchantTransaction.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ request_map = {
+ cls.FIELD_STATUS: status,
+ cls.FIELD_ENTRIES: entries,
+ cls.FIELD_PREVIOUS_UPDATED_TIMESTAMP: previous_updated_timestamp,
+ cls.FIELD_SCHEDULE: schedule
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ draft_payment_id)
+ response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
)
@classmethod
def list(cls, monetary_account_id=None, params=None, custom_headers=None):
"""
+ Get a listing of all DraftPayments from a given MonetaryAccount.
+
:type user_id: int
:type monetary_account_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseIdealMerchantTransactionList
+ :rtype: BunqResponseDraftPaymentList
"""
if params is None:
@@ -11032,167 +10857,150 @@ def list(cls, monetary_account_id=None, params=None, custom_headers=None):
cls._determine_monetary_account_id(monetary_account_id))
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseIdealMerchantTransactionList.cast_from_bunq_response(
+ return BunqResponseDraftPaymentList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
- @property
- def monetary_account_id(self):
- """
- :rtype: int
- """
-
- return self._monetary_account_id
-
- @property
- def alias(self):
- """
- :rtype: object_.MonetaryAccountReference
- """
-
- return self._alias
-
- @property
- def counterparty_alias(self):
+ @classmethod
+ def get(cls, draft_payment_id, monetary_account_id=None, custom_headers=None):
"""
- :rtype: object_.MonetaryAccountReference
+ Get a specific DraftPayment.
+
+ :type api_context: ApiContext
+ :type user_id: int
+ :type monetary_account_id: int
+ :type draft_payment_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseDraftPayment
"""
- return self._counterparty_alias
+ if custom_headers is None:
+ custom_headers = {}
- @property
- def amount_guaranteed(self):
- """
- :rtype: object_.Amount
- """
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ draft_payment_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return self._amount_guaranteed
+ return BunqResponseDraftPayment.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
@property
- def amount_requested(self):
+ def id_(self):
"""
- :rtype: object_.Amount
+ :rtype: int
"""
- return self._amount_requested
+ return self._id_
@property
- def expiration(self):
+ def monetary_account_id(self):
"""
- :rtype: str
+ :rtype: int
"""
- return self._expiration
+ return self._monetary_account_id
@property
- def issuer(self):
+ def user_alias_created(self):
"""
- :rtype: str
+ :rtype: object_.LabelUser
"""
- return self._issuer
+ return self._user_alias_created
@property
- def issuer_name(self):
+ def responses(self):
"""
- :rtype: str
+ :rtype: list[object_.DraftPaymentResponse]
"""
- return self._issuer_name
+ return self._responses
@property
- def issuer_authentication_url(self):
+ def status(self):
"""
:rtype: str
"""
- return self._issuer_authentication_url
+ return self._status
@property
- def purchase_identifier(self):
+ def type_(self):
"""
:rtype: str
"""
- return self._purchase_identifier
+ return self._type_
@property
- def status(self):
+ def entries(self):
"""
- :rtype: str
+ :rtype: list[object_.DraftPaymentEntry]
"""
- return self._status
+ return self._entries
@property
- def status_timestamp(self):
+ def object_(self):
"""
- :rtype: str
+ :rtype: object_.DraftPaymentAnchorObject
"""
- return self._status_timestamp
+ return self._object_
@property
- def transaction_identifier(self):
+ def request_reference_split_the_bill(self):
"""
- :rtype: str
+ :rtype: list[object_.RequestInquiryReference]
"""
- return self._transaction_identifier
+ return self._request_reference_split_the_bill
@property
- def allow_chat(self):
+ def schedule(self):
"""
- :rtype: bool
+ :rtype: Schedule
"""
- return self._allow_chat
+ return self._schedule
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._monetary_account_id is not None:
- return False
-
- if self._alias is not None:
- return False
-
- if self._counterparty_alias is not None:
- return False
-
- if self._amount_guaranteed is not None:
- return False
-
- if self._amount_requested is not None:
+ if self._id_ is not None:
return False
- if self._expiration is not None:
+ if self._monetary_account_id is not None:
return False
- if self._issuer is not None:
+ if self._user_alias_created is not None:
return False
- if self._issuer_name is not None:
+ if self._responses is not None:
return False
- if self._issuer_authentication_url is not None:
+ if self._status is not None:
return False
- if self._purchase_identifier is not None:
+ if self._type_ is not None:
return False
- if self._status is not None:
+ if self._entries is not None:
return False
- if self._status_timestamp is not None:
+ if self._object_ is not None:
return False
- if self._transaction_identifier is not None:
+ if self._request_reference_split_the_bill is not None:
return False
- if self._allow_chat is not None:
+ if self._schedule is not None:
return False
return True
@@ -11202,154 +11010,121 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: IdealMerchantTransaction
+ :rtype: DraftPayment
"""
- return converter.json_to_class(IdealMerchantTransaction, json_str)
+ return converter.json_to_class(DraftPayment, json_str)
-class SchedulePayment(BunqModel):
+class Schedule(BunqModel):
"""
- Endpoint for schedule payments.
+ view for reading the scheduled definitions.
- :param _payment: The payment details.
- :type _payment: object_.SchedulePaymentEntry
- :param _schedule: The schedule details.
- :type _schedule: Schedule
+ :param _time_start: The schedule start time (UTC).
+ :type _time_start: str
+ :param _time_end: The schedule end time (UTC).
+ :type _time_end: str
+ :param _recurrence_unit: The schedule recurrence unit, options: ONCE,
+ HOURLY, DAILY, WEEKLY, MONTHLY, YEARLY
+ :type _recurrence_unit: str
+ :param _recurrence_size: The schedule recurrence size. For example size 4
+ and unit WEEKLY means the recurrence is every 4 weeks.
+ :type _recurrence_size: int
:param _status: The schedule status, options: ACTIVE, FINISHED, CANCELLED.
:type _status: str
+ :param _object_: The scheduled object. (Payment, PaymentBatch)
+ :type _object_: object_.ScheduleAnchorObject
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/schedule-payment"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/schedule-payment/{}"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/schedule-payment/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/schedule-payment"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/schedule-payment/{}"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/schedule/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/schedule"
# Field constants.
- FIELD_PAYMENT = "payment"
- FIELD_SCHEDULE = "schedule"
+ FIELD_TIME_START = "time_start"
+ FIELD_TIME_END = "time_end"
+ FIELD_RECURRENCE_UNIT = "recurrence_unit"
+ FIELD_RECURRENCE_SIZE = "recurrence_size"
# Object type.
- _OBJECT_TYPE_GET = "ScheduledPayment"
- _OBJECT_TYPE_PUT = "ScheduledPayment"
+ _OBJECT_TYPE_GET = "Schedule"
- _payment = None
- _schedule = None
+ _time_start = None
+ _time_end = None
+ _recurrence_unit = None
+ _recurrence_size = None
_status = None
- _payment_field_for_request = None
- _schedule_field_for_request = None
+ _object_ = None
+ _time_start_field_for_request = None
+ _time_end_field_for_request = None
+ _recurrence_unit_field_for_request = None
+ _recurrence_size_field_for_request = None
- def __init__(self, payment=None, schedule=None):
+ def __init__(self, time_start=None, recurrence_unit=None, recurrence_size=None, time_end=None):
"""
- :param payment: The payment details.
- :type payment: object_.SchedulePaymentEntry
- :param schedule: The schedule details when creating or updating a scheduled
- payment.
- :type schedule: Schedule
+ :param time_start: The schedule start time (UTC).
+ :type time_start: str
+ :param recurrence_unit: The schedule recurrence unit, options: ONCE, HOURLY,
+ DAILY, WEEKLY, MONTHLY, YEARLY
+ :type recurrence_unit: str
+ :param recurrence_size: The schedule recurrence size. For example size 4 and
+ unit WEEKLY means the recurrence is every 4 weeks.
+ :type recurrence_size: int
+ :param time_end: The schedule end time (UTC).
+ :type time_end: str
"""
- self._payment_field_for_request = payment
- self._schedule_field_for_request = schedule
+ self._time_start_field_for_request = time_start
+ self._recurrence_unit_field_for_request = recurrence_unit
+ self._recurrence_size_field_for_request = recurrence_size
+ self._time_end_field_for_request = time_end
@classmethod
- def create(cls, payment, schedule, monetary_account_id=None, custom_headers=None):
+ def get(cls, schedule_id, monetary_account_id=None, custom_headers=None):
"""
+ Get a specific schedule definition for a given monetary account.
+
+ :type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :param payment: The payment details.
- :type payment: object_.SchedulePaymentEntry
- :param schedule: The schedule details when creating or updating a
- scheduled payment.
- :type schedule: Schedule
+ :type schedule_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseInt
+ :rtype: BunqResponseSchedule
"""
if custom_headers is None:
custom_headers = {}
- request_map = {
- cls.FIELD_PAYMENT: payment,
- cls.FIELD_SCHEDULE: schedule
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
-
api_client = ApiClient(cls._get_api_context())
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
- response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ schedule_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
+ return BunqResponseSchedule.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def delete(cls, schedule_payment_id, monetary_account_id=None, custom_headers=None):
+ def list(cls, monetary_account_id=None, params=None, custom_headers=None):
"""
+ Get a collection of scheduled definition for a given monetary account.
+ You can add the parameter type to filter the response. When
+ type={SCHEDULE_DEFINITION_PAYMENT,SCHEDULE_DEFINITION_PAYMENT_BATCH} is
+ provided only schedule definition object that relate to these
+ definitions are returned.
+
:type user_id: int
:type monetary_account_id: int
- :type schedule_payment_id: int
+ :type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNone
+ :rtype: BunqResponseScheduleList
"""
-
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_id)
- response_raw = api_client.delete(endpoint_url, custom_headers)
-
- return BunqResponseNone.cast_from_bunq_response(
- BunqResponse(None, response_raw.headers)
- )
-
- @classmethod
- def get(cls, schedule_payment_id, monetary_account_id=None, custom_headers=None):
- """
- :type api_context: ApiContext
- :type user_id: int
- :type monetary_account_id: int
- :type schedule_payment_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseSchedulePayment
- """
-
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
-
- return BunqResponseSchedulePayment.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
- )
-
- @classmethod
- def list(cls, monetary_account_id=None, params=None, custom_headers=None):
- """
- :type user_id: int
- :type monetary_account_id: int
- :type params: dict[str, str]|None
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseSchedulePaymentList
- """
-
- if params is None:
- params = {}
+
+ if params is None:
+ params = {}
if custom_headers is None:
custom_headers = {}
@@ -11359,63 +11134,41 @@ def list(cls, monetary_account_id=None, params=None, custom_headers=None):
cls._determine_monetary_account_id(monetary_account_id))
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseSchedulePaymentList.cast_from_bunq_response(
+ return BunqResponseScheduleList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
- @classmethod
- def update(cls, schedule_payment_id, monetary_account_id=None, payment=None, schedule=None, custom_headers=None):
+ @property
+ def time_start(self):
"""
- :type user_id: int
- :type monetary_account_id: int
- :type schedule_payment_id: int
- :param payment: The payment details.
- :type payment: object_.SchedulePaymentEntry
- :param schedule: The schedule details when creating or updating a
- scheduled payment.
- :type schedule: Schedule
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseSchedulePayment
+ :rtype: str
"""
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
-
- request_map = {
- cls.FIELD_PAYMENT: payment,
- cls.FIELD_SCHEDULE: schedule
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
+ return self._time_start
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_id)
- response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+ @property
+ def time_end(self):
+ """
+ :rtype: str
+ """
- return BunqResponseSchedulePayment.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_PUT)
- )
+ return self._time_end
@property
- def payment(self):
+ def recurrence_unit(self):
"""
- :rtype: object_.SchedulePaymentEntry
+ :rtype: str
"""
- return self._payment
+ return self._recurrence_unit
@property
- def schedule(self):
+ def recurrence_size(self):
"""
- :rtype: Schedule
+ :rtype: int
"""
- return self._schedule
+ return self._recurrence_size
@property
def status(self):
@@ -11425,20 +11178,37 @@ def status(self):
return self._status
+ @property
+ def object_(self):
+ """
+ :rtype: object_.ScheduleAnchorObject
+ """
+
+ return self._object_
+
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._payment is not None:
+ if self._time_start is not None:
return False
- if self._schedule is not None:
+ if self._time_end is not None:
+ return False
+
+ if self._recurrence_unit is not None:
+ return False
+
+ if self._recurrence_size is not None:
return False
if self._status is not None:
return False
+ if self._object_ is not None:
+ return False
+
return True
@staticmethod
@@ -11446,170 +11216,55 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: SchedulePayment
+ :rtype: Schedule
"""
- return converter.json_to_class(SchedulePayment, json_str)
+ return converter.json_to_class(Schedule, json_str)
-class SchedulePaymentBatch(BunqModel):
+class DraftShareInviteBankQrCodeContent(BunqModel):
"""
- Endpoint for schedule payment batches.
-
- :param _payments: The payment details.
- :type _payments: list[object_.SchedulePaymentEntry]
- :param _schedule: The schedule details.
- :type _schedule: Schedule
+ This call returns the raw content of the QR code that links to this draft
+ share invite. When a bunq user scans this QR code with the bunq app the
+ draft share invite will be shown on his/her device.
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/schedule-payment-batch"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/schedule-payment-batch/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/schedule-payment-batch/{}"
-
- # Field constants.
- FIELD_PAYMENTS = "payments"
- FIELD_SCHEDULE = "schedule"
-
- _payments = None
- _schedule = None
- _payments_field_for_request = None
- _schedule_field_for_request = None
-
- def __init__(self, payments=None, schedule=None):
- """
- :param payments: The payment details.
- :type payments: list[object_.SchedulePaymentEntry]
- :param schedule: The schedule details when creating a scheduled payment.
- :type schedule: Schedule
- """
-
- self._payments_field_for_request = payments
- self._schedule_field_for_request = schedule
-
- @classmethod
- def create(cls, payments, schedule, monetary_account_id=None, custom_headers=None):
- """
- :type user_id: int
- :type monetary_account_id: int
- :param payments: The payment details.
- :type payments: list[object_.SchedulePaymentEntry]
- :param schedule: The schedule details when creating a scheduled payment.
- :type schedule: Schedule
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseInt
- """
-
- if custom_headers is None:
- custom_headers = {}
-
- request_map = {
- cls.FIELD_PAYMENTS: payments,
- cls.FIELD_SCHEDULE: schedule
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
-
- api_client = ApiClient(cls._get_api_context())
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
- response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+ _ENDPOINT_URL_LISTING = "user/{}/draft-share-invite-bank/{}/qr-code-content"
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
- )
+ # Object type.
+ _OBJECT_TYPE_GET = "DraftShareInviteBankQrCodeContent"
@classmethod
- def update(cls, schedule_payment_batch_id, monetary_account_id=None, payments=None, schedule=None,
- custom_headers=None):
+ def list(cls, draft_share_invite_bank_id, custom_headers=None):
"""
- :type user_id: int
- :type monetary_account_id: int
- :type schedule_payment_batch_id: int
- :param payments: The payment details.
- :type payments: list[object_.SchedulePaymentEntry]
- :param schedule: The schedule details when creating a scheduled payment.
- :type schedule: Schedule
- :type custom_headers: dict[str, str]|None
+ Returns the raw content of the QR code that links to this draft share
+ invite. The raw content is the binary representation of a file, without
+ any JSON wrapping.
- :rtype: BunqResponseInt
- """
-
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
-
- request_map = {
- cls.FIELD_PAYMENTS: payments,
- cls.FIELD_SCHEDULE: schedule
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
-
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_batch_id)
- response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
-
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
- )
-
- @classmethod
- def delete(cls, schedule_payment_batch_id, monetary_account_id=None, custom_headers=None):
- """
:type user_id: int
- :type monetary_account_id: int
- :type schedule_payment_batch_id: int
+ :type draft_share_invite_bank_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNone
+ :rtype: BunqResponseBytes
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_batch_id)
- response_raw = api_client.delete(endpoint_url, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(), draft_share_invite_bank_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNone.cast_from_bunq_response(
- BunqResponse(None, response_raw.headers)
+ return BunqResponseBytes.cast_from_bunq_response(
+ BunqResponse(response_raw.body_bytes, response_raw.headers)
)
- @property
- def payments(self):
- """
- :rtype: list[object_.SchedulePaymentEntry]
- """
-
- return self._payments
-
- @property
- def schedule(self):
- """
- :rtype: Schedule
- """
-
- return self._schedule
-
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._payments is not None:
- return False
-
- if self._schedule is not None:
- return False
-
return True
@staticmethod
@@ -11617,102 +11272,154 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: SchedulePaymentBatch
+ :rtype: DraftShareInviteBankQrCodeContent
"""
- return converter.json_to_class(SchedulePaymentBatch, json_str)
+ return converter.json_to_class(DraftShareInviteBankQrCodeContent, json_str)
-class ScheduleInstance(BunqModel):
+class DraftShareInviteBank(BunqModel):
"""
- view for reading, updating and listing the scheduled instance.
+ Used to create a draft share invite for a monetary account with another bunq
+ user, as in the 'Connect' feature in the bunq app. The user that accepts the
+ invite can share one of their MonetaryAccounts with the user that created
+ the invite.
- :param _state: The state of the scheduleInstance. (FINISHED_SUCCESSFULLY,
- RETRY, FAILED_USER_ERROR)
- :type _state: str
- :param _time_start: The schedule start time (UTC).
- :type _time_start: str
- :param _time_end: The schedule end time (UTC).
- :type _time_end: str
- :param _error_message: The message when the scheduled instance has run and
- failed due to user error.
- :type _error_message: list[object_.Error]
- :param _scheduled_object: The scheduled object. (Payment, PaymentBatch)
- :type _scheduled_object: object_.ScheduleAnchorObject
- :param _result_object: The result object of this schedule instance.
- (Payment, PaymentBatch)
- :type _result_object: object_.ScheduleInstanceAnchorObject
- :param _request_reference_split_the_bill: The reference to the object used
- for split the bill. Can be RequestInquiry or RequestInquiryBatch
- :type _request_reference_split_the_bill:
- list[object_.RequestInquiryReference]
+ :param _status: The status of the draft share invite. Can be USED, CANCELLED
+ and PENDING.
+ :type _status: str
+ :param _expiration: The moment when this draft share invite expires.
+ :type _expiration: str
+ :param _draft_share_settings: The draft share invite details.
+ :type _draft_share_settings: object_.DraftShareInviteEntry
+ :param _user_alias_created: The user who created the draft share invite.
+ :type _user_alias_created: object_.LabelUser
+ :param _share_invite_bank_response_id: The id of the share invite bank
+ response this draft share belongs to.
+ :type _share_invite_bank_response_id: int
+ :param _draft_share_url: The URL redirecting user to the draft share invite
+ in the app. Only works on mobile devices.
+ :type _draft_share_url: str
+ :param _id_: The id of the newly created draft share invite.
+ :type _id_: int
"""
# Endpoint constants.
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/schedule/{}/schedule-instance"
+ _ENDPOINT_URL_CREATE = "user/{}/draft-share-invite-bank"
+ _ENDPOINT_URL_READ = "user/{}/draft-share-invite-bank/{}"
+ _ENDPOINT_URL_UPDATE = "user/{}/draft-share-invite-bank/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/draft-share-invite-bank"
# Field constants.
- FIELD_STATE = "state"
+ FIELD_STATUS = "status"
+ FIELD_EXPIRATION = "expiration"
+ FIELD_DRAFT_SHARE_SETTINGS = "draft_share_settings"
# Object type.
- _OBJECT_TYPE_GET = "ScheduledInstance"
+ _OBJECT_TYPE_GET = "DraftShareInviteBank"
- _state = None
- _time_start = None
- _time_end = None
- _error_message = None
- _scheduled_object = None
- _result_object = None
- _request_reference_split_the_bill = None
- _state_field_for_request = None
+ _user_alias_created = None
+ _status = None
+ _expiration = None
+ _share_invite_bank_response_id = None
+ _draft_share_url = None
+ _draft_share_settings = None
+ _id_ = None
+ _status_field_for_request = None
+ _expiration_field_for_request = None
+ _draft_share_settings_field_for_request = None
- def __init__(self, state=None):
+ def __init__(self, expiration=None, draft_share_settings=None, status=None):
"""
- :param state: Change the state of the scheduleInstance from
- FAILED_USER_ERROR to RETRY.
- :type state: str
+ :param expiration: The moment when this draft share invite expires.
+ :type expiration: str
+ :param draft_share_settings: The draft share invite details.
+ :type draft_share_settings: object_.DraftShareInviteEntry
+ :param status: The status of the draft share invite. Can be CANCELLED (the
+ user cancels the draft share before it's used).
+ :type status: str
"""
- self._state_field_for_request = state
+ self._expiration_field_for_request = expiration
+ self._draft_share_settings_field_for_request = draft_share_settings
+ self._status_field_for_request = status
@classmethod
- def get(cls, schedule_id, schedule_instance_id, monetary_account_id=None, custom_headers=None):
+ def create(cls, expiration, draft_share_settings, status=None, custom_headers=None):
+ """
+ :type user_id: int
+ :param expiration: The moment when this draft share invite expires.
+ :type expiration: str
+ :param draft_share_settings: The draft share invite details.
+ :type draft_share_settings: object_.DraftShareInviteEntry
+ :param status: The status of the draft share invite. Can be CANCELLED
+ (the user cancels the draft share before it's used).
+ :type status: str
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
"""
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ request_map = {
+ cls.FIELD_STATUS: status,
+ cls.FIELD_EXPIRATION: expiration,
+ cls.FIELD_DRAFT_SHARE_SETTINGS: draft_share_settings
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ api_client = ApiClient(cls._get_api_context())
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
+
+ @classmethod
+ def get(cls, draft_share_invite_bank_id, custom_headers=None):
+ """
+ Get the details of a specific draft of a share invite.
+
:type api_context: ApiContext
:type user_id: int
- :type monetary_account_id: int
- :type schedule_id: int
- :type schedule_instance_id: int
+ :type draft_share_invite_bank_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseScheduleInstance
+ :rtype: BunqResponseDraftShareInviteBank
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- schedule_id, schedule_instance_id)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), draft_share_invite_bank_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseScheduleInstance.cast_from_bunq_response(
+ return BunqResponseDraftShareInviteBank.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def update(cls, schedule_id, schedule_instance_id, monetary_account_id=None, state=None, custom_headers=None):
+ def update(cls, draft_share_invite_bank_id, status=None, expiration=None, draft_share_settings=None,
+ custom_headers=None):
"""
+ Update a draft share invite. When sending status CANCELLED it is
+ possible to cancel the draft share invite.
+
:type user_id: int
- :type monetary_account_id: int
- :type schedule_id: int
- :type schedule_instance_id: int
- :param state: Change the state of the scheduleInstance from
- FAILED_USER_ERROR to RETRY.
- :type state: str
+ :type draft_share_invite_bank_id: int
+ :param status: The status of the draft share invite. Can be CANCELLED
+ (the user cancels the draft share before it's used).
+ :type status: str
+ :param expiration: The moment when this draft share invite expires.
+ :type expiration: str
+ :param draft_share_settings: The draft share invite details.
+ :type draft_share_settings: object_.DraftShareInviteEntry
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -11724,15 +11431,15 @@ def update(cls, schedule_id, schedule_instance_id, monetary_account_id=None, sta
api_client = ApiClient(cls._get_api_context())
request_map = {
- cls.FIELD_STATE: state
+ cls.FIELD_STATUS: status,
+ cls.FIELD_EXPIRATION: expiration,
+ cls.FIELD_DRAFT_SHARE_SETTINGS: draft_share_settings
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- schedule_id, schedule_instance_id)
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(), draft_share_invite_bank_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -11740,15 +11447,13 @@ def update(cls, schedule_id, schedule_instance_id, monetary_account_id=None, sta
)
@classmethod
- def list(cls, schedule_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, params=None, custom_headers=None):
"""
:type user_id: int
- :type monetary_account_id: int
- :type schedule_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseScheduleInstanceList
+ :rtype: BunqResponseDraftShareInviteBankList
"""
if params is None:
@@ -11758,95 +11463,93 @@ def list(cls, schedule_id, monetary_account_id=None, params=None, custom_headers
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- schedule_id)
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseScheduleInstanceList.cast_from_bunq_response(
+ return BunqResponseDraftShareInviteBankList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@property
- def state(self):
+ def user_alias_created(self):
"""
- :rtype: str
+ :rtype: object_.LabelUser
"""
- return self._state
+ return self._user_alias_created
@property
- def time_start(self):
+ def status(self):
"""
:rtype: str
"""
- return self._time_start
+ return self._status
@property
- def time_end(self):
+ def expiration(self):
"""
:rtype: str
"""
- return self._time_end
+ return self._expiration
@property
- def error_message(self):
+ def share_invite_bank_response_id(self):
"""
- :rtype: list[object_.Error]
+ :rtype: int
"""
- return self._error_message
+ return self._share_invite_bank_response_id
@property
- def scheduled_object(self):
+ def draft_share_url(self):
"""
- :rtype: object_.ScheduleAnchorObject
+ :rtype: str
"""
- return self._scheduled_object
+ return self._draft_share_url
@property
- def result_object(self):
+ def draft_share_settings(self):
"""
- :rtype: object_.ScheduleInstanceAnchorObject
+ :rtype: object_.DraftShareInviteEntry
"""
- return self._result_object
+ return self._draft_share_settings
@property
- def request_reference_split_the_bill(self):
+ def id_(self):
"""
- :rtype: list[object_.RequestInquiryReference]
+ :rtype: int
"""
- return self._request_reference_split_the_bill
+ return self._id_
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._state is not None:
+ if self._user_alias_created is not None:
return False
- if self._time_start is not None:
+ if self._status is not None:
return False
- if self._time_end is not None:
+ if self._expiration is not None:
return False
- if self._error_message is not None:
+ if self._share_invite_bank_response_id is not None:
return False
- if self._scheduled_object is not None:
+ if self._draft_share_url is not None:
return False
- if self._result_object is not None:
+ if self._draft_share_settings is not None:
return False
- if self._request_reference_split_the_bill is not None:
+ if self._id_ is not None:
return False
return True
@@ -11856,183 +11559,102 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: ScheduleInstance
+ :rtype: DraftShareInviteBank
"""
- return converter.json_to_class(ScheduleInstance, json_str)
+ return converter.json_to_class(DraftShareInviteBank, json_str)
-class MasterCardAction(BunqModel):
+class Event(BunqModel):
"""
- MasterCard transaction view.
+ Used to view events. Events are automatically created and contain
+ information about everything that happens to your bunq account. In the bunq
+ app events are shown in your 'overview'. Examples of when events are created
+ or modified: payment sent, payment received, request for payment received or
+ connect invite received.
- :param _id_: The id of the MastercardAction.
+ :param _id_: The id of the event.
:type _id_: int
- :param _monetary_account_id: The id of the monetary account this action
- links to.
- :type _monetary_account_id: int
- :param _card_id: The id of the card this action links to.
- :type _card_id: int
- :param _amount_local: The amount of the transaction in local currency.
- :type _amount_local: object_.Amount
- :param _amount_converted: The amount of the transaction in local currency.
- :type _amount_converted: object_.Amount
- :param _amount_billing: The amount of the transaction in the monetary
- account's currency.
- :type _amount_billing: object_.Amount
- :param _amount_original_local: The original amount in local currency.
- :type _amount_original_local: object_.Amount
- :param _amount_original_billing: The original amount in the monetary
- account's currency.
- :type _amount_original_billing: object_.Amount
- :param _amount_fee: The fee amount as charged by the merchant, if
- applicable.
- :type _amount_fee: object_.Amount
- :param _card_authorisation_id_response: The response code by which
- authorised transaction can be identified as authorised by bunq.
- :type _card_authorisation_id_response: str
- :param _decision: Why the transaction was denied, if it was denied, or just
- ALLOWED.
- :type _decision: str
- :param _payment_status: The payment status of the transaction. For example
- PAYMENT_SUCCESSFUL, for a successful payment.
- :type _payment_status: str
- :param _decision_description: Empty if allowed, otherwise a textual
- explanation of why it was denied.
- :type _decision_description: str
- :param _decision_description_translated: Empty if allowed, otherwise a
- textual explanation of why it was denied in user's language.
- :type _decision_description_translated: str
- :param _description: The description for this transaction to display.
- :type _description: str
- :param _authorisation_status: The status in the authorisation process.
- :type _authorisation_status: str
- :param _authorisation_type: The type of transaction that was delivered using
- the card.
- :type _authorisation_type: str
- :param _pan_entry_mode_user: The type of entry mode the user used. Can be
- 'ATM', 'ICC', 'MAGNETIC_STRIPE' or 'E_COMMERCE'.
- :type _pan_entry_mode_user: str
- :param _settlement_status: The setlement status in the authorisation
- process.
- :type _settlement_status: str
- :param _clearing_status: The clearing status of the authorisation. Can be
- 'PENDING', 'FIRST_PRESENTMENT_COMPLETE' or 'REFUND_LENIENCY'.
- :type _clearing_status: str
- :param _maturity_date: The maturity date.
- :type _maturity_date: str
- :param _city: The city where the message originates from as announced by the
- terminal.
- :type _city: str
- :param _alias: The monetary account label of the account that this action is
- created for.
- :type _alias: object_.MonetaryAccountReference
- :param _counterparty_alias: The monetary account label of the counterparty.
- :type _counterparty_alias: object_.MonetaryAccountReference
- :param _label_card: The label of the card.
- :type _label_card: object_.LabelCard
- :param _token_status: If this is a tokenisation action, this shows the
- status of the token.
- :type _token_status: str
- :param _reservation_expiry_time: If this is a reservation, the moment the
- reservation will expire.
- :type _reservation_expiry_time: str
- :param _clearing_expiry_time: The time when the processing of the clearing
- is expired, refunding the authorisation.
- :type _clearing_expiry_time: str
- :param _applied_limit: The type of the limit applied to validate if this
- MasterCardAction was within the spending limits. The returned string matches
- the limit types as defined in the card endpoint.
- :type _applied_limit: str
- :param _allow_chat: Whether or not chat messages are allowed.
- :type _allow_chat: bool
- :param _secure_code_id: The secure code id for this mastercard action or
- null.
- :type _secure_code_id: int
- :param _wallet_provider_id: The ID of the wallet provider as defined by
- MasterCard. 420 = bunq Android app with Tap&Pay; 103 = Apple Pay.
- :type _wallet_provider_id: str
- :param _request_reference_split_the_bill: The reference to the object used
- for split the bill. Can be RequestInquiry or RequestInquiryBatch
- :type _request_reference_split_the_bill:
- list[object_.RequestInquiryReference]
+ :param _created: The timestamp of the event's creation.
+ :type _created: str
+ :param _updated: The timestamp of the event's last update.
+ :type _updated: str
+ :param _action: The performed action. Can be: CREATE or UPDATE.
+ :type _action: str
+ :param _user_id: The id of the user the event applied to (if it was a user
+ event).
+ :type _user_id: str
+ :param _monetary_account_id: The id of the monetary account the event
+ applied to (if it was a monetary account event).
+ :type _monetary_account_id: str
+ :param _object_: The details of the external object the event was created
+ for.
+ :type _object_: object_.EventObject
+ :param _status: The event status. Can be: FINALIZED or AWAITING_REPLY. An
+ example of FINALIZED event is a payment received event, while an
+ AWAITING_REPLY event is a request received event.
+ :type _status: str
"""
# Endpoint constants.
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/mastercard-action/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/mastercard-action"
+ _ENDPOINT_URL_READ = "user/{}/event/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/event"
# Object type.
- _OBJECT_TYPE_GET = "MasterCardAction"
+ _OBJECT_TYPE_GET = "Event"
_id_ = None
+ _created = None
+ _updated = None
+ _action = None
+ _user_id = None
_monetary_account_id = None
- _card_id = None
- _amount_local = None
- _amount_converted = None
- _amount_billing = None
- _amount_original_local = None
- _amount_original_billing = None
- _amount_fee = None
- _card_authorisation_id_response = None
- _decision = None
- _payment_status = None
- _decision_description = None
- _decision_description_translated = None
- _description = None
- _authorisation_status = None
- _authorisation_type = None
- _pan_entry_mode_user = None
- _settlement_status = None
- _clearing_status = None
- _maturity_date = None
- _city = None
- _alias = None
- _counterparty_alias = None
- _label_card = None
- _token_status = None
- _reservation_expiry_time = None
- _clearing_expiry_time = None
- _applied_limit = None
- _allow_chat = None
- _secure_code_id = None
- _wallet_provider_id = None
- _request_reference_split_the_bill = None
+ _object_ = None
+ _status = None
@classmethod
- def get(cls, master_card_action_id, monetary_account_id=None, custom_headers=None):
+ def get(cls, event_id, custom_headers=None):
"""
+ Get a specific event for a given user.
+
:type api_context: ApiContext
:type user_id: int
- :type monetary_account_id: int
- :type master_card_action_id: int
+ :type event_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseMasterCardAction
+ :rtype: BunqResponseEvent
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- master_card_action_id)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), event_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseMasterCardAction.cast_from_bunq_response(
+ return BunqResponseEvent.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def list(cls, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, params=None, custom_headers=None):
"""
+ Get a collection of events for a given user. You can add query the
+ parameters monetary_account_id, status and/or display_user_event to
+ filter the response. When monetary_account_id={id,id} is provided only
+ events that relate to these monetary account ids are returned. When
+ status={AWAITING_REPLY/FINALIZED} is provided the response only contains
+ events with the status AWAITING_REPLY or FINALIZED. When
+ display_user_event={true/false} is set to false user events are excluded
+ from the response, when not provided user events are displayed. User
+ events are events that are not related to a monetary account (for
+ example: connect invites).
+
:type user_id: int
- :type monetary_account_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseMasterCardActionList
+ :rtype: BunqResponseEventList
"""
if params is None:
@@ -12042,11 +11664,10 @@ def list(cls, monetary_account_id=None, params=None, custom_headers=None):
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseMasterCardActionList.cast_from_bunq_response(
+ return BunqResponseEventList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -12059,330 +11680,468 @@ def id_(self):
return self._id_
@property
- def monetary_account_id(self):
+ def created(self):
"""
- :rtype: int
+ :rtype: str
"""
- return self._monetary_account_id
+ return self._created
@property
- def card_id(self):
+ def updated(self):
"""
- :rtype: int
+ :rtype: str
"""
- return self._card_id
+ return self._updated
@property
- def amount_local(self):
+ def action(self):
"""
- :rtype: object_.Amount
+ :rtype: str
"""
- return self._amount_local
+ return self._action
@property
- def amount_converted(self):
+ def user_id(self):
"""
- :rtype: object_.Amount
+ :rtype: str
"""
- return self._amount_converted
+ return self._user_id
@property
- def amount_billing(self):
+ def monetary_account_id(self):
"""
- :rtype: object_.Amount
+ :rtype: str
"""
- return self._amount_billing
+ return self._monetary_account_id
@property
- def amount_original_local(self):
+ def object_(self):
"""
- :rtype: object_.Amount
+ :rtype: object_.EventObject
"""
- return self._amount_original_local
+ return self._object_
@property
- def amount_original_billing(self):
+ def status(self):
"""
- :rtype: object_.Amount
+ :rtype: str
"""
- return self._amount_original_billing
+ return self._status
- @property
- def amount_fee(self):
+ def is_all_field_none(self):
"""
- :rtype: object_.Amount
+ :rtype: bool
"""
- return self._amount_fee
+ if self._id_ is not None:
+ return False
- @property
- def card_authorisation_id_response(self):
- """
- :rtype: str
- """
+ if self._created is not None:
+ return False
- return self._card_authorisation_id_response
+ if self._updated is not None:
+ return False
- @property
- def decision(self):
- """
- :rtype: str
- """
+ if self._action is not None:
+ return False
- return self._decision
+ if self._user_id is not None:
+ return False
- @property
- def payment_status(self):
- """
- :rtype: str
- """
+ if self._monetary_account_id is not None:
+ return False
- return self._payment_status
+ if self._object_ is not None:
+ return False
- @property
- def decision_description(self):
- """
- :rtype: str
- """
+ if self._status is not None:
+ return False
- return self._decision_description
+ return True
- @property
- def decision_description_translated(self):
+ @staticmethod
+ def from_json(json_str):
"""
- :rtype: str
+ :type json_str: str
+
+ :rtype: Event
"""
- return self._decision_description_translated
-
- @property
- def description(self):
- """
- :rtype: str
- """
+ return converter.json_to_class(Event, json_str)
- return self._description
- @property
- def authorisation_status(self):
- """
- :rtype: str
- """
+class FeatureAnnouncement(BunqModel):
+ """
+ view for updating the feature display.
+
+ :param _avatar: The Avatar of the event overview.
+ :type _avatar: object_.Avatar
+ :param _title: The event overview title of the feature display
+ :type _title: str
+ :param _sub_title: The event overview subtitle of the feature display
+ :type _sub_title: str
+ """
- return self._authorisation_status
+ # Endpoint constants.
+ _ENDPOINT_URL_READ = "user/{}/feature-announcement/{}"
- @property
- def authorisation_type(self):
- """
- :rtype: str
- """
+ # Object type.
+ _OBJECT_TYPE_GET = "FeatureAnnouncement"
- return self._authorisation_type
+ _avatar = None
+ _title = None
+ _sub_title = None
- @property
- def pan_entry_mode_user(self):
+ @classmethod
+ def get(cls, feature_announcement_id, custom_headers=None):
"""
- :rtype: str
+ :type api_context: ApiContext
+ :type user_id: int
+ :type feature_announcement_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseFeatureAnnouncement
"""
- return self._pan_entry_mode_user
+ if custom_headers is None:
+ custom_headers = {}
- @property
- def settlement_status(self):
- """
- :rtype: str
- """
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), feature_announcement_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return self._settlement_status
+ return BunqResponseFeatureAnnouncement.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
@property
- def clearing_status(self):
+ def avatar(self):
"""
- :rtype: str
+ :rtype: object_.Avatar
"""
- return self._clearing_status
+ return self._avatar
@property
- def maturity_date(self):
+ def title(self):
"""
:rtype: str
"""
- return self._maturity_date
+ return self._title
@property
- def city(self):
+ def sub_title(self):
"""
:rtype: str
"""
- return self._city
+ return self._sub_title
- @property
- def alias(self):
+ def is_all_field_none(self):
"""
- :rtype: object_.MonetaryAccountReference
+ :rtype: bool
"""
- return self._alias
-
- @property
- def counterparty_alias(self):
- """
- :rtype: object_.MonetaryAccountReference
- """
+ if self._avatar is not None:
+ return False
- return self._counterparty_alias
+ if self._title is not None:
+ return False
- @property
- def label_card(self):
- """
- :rtype: object_.LabelCard
- """
+ if self._sub_title is not None:
+ return False
- return self._label_card
+ return True
- @property
- def token_status(self):
+ @staticmethod
+ def from_json(json_str):
"""
- :rtype: str
+ :type json_str: str
+
+ :rtype: FeatureAnnouncement
"""
- return self._token_status
+ return converter.json_to_class(FeatureAnnouncement, json_str)
- @property
- def reservation_expiry_time(self):
- """
- :rtype: str
- """
- return self._reservation_expiry_time
+class IdealMerchantTransaction(BunqModel):
+ """
+ View for requesting iDEAL transactions and polling their status.
+
+ :param _amount_requested: The requested amount of money to add.
+ :type _amount_requested: object_.Amount
+ :param _issuer: The BIC of the issuer.
+ :type _issuer: str
+ :param _monetary_account_id: The id of the monetary account this ideal
+ merchant transaction links to.
+ :type _monetary_account_id: int
+ :param _alias: The alias of the monetary account to add money to.
+ :type _alias: object_.MonetaryAccountReference
+ :param _counterparty_alias: The alias of the monetary account the money
+ comes from.
+ :type _counterparty_alias: object_.MonetaryAccountReference
+ :param _amount_guaranteed: In case of a successful transaction, the amount
+ of money that will be transferred.
+ :type _amount_guaranteed: object_.Amount
+ :param _expiration: When the transaction will expire.
+ :type _expiration: str
+ :param _issuer_name: The Name of the issuer.
+ :type _issuer_name: str
+ :param _issuer_authentication_url: The URL to visit to
+ :type _issuer_authentication_url: str
+ :param _purchase_identifier: The 'purchase ID' of the iDEAL transaction.
+ :type _purchase_identifier: str
+ :param _status: The status of the transaction.
+ :type _status: str
+ :param _status_timestamp: When the status was last updated.
+ :type _status_timestamp: str
+ :param _transaction_identifier: The 'transaction ID' of the iDEAL
+ transaction.
+ :type _transaction_identifier: str
+ """
- @property
- def clearing_expiry_time(self):
- """
- :rtype: str
- """
+ # Endpoint constants.
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/ideal-merchant-transaction"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/ideal-merchant-transaction"
- return self._clearing_expiry_time
+ # Field constants.
+ FIELD_AMOUNT_REQUESTED = "amount_requested"
+ FIELD_ISSUER = "issuer"
- @property
- def applied_limit(self):
- """
- :rtype: str
- """
+ # Object type.
+ _OBJECT_TYPE_GET = "IdealMerchantTransaction"
- return self._applied_limit
+ _monetary_account_id = None
+ _alias = None
+ _counterparty_alias = None
+ _amount_guaranteed = None
+ _amount_requested = None
+ _expiration = None
+ _issuer = None
+ _issuer_name = None
+ _issuer_authentication_url = None
+ _purchase_identifier = None
+ _status = None
+ _status_timestamp = None
+ _transaction_identifier = None
+ _amount_requested_field_for_request = None
+ _issuer_field_for_request = None
- @property
- def allow_chat(self):
+ def __init__(self, amount_requested, issuer):
"""
- :rtype: bool
+ :param amount_requested: The requested amount of money to add.
+ :type amount_requested: object_.Amount
+ :param issuer: The BIC of the issuing bank to ask for money.
+ :type issuer: str
"""
- return self._allow_chat
+ self._amount_requested_field_for_request = amount_requested
+ self._issuer_field_for_request = issuer
- @property
- def secure_code_id(self):
+ @classmethod
+ def create(cls, amount_requested, issuer, monetary_account_id=None, custom_headers=None):
"""
- :rtype: int
+ :type user_id: int
+ :type monetary_account_id: int
+ :param amount_requested: The requested amount of money to add.
+ :type amount_requested: object_.Amount
+ :param issuer: The BIC of the issuing bank to ask for money.
+ :type issuer: str
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
"""
- return self._secure_code_id
+ if custom_headers is None:
+ custom_headers = {}
+
+ request_map = {
+ cls.FIELD_AMOUNT_REQUESTED: amount_requested,
+ cls.FIELD_ISSUER: issuer
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ api_client = ApiClient(cls._get_api_context())
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id))
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
+
+ @classmethod
+ def get(cls, ideal_merchant_transaction_id, monetary_account_id=None, custom_headers=None):
+ """
+ :type api_context: ApiContext
+ :type user_id: int
+ :type monetary_account_id: int
+ :type ideal_merchant_transaction_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseIdealMerchantTransaction
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ ideal_merchant_transaction_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponseIdealMerchantTransaction.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @classmethod
+ def list(cls, monetary_account_id=None, params=None, custom_headers=None):
+ """
+ :type user_id: int
+ :type monetary_account_id: int
+ :type params: dict[str, str]|None
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseIdealMerchantTransactionList
+ """
+
+ if params is None:
+ params = {}
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id))
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
+
+ return BunqResponseIdealMerchantTransactionList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ )
@property
- def wallet_provider_id(self):
+ def monetary_account_id(self):
"""
- :rtype: str
+ :rtype: int
"""
- return self._wallet_provider_id
+ return self._monetary_account_id
@property
- def request_reference_split_the_bill(self):
+ def alias(self):
"""
- :rtype: list[object_.RequestInquiryReference]
+ :rtype: object_.MonetaryAccountReference
"""
- return self._request_reference_split_the_bill
+ return self._alias
- def is_all_field_none(self):
+ @property
+ def counterparty_alias(self):
"""
- :rtype: bool
+ :rtype: object_.MonetaryAccountReference
"""
- if self._id_ is not None:
- return False
+ return self._counterparty_alias
- if self._monetary_account_id is not None:
- return False
+ @property
+ def amount_guaranteed(self):
+ """
+ :rtype: object_.Amount
+ """
- if self._card_id is not None:
- return False
+ return self._amount_guaranteed
- if self._amount_local is not None:
- return False
+ @property
+ def amount_requested(self):
+ """
+ :rtype: object_.Amount
+ """
- if self._amount_converted is not None:
- return False
+ return self._amount_requested
- if self._amount_billing is not None:
- return False
+ @property
+ def expiration(self):
+ """
+ :rtype: str
+ """
- if self._amount_original_local is not None:
- return False
+ return self._expiration
- if self._amount_original_billing is not None:
- return False
+ @property
+ def issuer(self):
+ """
+ :rtype: str
+ """
- if self._amount_fee is not None:
- return False
+ return self._issuer
- if self._card_authorisation_id_response is not None:
- return False
+ @property
+ def issuer_name(self):
+ """
+ :rtype: str
+ """
- if self._decision is not None:
- return False
+ return self._issuer_name
- if self._payment_status is not None:
- return False
+ @property
+ def issuer_authentication_url(self):
+ """
+ :rtype: str
+ """
- if self._decision_description is not None:
- return False
+ return self._issuer_authentication_url
- if self._decision_description_translated is not None:
- return False
+ @property
+ def purchase_identifier(self):
+ """
+ :rtype: str
+ """
- if self._description is not None:
- return False
+ return self._purchase_identifier
- if self._authorisation_status is not None:
- return False
+ @property
+ def status(self):
+ """
+ :rtype: str
+ """
- if self._authorisation_type is not None:
- return False
+ return self._status
- if self._pan_entry_mode_user is not None:
- return False
+ @property
+ def status_timestamp(self):
+ """
+ :rtype: str
+ """
- if self._settlement_status is not None:
- return False
+ return self._status_timestamp
- if self._clearing_status is not None:
- return False
+ @property
+ def transaction_identifier(self):
+ """
+ :rtype: str
+ """
- if self._maturity_date is not None:
- return False
+ return self._transaction_identifier
- if self._city is not None:
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._monetary_account_id is not None:
return False
if self._alias is not None:
@@ -12391,31 +12150,34 @@ def is_all_field_none(self):
if self._counterparty_alias is not None:
return False
- if self._label_card is not None:
+ if self._amount_guaranteed is not None:
return False
- if self._token_status is not None:
+ if self._amount_requested is not None:
return False
- if self._reservation_expiry_time is not None:
+ if self._expiration is not None:
return False
- if self._clearing_expiry_time is not None:
+ if self._issuer is not None:
return False
- if self._applied_limit is not None:
+ if self._issuer_name is not None:
+ return False
+
+ if self._issuer_authentication_url is not None:
return False
- if self._allow_chat is not None:
+ if self._purchase_identifier is not None:
return False
- if self._secure_code_id is not None:
+ if self._status is not None:
return False
- if self._wallet_provider_id is not None:
+ if self._status_timestamp is not None:
return False
- if self._request_reference_split_the_bill is not None:
+ if self._transaction_identifier is not None:
return False
return True
@@ -12425,97 +12187,67 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: MasterCardAction
+ :rtype: IdealMerchantTransaction
"""
- return converter.json_to_class(MasterCardAction, json_str)
+ return converter.json_to_class(IdealMerchantTransaction, json_str)
-class RequestInquiryBatch(BunqModel):
+class SchedulePayment(BunqModel):
"""
- Create a batch of requests for payment, or show the request batches of a
- monetary account.
+ Endpoint for schedule payments.
- :param _request_inquiries: The list of requests that were made.
- :type _request_inquiries: list[RequestInquiry]
- :param _status: The status of the request.
+ :param _payment: The payment details.
+ :type _payment: object_.SchedulePaymentEntry
+ :param _schedule: The schedule details.
+ :type _schedule: Schedule
+ :param _status: The schedule status, options: ACTIVE, FINISHED, CANCELLED.
:type _status: str
- :param _total_amount_inquired: The total amount originally inquired for this
- batch.
- :type _total_amount_inquired: object_.Amount
- :param _event_id: The ID of the associated event if the request batch was
- made using 'split the bill'.
- :type _event_id: int
- :param _reference_split_the_bill: The reference to the object used for split
- the bill. Can be Payment, PaymentBatch, ScheduleInstance, RequestResponse
- and MasterCardAction
- :type _reference_split_the_bill:
- object_.RequestReferenceSplitTheBillAnchorObject
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/request-inquiry-batch"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/request-inquiry-batch/{}"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/request-inquiry-batch/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/request-inquiry-batch"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/schedule-payment"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/schedule-payment/{}"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/schedule-payment/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/schedule-payment"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/schedule-payment/{}"
# Field constants.
- FIELD_REQUEST_INQUIRIES = "request_inquiries"
- FIELD_STATUS = "status"
- FIELD_TOTAL_AMOUNT_INQUIRED = "total_amount_inquired"
- FIELD_EVENT_ID = "event_id"
+ FIELD_PAYMENT = "payment"
+ FIELD_SCHEDULE = "schedule"
# Object type.
- _OBJECT_TYPE_GET = "RequestInquiryBatch"
+ _OBJECT_TYPE_GET = "ScheduledPayment"
+ _OBJECT_TYPE_PUT = "ScheduledPayment"
- _request_inquiries = None
- _total_amount_inquired = None
- _reference_split_the_bill = None
- _request_inquiries_field_for_request = None
- _status_field_for_request = None
- _total_amount_inquired_field_for_request = None
- _event_id_field_for_request = None
+ _payment = None
+ _schedule = None
+ _status = None
+ _payment_field_for_request = None
+ _schedule_field_for_request = None
- def __init__(self, request_inquiries, total_amount_inquired, status=None, event_id=None):
+ def __init__(self, payment=None, schedule=None):
"""
- :param request_inquiries: The list of request inquiries we want to send in 1
- batch.
- :type request_inquiries: list[RequestInquiry]
- :param total_amount_inquired: The total amount originally inquired for this
- batch.
- :type total_amount_inquired: object_.Amount
- :param status: The status of the request.
- :type status: str
- :param event_id: The ID of the associated event if the request batch was
- made using 'split the bill'.
- :type event_id: int
+ :param payment: The payment details.
+ :type payment: object_.SchedulePaymentEntry
+ :param schedule: The schedule details when creating or updating a scheduled
+ payment.
+ :type schedule: Schedule
"""
- self._request_inquiries_field_for_request = request_inquiries
- self._total_amount_inquired_field_for_request = total_amount_inquired
- self._status_field_for_request = status
- self._event_id_field_for_request = event_id
+ self._payment_field_for_request = payment
+ self._schedule_field_for_request = schedule
@classmethod
- def create(cls, request_inquiries, total_amount_inquired, monetary_account_id=None, status=None, event_id=None,
- custom_headers=None):
+ def create(cls, payment, schedule, monetary_account_id=None, custom_headers=None):
"""
- Create a request batch by sending an array of single request objects,
- that will become part of the batch.
-
:type user_id: int
:type monetary_account_id: int
- :param request_inquiries: The list of request inquiries we want to send
- in 1 batch.
- :type request_inquiries: list[RequestInquiry]
- :param total_amount_inquired: The total amount originally inquired for
- this batch.
- :type total_amount_inquired: object_.Amount
- :param status: The status of the request.
- :type status: str
- :param event_id: The ID of the associated event if the request batch was
- made using 'split the bill'.
- :type event_id: int
+ :param payment: The payment details.
+ :type payment: object_.SchedulePaymentEntry
+ :param schedule: The schedule details when creating or updating a
+ scheduled payment.
+ :type schedule: Schedule
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -12525,10 +12257,8 @@ def create(cls, request_inquiries, total_amount_inquired, monetary_account_id=No
custom_headers = {}
request_map = {
- cls.FIELD_REQUEST_INQUIRIES: request_inquiries,
- cls.FIELD_STATUS: status,
- cls.FIELD_TOTAL_AMOUNT_INQUIRED: total_amount_inquired,
- cls.FIELD_EVENT_ID: event_id
+ cls.FIELD_PAYMENT: payment,
+ cls.FIELD_SCHEDULE: schedule
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
@@ -12544,54 +12274,39 @@ def create(cls, request_inquiries, total_amount_inquired, monetary_account_id=No
)
@classmethod
- def update(cls, request_inquiry_batch_id, monetary_account_id=None, status=None, custom_headers=None):
+ def delete(cls, schedule_payment_id, monetary_account_id=None, custom_headers=None):
"""
- Revoke a request batch. The status of all the requests will be set to
- REVOKED.
-
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_batch_id: int
- :param status: The status of the request.
- :type status: str
+ :type schedule_payment_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseInt
+ :rtype: BunqResponseNone
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
-
- request_map = {
- cls.FIELD_STATUS: status
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
-
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
+ endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_batch_id)
- response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+ schedule_payment_id)
+ response_raw = api_client.delete(endpoint_url, custom_headers)
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
+ return BunqResponseNone.cast_from_bunq_response(
+ BunqResponse(None, response_raw.headers)
)
@classmethod
- def get(cls, request_inquiry_batch_id, monetary_account_id=None, custom_headers=None):
+ def get(cls, schedule_payment_id, monetary_account_id=None, custom_headers=None):
"""
- Return the details of a specific request batch.
-
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_batch_id: int
+ :type schedule_payment_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseRequestInquiryBatch
+ :rtype: BunqResponseSchedulePayment
"""
if custom_headers is None:
@@ -12600,24 +12315,22 @@ def get(cls, request_inquiry_batch_id, monetary_account_id=None, custom_headers=
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_batch_id)
+ schedule_payment_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseRequestInquiryBatch.cast_from_bunq_response(
+ return BunqResponseSchedulePayment.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
def list(cls, monetary_account_id=None, params=None, custom_headers=None):
"""
- Return all the request batches for a monetary account.
-
:type user_id: int
:type monetary_account_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseRequestInquiryBatchList
+ :rtype: BunqResponseSchedulePaymentList
"""
if params is None:
@@ -12631,46 +12344,84 @@ def list(cls, monetary_account_id=None, params=None, custom_headers=None):
cls._determine_monetary_account_id(monetary_account_id))
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseRequestInquiryBatchList.cast_from_bunq_response(
+ return BunqResponseSchedulePaymentList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
+ @classmethod
+ def update(cls, schedule_payment_id, monetary_account_id=None, payment=None, schedule=None, custom_headers=None):
+ """
+ :type user_id: int
+ :type monetary_account_id: int
+ :type schedule_payment_id: int
+ :param payment: The payment details.
+ :type payment: object_.SchedulePaymentEntry
+ :param schedule: The schedule details when creating or updating a
+ scheduled payment.
+ :type schedule: Schedule
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseSchedulePayment
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+
+ request_map = {
+ cls.FIELD_PAYMENT: payment,
+ cls.FIELD_SCHEDULE: schedule
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ schedule_payment_id)
+ response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseSchedulePayment.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_PUT)
+ )
+
@property
- def request_inquiries(self):
+ def payment(self):
"""
- :rtype: list[RequestInquiry]
+ :rtype: object_.SchedulePaymentEntry
"""
- return self._request_inquiries
+ return self._payment
@property
- def total_amount_inquired(self):
+ def schedule(self):
"""
- :rtype: object_.Amount
+ :rtype: Schedule
"""
- return self._total_amount_inquired
+ return self._schedule
@property
- def reference_split_the_bill(self):
+ def status(self):
"""
- :rtype: object_.RequestReferenceSplitTheBillAnchorObject
+ :rtype: str
"""
- return self._reference_split_the_bill
+ return self._status
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._request_inquiries is not None:
+ if self._payment is not None:
return False
- if self._total_amount_inquired is not None:
+ if self._schedule is not None:
return False
- if self._reference_split_the_bill is not None:
+ if self._status is not None:
return False
return True
@@ -12680,300 +12431,56 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: RequestInquiryBatch
+ :rtype: SchedulePayment
"""
- return converter.json_to_class(RequestInquiryBatch, json_str)
+ return converter.json_to_class(SchedulePayment, json_str)
-class RequestInquiry(BunqModel):
+class SchedulePaymentBatch(BunqModel):
"""
- RequestInquiry, aka 'RFP' (Request for Payment), is one of the innovative
- features that bunq offers. To request payment from another bunq account a
- new Request Inquiry is created. As with payments you can add attachments to
- a RFP. Requests for Payment are the foundation for a number of consumer
- features like 'Split the bill' and 'Request forwarding'. We invite you to
- invent your own based on the bunq api!
+ Endpoint for schedule payment batches.
- :param _amount_inquired: The requested amount.
- :type _amount_inquired: object_.Amount
- :param _counterparty_alias: The LabelMonetaryAccount with the public
- information of the MonetaryAccount the money was requested from.
- :type _counterparty_alias: object_.MonetaryAccountReference
- :param _description: The description of the inquiry.
- :type _description: str
- :param _attachment: The attachments attached to the payment.
- :type _attachment: list[object_.BunqId]
- :param _merchant_reference: The client's custom reference that was attached
- to the request and the mutation.
- :type _merchant_reference: str
- :param _status: The status of the request.
- :type _status: str
- :param _minimum_age: The minimum age the user accepting the RequestInquiry
- must have.
- :type _minimum_age: int
- :param _require_address: Whether or not an address must be provided on
- accept.
- :type _require_address: str
- :param _want_tip: [DEPRECATED] Whether or not the accepting user can give an
- extra tip on top of the requested Amount. Defaults to false.
- :type _want_tip: bool
- :param _allow_amount_lower: [DEPRECATED] Whether or not the accepting user
- can choose to accept with a lower amount than requested. Defaults to false.
- :type _allow_amount_lower: bool
- :param _allow_amount_higher: [DEPRECATED] Whether or not the accepting user
- can choose to accept with a higher amount than requested. Defaults to false.
- :type _allow_amount_higher: bool
- :param _allow_bunqme: Whether or not sending a bunq.me request is allowed.
- :type _allow_bunqme: bool
- :param _redirect_url: The URL which the user is sent to after accepting or
- rejecting the Request.
- :type _redirect_url: str
- :param _event_id: The ID of the associated event if the request was made
- using 'split the bill'.
- :type _event_id: int
- :param _id_: The id of the created RequestInquiry.
- :type _id_: int
- :param _created: The timestamp of the payment request's creation.
- :type _created: str
- :param _updated: The timestamp of the payment request's last update.
- :type _updated: str
- :param _time_responded: The timestamp of when the payment request was
- responded to.
- :type _time_responded: str
- :param _time_expiry: The timestamp of when the payment request expired.
- :type _time_expiry: str
- :param _monetary_account_id: The id of the monetary account the request
- response applies to.
- :type _monetary_account_id: int
- :param _amount_responded: The responded amount.
- :type _amount_responded: object_.Amount
- :param _user_alias_created: The label that's displayed to the counterparty
- with the mutation. Includes user.
- :type _user_alias_created: object_.LabelUser
- :param _user_alias_revoked: The label that's displayed to the counterparty
- with the mutation. Includes user.
- :type _user_alias_revoked: object_.LabelUser
- :param _batch_id: The id of the batch if the request was part of a batch.
- :type _batch_id: int
- :param _scheduled_id: The id of the scheduled job if the request was
- scheduled.
- :type _scheduled_id: int
- :param _bunqme_share_url: The url that points to the bunq.me request.
- :type _bunqme_share_url: str
- :param _address_shipping: The shipping address provided by the accepting
- user if an address was requested.
- :type _address_shipping: object_.Address
- :param _address_billing: The billing address provided by the accepting user
- if an address was requested.
- :type _address_billing: object_.Address
- :param _geolocation: The geolocation where the payment was done.
- :type _geolocation: object_.Geolocation
- :param _allow_chat: Whether or not chat messages are allowed.
- :type _allow_chat: bool
- :param _reference_split_the_bill: The reference to the object used for split
- the bill. Can be Payment, PaymentBatch, ScheduleInstance, RequestResponse
- and MasterCardAction
- :type _reference_split_the_bill:
- object_.RequestReferenceSplitTheBillAnchorObject
+ :param _payments: The payment details.
+ :type _payments: list[object_.SchedulePaymentEntry]
+ :param _schedule: The schedule details.
+ :type _schedule: Schedule
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/request-inquiry"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/request-inquiry/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/request-inquiry"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/request-inquiry/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/schedule-payment-batch"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/schedule-payment-batch/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/schedule-payment-batch/{}"
# Field constants.
- FIELD_AMOUNT_INQUIRED = "amount_inquired"
- FIELD_COUNTERPARTY_ALIAS = "counterparty_alias"
- FIELD_DESCRIPTION = "description"
- FIELD_ATTACHMENT = "attachment"
- FIELD_MERCHANT_REFERENCE = "merchant_reference"
- FIELD_STATUS = "status"
- FIELD_MINIMUM_AGE = "minimum_age"
- FIELD_REQUIRE_ADDRESS = "require_address"
- FIELD_WANT_TIP = "want_tip"
- FIELD_ALLOW_AMOUNT_LOWER = "allow_amount_lower"
- FIELD_ALLOW_AMOUNT_HIGHER = "allow_amount_higher"
- FIELD_ALLOW_BUNQME = "allow_bunqme"
- FIELD_REDIRECT_URL = "redirect_url"
- FIELD_EVENT_ID = "event_id"
-
- # Object type.
- _OBJECT_TYPE_PUT = "RequestInquiry"
- _OBJECT_TYPE_GET = "RequestInquiry"
+ FIELD_PAYMENTS = "payments"
+ FIELD_SCHEDULE = "schedule"
- _id_ = None
- _created = None
- _updated = None
- _time_responded = None
- _time_expiry = None
- _monetary_account_id = None
- _amount_inquired = None
- _amount_responded = None
- _user_alias_created = None
- _user_alias_revoked = None
- _counterparty_alias = None
- _description = None
- _merchant_reference = None
- _attachment = None
- _status = None
- _batch_id = None
- _scheduled_id = None
- _minimum_age = None
- _require_address = None
- _bunqme_share_url = None
- _redirect_url = None
- _address_shipping = None
- _address_billing = None
- _geolocation = None
- _allow_chat = None
- _reference_split_the_bill = None
- _amount_inquired_field_for_request = None
- _counterparty_alias_field_for_request = None
- _description_field_for_request = None
- _attachment_field_for_request = None
- _merchant_reference_field_for_request = None
- _status_field_for_request = None
- _minimum_age_field_for_request = None
- _require_address_field_for_request = None
- _want_tip_field_for_request = None
- _allow_amount_lower_field_for_request = None
- _allow_amount_higher_field_for_request = None
- _allow_bunqme_field_for_request = None
- _redirect_url_field_for_request = None
- _event_id_field_for_request = None
+ _payments = None
+ _schedule = None
+ _payments_field_for_request = None
+ _schedule_field_for_request = None
- def __init__(self, amount_inquired, counterparty_alias, description, allow_bunqme, attachment=None,
- merchant_reference=None, status=None, minimum_age=None, require_address=None, want_tip=None,
- allow_amount_lower=None, allow_amount_higher=None, redirect_url=None, event_id=None):
+ def __init__(self, payments=None, schedule=None):
"""
- :param amount_inquired: The Amount requested to be paid by the person the
- RequestInquiry is sent to. Must be bigger than 0.
- :type amount_inquired: object_.Amount
- :param counterparty_alias: The Alias of the party we are requesting the
- money from. Can be an Alias of type EMAIL, PHONE_NUMBER or IBAN. In case the
- EMAIL or PHONE_NUMBER Alias does not refer to a bunq monetary account,
- 'allow_bunqme' needs to be 'true' in order to trigger the creation of a
- bunq.me request. Otherwise no request inquiry will be sent.
- :type counterparty_alias: object_.Pointer
- :param description: The description for the RequestInquiry. Maximum 9000
- characters. Field is required but can be an empty string.
- :type description: str
- :param allow_bunqme: Whether or not sending a bunq.me request is allowed.
- :type allow_bunqme: bool
- :param attachment: The Attachments to attach to the RequestInquiry.
- :type attachment: list[object_.BunqId]
- :param merchant_reference: Optional data to be included with the
- RequestInquiry specific to the merchant. Has to be unique for the same
- source MonetaryAccount.
- :type merchant_reference: str
- :param status: The status of the RequestInquiry. Ignored in POST requests
- but can be used for revoking (cancelling) the RequestInquiry by setting
- REVOKED with a PUT request.
- :type status: str
- :param minimum_age: The minimum age the user accepting the RequestInquiry
- must have. Defaults to not checking. If set, must be between 12 and 100
- inclusive.
- :type minimum_age: int
- :param require_address: Whether a billing and shipping address must be
- provided when paying the request. Possible values are: BILLING, SHIPPING,
- BILLING_SHIPPING, NONE, OPTIONAL. Default is NONE.
- :type require_address: str
- :param want_tip: [DEPRECATED] Whether or not the accepting user can give an
- extra tip on top of the requested Amount. Defaults to false.
- :type want_tip: bool
- :param allow_amount_lower: [DEPRECATED] Whether or not the accepting user
- can choose to accept with a lower amount than requested. Defaults to false.
- :type allow_amount_lower: bool
- :param allow_amount_higher: [DEPRECATED] Whether or not the accepting user
- can choose to accept with a higher amount than requested. Defaults to false.
- :type allow_amount_higher: bool
- :param redirect_url: The URL which the user is sent to after accepting or
- rejecting the Request.
- :type redirect_url: str
- :param event_id: The ID of the associated event if the request was made
- using 'split the bill'.
- :type event_id: int
+ :param payments: The payment details.
+ :type payments: list[object_.SchedulePaymentEntry]
+ :param schedule: The schedule details when creating a scheduled payment.
+ :type schedule: Schedule
"""
- self._amount_inquired_field_for_request = amount_inquired
- self._counterparty_alias_field_for_request = counterparty_alias
- self._description_field_for_request = description
- self._allow_bunqme_field_for_request = allow_bunqme
- self._attachment_field_for_request = attachment
- self._merchant_reference_field_for_request = merchant_reference
- self._status_field_for_request = status
- self._minimum_age_field_for_request = minimum_age
- self._require_address_field_for_request = require_address
- self._want_tip_field_for_request = want_tip
- self._allow_amount_lower_field_for_request = allow_amount_lower
- self._allow_amount_higher_field_for_request = allow_amount_higher
- self._redirect_url_field_for_request = redirect_url
- self._event_id_field_for_request = event_id
+ self._payments_field_for_request = payments
+ self._schedule_field_for_request = schedule
@classmethod
- def create(cls, amount_inquired, counterparty_alias, description, allow_bunqme, monetary_account_id=None,
- attachment=None, merchant_reference=None, status=None, minimum_age=None, require_address=None,
- want_tip=None, allow_amount_lower=None, allow_amount_higher=None, redirect_url=None, event_id=None,
- custom_headers=None):
+ def create(cls, payments, schedule, monetary_account_id=None, custom_headers=None):
"""
- Create a new payment request.
-
:type user_id: int
:type monetary_account_id: int
- :param amount_inquired: The Amount requested to be paid by the person
- the RequestInquiry is sent to. Must be bigger than 0.
- :type amount_inquired: object_.Amount
- :param counterparty_alias: The Alias of the party we are requesting the
- money from. Can be an Alias of type EMAIL, PHONE_NUMBER or IBAN. In case
- the EMAIL or PHONE_NUMBER Alias does not refer to a bunq monetary
- account, 'allow_bunqme' needs to be 'true' in order to trigger the
- creation of a bunq.me request. Otherwise no request inquiry will be
- sent.
- :type counterparty_alias: object_.Pointer
- :param description: The description for the RequestInquiry. Maximum 9000
- characters. Field is required but can be an empty string.
- :type description: str
- :param allow_bunqme: Whether or not sending a bunq.me request is
- allowed.
- :type allow_bunqme: bool
- :param attachment: The Attachments to attach to the RequestInquiry.
- :type attachment: list[object_.BunqId]
- :param merchant_reference: Optional data to be included with the
- RequestInquiry specific to the merchant. Has to be unique for the same
- source MonetaryAccount.
- :type merchant_reference: str
- :param status: The status of the RequestInquiry. Ignored in POST
- requests but can be used for revoking (cancelling) the RequestInquiry by
- setting REVOKED with a PUT request.
- :type status: str
- :param minimum_age: The minimum age the user accepting the
- RequestInquiry must have. Defaults to not checking. If set, must be
- between 12 and 100 inclusive.
- :type minimum_age: int
- :param require_address: Whether a billing and shipping address must be
- provided when paying the request. Possible values are: BILLING,
- SHIPPING, BILLING_SHIPPING, NONE, OPTIONAL. Default is NONE.
- :type require_address: str
- :param want_tip: [DEPRECATED] Whether or not the accepting user can give
- an extra tip on top of the requested Amount. Defaults to false.
- :type want_tip: bool
- :param allow_amount_lower: [DEPRECATED] Whether or not the accepting
- user can choose to accept with a lower amount than requested. Defaults
- to false.
- :type allow_amount_lower: bool
- :param allow_amount_higher: [DEPRECATED] Whether or not the accepting
- user can choose to accept with a higher amount than requested. Defaults
- to false.
- :type allow_amount_higher: bool
- :param redirect_url: The URL which the user is sent to after accepting
- or rejecting the Request.
- :type redirect_url: str
- :param event_id: The ID of the associated event if the request was made
- using 'split the bill'.
- :type event_id: int
+ :param payments: The payment details.
+ :type payments: list[object_.SchedulePaymentEntry]
+ :param schedule: The schedule details when creating a scheduled payment.
+ :type schedule: Schedule
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -12983,20 +12490,8 @@ def create(cls, amount_inquired, counterparty_alias, description, allow_bunqme,
custom_headers = {}
request_map = {
- cls.FIELD_AMOUNT_INQUIRED: amount_inquired,
- cls.FIELD_COUNTERPARTY_ALIAS: counterparty_alias,
- cls.FIELD_DESCRIPTION: description,
- cls.FIELD_ATTACHMENT: attachment,
- cls.FIELD_MERCHANT_REFERENCE: merchant_reference,
- cls.FIELD_STATUS: status,
- cls.FIELD_MINIMUM_AGE: minimum_age,
- cls.FIELD_REQUIRE_ADDRESS: require_address,
- cls.FIELD_WANT_TIP: want_tip,
- cls.FIELD_ALLOW_AMOUNT_LOWER: allow_amount_lower,
- cls.FIELD_ALLOW_AMOUNT_HIGHER: allow_amount_higher,
- cls.FIELD_ALLOW_BUNQME: allow_bunqme,
- cls.FIELD_REDIRECT_URL: redirect_url,
- cls.FIELD_EVENT_ID: event_id
+ cls.FIELD_PAYMENTS: payments,
+ cls.FIELD_SCHEDULE: schedule
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
@@ -13012,20 +12507,19 @@ def create(cls, amount_inquired, counterparty_alias, description, allow_bunqme,
)
@classmethod
- def update(cls, request_inquiry_id, monetary_account_id=None, status=None, custom_headers=None):
+ def update(cls, schedule_payment_batch_id, monetary_account_id=None, payments=None, schedule=None,
+ custom_headers=None):
"""
- Revoke a request for payment, by updating the status to REVOKED.
-
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_id: int
- :param status: The status of the RequestInquiry. Ignored in POST
- requests but can be used for revoking (cancelling) the RequestInquiry by
- setting REVOKED with a PUT request.
- :type status: str
+ :type schedule_payment_batch_id: int
+ :param payments: The payment details.
+ :type payments: list[object_.SchedulePaymentEntry]
+ :param schedule: The schedule details when creating a scheduled payment.
+ :type schedule: Schedule
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseRequestInquiry
+ :rtype: BunqResponseInt
"""
if custom_headers is None:
@@ -13034,7 +12528,8 @@ def update(cls, request_inquiry_id, monetary_account_id=None, status=None, custo
api_client = ApiClient(cls._get_api_context())
request_map = {
- cls.FIELD_STATUS: status
+ cls.FIELD_PAYMENTS: payments,
+ cls.FIELD_SCHEDULE: schedule
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
@@ -13042,53 +12537,142 @@ def update(cls, request_inquiry_id, monetary_account_id=None, status=None, custo
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_id)
+ schedule_payment_batch_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
- return BunqResponseRequestInquiry.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_PUT)
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
)
@classmethod
- def list(cls, monetary_account_id=None, params=None, custom_headers=None):
+ def delete(cls, schedule_payment_batch_id, monetary_account_id=None, custom_headers=None):
"""
- Get all payment requests for a user's monetary account.
-
:type user_id: int
:type monetary_account_id: int
- :type params: dict[str, str]|None
+ :type schedule_payment_batch_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseRequestInquiryList
+ :rtype: BunqResponseNone
"""
- if params is None:
- params = {}
-
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
- response_raw = api_client.get(endpoint_url, params, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ schedule_payment_batch_id)
+ response_raw = api_client.delete(endpoint_url, custom_headers)
- return BunqResponseRequestInquiryList.cast_from_bunq_response(
- cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ return BunqResponseNone.cast_from_bunq_response(
+ BunqResponse(None, response_raw.headers)
)
- @classmethod
- def get(cls, request_inquiry_id, monetary_account_id=None, custom_headers=None):
+ @property
+ def payments(self):
"""
- Get the details of a specific payment request, including its status.
+ :rtype: list[object_.SchedulePaymentEntry]
+ """
+
+ return self._payments
+
+ @property
+ def schedule(self):
+ """
+ :rtype: Schedule
+ """
+
+ return self._schedule
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._payments is not None:
+ return False
+
+ if self._schedule is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+ :rtype: SchedulePaymentBatch
+ """
+
+ return converter.json_to_class(SchedulePaymentBatch, json_str)
+
+
+class ScheduleInstance(BunqModel):
+ """
+ view for reading, updating and listing the scheduled instance.
+
+ :param _state: The state of the scheduleInstance. (FINISHED_SUCCESSFULLY,
+ RETRY, FAILED_USER_ERROR)
+ :type _state: str
+ :param _time_start: The schedule start time (UTC).
+ :type _time_start: str
+ :param _time_end: The schedule end time (UTC).
+ :type _time_end: str
+ :param _error_message: The message when the scheduled instance has run and
+ failed due to user error.
+ :type _error_message: list[object_.Error]
+ :param _scheduled_object: The scheduled object. (Payment, PaymentBatch)
+ :type _scheduled_object: object_.ScheduleAnchorObject
+ :param _result_object: The result object of this schedule instance.
+ (Payment, PaymentBatch)
+ :type _result_object: object_.ScheduleInstanceAnchorObject
+ :param _request_reference_split_the_bill: The reference to the object used
+ for split the bill. Can be RequestInquiry or RequestInquiryBatch
+ :type _request_reference_split_the_bill:
+ list[object_.RequestInquiryReference]
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/schedule/{}/schedule-instance"
+
+ # Field constants.
+ FIELD_STATE = "state"
+
+ # Object type.
+ _OBJECT_TYPE_GET = "ScheduledInstance"
+
+ _state = None
+ _time_start = None
+ _time_end = None
+ _error_message = None
+ _scheduled_object = None
+ _result_object = None
+ _request_reference_split_the_bill = None
+ _state_field_for_request = None
+
+ def __init__(self, state=None):
+ """
+ :param state: Change the state of the scheduleInstance from
+ FAILED_USER_ERROR to RETRY.
+ :type state: str
+ """
+
+ self._state_field_for_request = state
+
+ @classmethod
+ def get(cls, schedule_id, schedule_instance_id, monetary_account_id=None, custom_headers=None):
+ """
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_id: int
+ :type schedule_id: int
+ :type schedule_instance_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseRequestInquiry
+ :rtype: BunqResponseScheduleInstance
"""
if custom_headers is None:
@@ -13097,102 +12681,470 @@ def get(cls, request_inquiry_id, monetary_account_id=None, custom_headers=None):
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_id)
+ schedule_id, schedule_instance_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseRequestInquiry.cast_from_bunq_response(
+ return BunqResponseScheduleInstance.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
- @property
- def id_(self):
+ @classmethod
+ def update(cls, schedule_id, schedule_instance_id, monetary_account_id=None, state=None, custom_headers=None):
"""
- :rtype: int
+ :type user_id: int
+ :type monetary_account_id: int
+ :type schedule_id: int
+ :type schedule_instance_id: int
+ :param state: Change the state of the scheduleInstance from
+ FAILED_USER_ERROR to RETRY.
+ :type state: str
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
"""
- return self._id_
+ if custom_headers is None:
+ custom_headers = {}
- @property
- def created(self):
+ api_client = ApiClient(cls._get_api_context())
+
+ request_map = {
+ cls.FIELD_STATE: state
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ schedule_id, schedule_instance_id)
+ response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
+
+ @classmethod
+ def list(cls, schedule_id, monetary_account_id=None, params=None, custom_headers=None):
"""
- :rtype: str
+ :type user_id: int
+ :type monetary_account_id: int
+ :type schedule_id: int
+ :type params: dict[str, str]|None
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseScheduleInstanceList
"""
- return self._created
+ if params is None:
+ params = {}
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ schedule_id)
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
+
+ return BunqResponseScheduleInstanceList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ )
@property
- def updated(self):
+ def state(self):
"""
:rtype: str
"""
- return self._updated
+ return self._state
@property
- def time_responded(self):
+ def time_start(self):
"""
:rtype: str
"""
- return self._time_responded
+ return self._time_start
@property
- def time_expiry(self):
+ def time_end(self):
"""
:rtype: str
"""
- return self._time_expiry
+ return self._time_end
@property
- def monetary_account_id(self):
+ def error_message(self):
"""
- :rtype: int
+ :rtype: list[object_.Error]
"""
- return self._monetary_account_id
+ return self._error_message
@property
- def amount_inquired(self):
+ def scheduled_object(self):
"""
- :rtype: object_.Amount
+ :rtype: object_.ScheduleAnchorObject
"""
- return self._amount_inquired
+ return self._scheduled_object
@property
- def amount_responded(self):
+ def result_object(self):
"""
- :rtype: object_.Amount
+ :rtype: object_.ScheduleInstanceAnchorObject
"""
- return self._amount_responded
+ return self._result_object
@property
- def user_alias_created(self):
+ def request_reference_split_the_bill(self):
"""
- :rtype: object_.LabelUser
+ :rtype: list[object_.RequestInquiryReference]
"""
- return self._user_alias_created
+ return self._request_reference_split_the_bill
- @property
- def user_alias_revoked(self):
+ def is_all_field_none(self):
"""
- :rtype: object_.LabelUser
+ :rtype: bool
"""
- return self._user_alias_revoked
+ if self._state is not None:
+ return False
- @property
- def counterparty_alias(self):
- """
- :rtype: object_.MonetaryAccountReference
- """
+ if self._time_start is not None:
+ return False
- return self._counterparty_alias
+ if self._time_end is not None:
+ return False
- @property
+ if self._error_message is not None:
+ return False
+
+ if self._scheduled_object is not None:
+ return False
+
+ if self._result_object is not None:
+ return False
+
+ if self._request_reference_split_the_bill is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: ScheduleInstance
+ """
+
+ return converter.json_to_class(ScheduleInstance, json_str)
+
+
+class MasterCardAction(BunqModel):
+ """
+ MasterCard transaction view.
+
+ :param _id_: The id of the MastercardAction.
+ :type _id_: int
+ :param _monetary_account_id: The id of the monetary account this action
+ links to.
+ :type _monetary_account_id: int
+ :param _card_id: The id of the card this action links to.
+ :type _card_id: int
+ :param _amount_local: The amount of the transaction in local currency.
+ :type _amount_local: object_.Amount
+ :param _amount_converted: The amount of the transaction in local currency.
+ :type _amount_converted: object_.Amount
+ :param _amount_billing: The amount of the transaction in the monetary
+ account's currency.
+ :type _amount_billing: object_.Amount
+ :param _amount_original_local: The original amount in local currency.
+ :type _amount_original_local: object_.Amount
+ :param _amount_original_billing: The original amount in the monetary
+ account's currency.
+ :type _amount_original_billing: object_.Amount
+ :param _amount_fee: The fee amount as charged by the merchant, if
+ applicable.
+ :type _amount_fee: object_.Amount
+ :param _card_authorisation_id_response: The response code by which
+ authorised transaction can be identified as authorised by bunq.
+ :type _card_authorisation_id_response: str
+ :param _decision: Why the transaction was denied, if it was denied, or just
+ ALLOWED.
+ :type _decision: str
+ :param _payment_status: The payment status of the transaction. For example
+ PAYMENT_SUCCESSFUL, for a successful payment.
+ :type _payment_status: str
+ :param _decision_description: Empty if allowed, otherwise a textual
+ explanation of why it was denied.
+ :type _decision_description: str
+ :param _decision_description_translated: Empty if allowed, otherwise a
+ textual explanation of why it was denied in user's language.
+ :type _decision_description_translated: str
+ :param _description: The description for this transaction to display.
+ :type _description: str
+ :param _authorisation_status: The status in the authorisation process.
+ :type _authorisation_status: str
+ :param _authorisation_type: The type of transaction that was delivered using
+ the card.
+ :type _authorisation_type: str
+ :param _pan_entry_mode_user: The type of entry mode the user used. Can be
+ 'ATM', 'ICC', 'MAGNETIC_STRIPE' or 'E_COMMERCE'.
+ :type _pan_entry_mode_user: str
+ :param _settlement_status: The setlement status in the authorisation
+ process.
+ :type _settlement_status: str
+ :param _clearing_status: The clearing status of the authorisation. Can be
+ 'PENDING', 'FIRST_PRESENTMENT_COMPLETE' or 'REFUND_LENIENCY'.
+ :type _clearing_status: str
+ :param _maturity_date: The maturity date.
+ :type _maturity_date: str
+ :param _city: The city where the message originates from as announced by the
+ terminal.
+ :type _city: str
+ :param _alias: The monetary account label of the account that this action is
+ created for.
+ :type _alias: object_.MonetaryAccountReference
+ :param _counterparty_alias: The monetary account label of the counterparty.
+ :type _counterparty_alias: object_.MonetaryAccountReference
+ :param _label_card: The label of the card.
+ :type _label_card: object_.LabelCard
+ :param _token_status: If this is a tokenisation action, this shows the
+ status of the token.
+ :type _token_status: str
+ :param _reservation_expiry_time: If this is a reservation, the moment the
+ reservation will expire.
+ :type _reservation_expiry_time: str
+ :param _clearing_expiry_time: The time when the processing of the clearing
+ is expired, refunding the authorisation.
+ :type _clearing_expiry_time: str
+ :param _applied_limit: The type of the limit applied to validate if this
+ MasterCardAction was within the spending limits. The returned string matches
+ the limit types as defined in the card endpoint.
+ :type _applied_limit: str
+ :param _secure_code_id: The secure code id for this mastercard action or
+ null.
+ :type _secure_code_id: int
+ :param _wallet_provider_id: The ID of the wallet provider as defined by
+ MasterCard. 420 = bunq Android app with Tap&Pay; 103 = Apple Pay.
+ :type _wallet_provider_id: str
+ :param _request_reference_split_the_bill: The reference to the object used
+ for split the bill. Can be RequestInquiry or RequestInquiryBatch
+ :type _request_reference_split_the_bill:
+ list[object_.RequestInquiryReference]
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/mastercard-action/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/mastercard-action"
+
+ # Object type.
+ _OBJECT_TYPE_GET = "MasterCardAction"
+
+ _id_ = None
+ _monetary_account_id = None
+ _card_id = None
+ _amount_local = None
+ _amount_converted = None
+ _amount_billing = None
+ _amount_original_local = None
+ _amount_original_billing = None
+ _amount_fee = None
+ _card_authorisation_id_response = None
+ _decision = None
+ _payment_status = None
+ _decision_description = None
+ _decision_description_translated = None
+ _description = None
+ _authorisation_status = None
+ _authorisation_type = None
+ _pan_entry_mode_user = None
+ _settlement_status = None
+ _clearing_status = None
+ _maturity_date = None
+ _city = None
+ _alias = None
+ _counterparty_alias = None
+ _label_card = None
+ _token_status = None
+ _reservation_expiry_time = None
+ _clearing_expiry_time = None
+ _applied_limit = None
+ _secure_code_id = None
+ _wallet_provider_id = None
+ _request_reference_split_the_bill = None
+
+ @classmethod
+ def get(cls, master_card_action_id, monetary_account_id=None, custom_headers=None):
+ """
+ :type api_context: ApiContext
+ :type user_id: int
+ :type monetary_account_id: int
+ :type master_card_action_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseMasterCardAction
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ master_card_action_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponseMasterCardAction.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @classmethod
+ def list(cls, monetary_account_id=None, params=None, custom_headers=None):
+ """
+ :type user_id: int
+ :type monetary_account_id: int
+ :type params: dict[str, str]|None
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseMasterCardActionList
+ """
+
+ if params is None:
+ params = {}
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id))
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
+
+ return BunqResponseMasterCardActionList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @property
+ def id_(self):
+ """
+ :rtype: int
+ """
+
+ return self._id_
+
+ @property
+ def monetary_account_id(self):
+ """
+ :rtype: int
+ """
+
+ return self._monetary_account_id
+
+ @property
+ def card_id(self):
+ """
+ :rtype: int
+ """
+
+ return self._card_id
+
+ @property
+ def amount_local(self):
+ """
+ :rtype: object_.Amount
+ """
+
+ return self._amount_local
+
+ @property
+ def amount_converted(self):
+ """
+ :rtype: object_.Amount
+ """
+
+ return self._amount_converted
+
+ @property
+ def amount_billing(self):
+ """
+ :rtype: object_.Amount
+ """
+
+ return self._amount_billing
+
+ @property
+ def amount_original_local(self):
+ """
+ :rtype: object_.Amount
+ """
+
+ return self._amount_original_local
+
+ @property
+ def amount_original_billing(self):
+ """
+ :rtype: object_.Amount
+ """
+
+ return self._amount_original_billing
+
+ @property
+ def amount_fee(self):
+ """
+ :rtype: object_.Amount
+ """
+
+ return self._amount_fee
+
+ @property
+ def card_authorisation_id_response(self):
+ """
+ :rtype: str
+ """
+
+ return self._card_authorisation_id_response
+
+ @property
+ def decision(self):
+ """
+ :rtype: str
+ """
+
+ return self._decision
+
+ @property
+ def payment_status(self):
+ """
+ :rtype: str
+ """
+
+ return self._payment_status
+
+ @property
+ def decision_description(self):
+ """
+ :rtype: str
+ """
+
+ return self._decision_description
+
+ @property
+ def decision_description_translated(self):
+ """
+ :rtype: str
+ """
+
+ return self._decision_description_translated
+
+ @property
def description(self):
"""
:rtype: str
@@ -13201,116 +13153,140 @@ def description(self):
return self._description
@property
- def merchant_reference(self):
+ def authorisation_status(self):
"""
:rtype: str
"""
- return self._merchant_reference
+ return self._authorisation_status
@property
- def attachment(self):
+ def authorisation_type(self):
"""
- :rtype: list[object_.BunqId]
+ :rtype: str
"""
- return self._attachment
+ return self._authorisation_type
@property
- def status(self):
+ def pan_entry_mode_user(self):
"""
:rtype: str
"""
- return self._status
+ return self._pan_entry_mode_user
@property
- def batch_id(self):
+ def settlement_status(self):
"""
- :rtype: int
+ :rtype: str
"""
- return self._batch_id
+ return self._settlement_status
@property
- def scheduled_id(self):
+ def clearing_status(self):
"""
- :rtype: int
+ :rtype: str
"""
- return self._scheduled_id
+ return self._clearing_status
@property
- def minimum_age(self):
+ def maturity_date(self):
"""
- :rtype: int
+ :rtype: str
"""
- return self._minimum_age
+ return self._maturity_date
@property
- def require_address(self):
+ def city(self):
"""
:rtype: str
"""
- return self._require_address
+ return self._city
@property
- def bunqme_share_url(self):
+ def alias(self):
+ """
+ :rtype: object_.MonetaryAccountReference
+ """
+
+ return self._alias
+
+ @property
+ def counterparty_alias(self):
+ """
+ :rtype: object_.MonetaryAccountReference
+ """
+
+ return self._counterparty_alias
+
+ @property
+ def label_card(self):
+ """
+ :rtype: object_.LabelCard
+ """
+
+ return self._label_card
+
+ @property
+ def token_status(self):
"""
:rtype: str
"""
- return self._bunqme_share_url
+ return self._token_status
@property
- def redirect_url(self):
+ def reservation_expiry_time(self):
"""
:rtype: str
"""
- return self._redirect_url
+ return self._reservation_expiry_time
@property
- def address_shipping(self):
+ def clearing_expiry_time(self):
"""
- :rtype: object_.Address
+ :rtype: str
"""
- return self._address_shipping
+ return self._clearing_expiry_time
@property
- def address_billing(self):
+ def applied_limit(self):
"""
- :rtype: object_.Address
+ :rtype: str
"""
- return self._address_billing
+ return self._applied_limit
@property
- def geolocation(self):
+ def secure_code_id(self):
"""
- :rtype: object_.Geolocation
+ :rtype: int
"""
- return self._geolocation
+ return self._secure_code_id
@property
- def allow_chat(self):
+ def wallet_provider_id(self):
"""
- :rtype: bool
+ :rtype: str
"""
- return self._allow_chat
+ return self._wallet_provider_id
@property
- def reference_split_the_bill(self):
+ def request_reference_split_the_bill(self):
"""
- :rtype: object_.RequestReferenceSplitTheBillAnchorObject
+ :rtype: list[object_.RequestInquiryReference]
"""
- return self._reference_split_the_bill
+ return self._request_reference_split_the_bill
def is_all_field_none(self):
"""
@@ -13320,79 +13296,97 @@ def is_all_field_none(self):
if self._id_ is not None:
return False
- if self._created is not None:
+ if self._monetary_account_id is not None:
return False
- if self._updated is not None:
+ if self._card_id is not None:
return False
- if self._time_responded is not None:
+ if self._amount_local is not None:
return False
- if self._time_expiry is not None:
+ if self._amount_converted is not None:
return False
- if self._monetary_account_id is not None:
+ if self._amount_billing is not None:
return False
- if self._amount_inquired is not None:
+ if self._amount_original_local is not None:
return False
- if self._amount_responded is not None:
+ if self._amount_original_billing is not None:
return False
- if self._user_alias_created is not None:
+ if self._amount_fee is not None:
return False
- if self._user_alias_revoked is not None:
+ if self._card_authorisation_id_response is not None:
return False
- if self._counterparty_alias is not None:
+ if self._decision is not None:
+ return False
+
+ if self._payment_status is not None:
+ return False
+
+ if self._decision_description is not None:
+ return False
+
+ if self._decision_description_translated is not None:
return False
if self._description is not None:
return False
- if self._merchant_reference is not None:
+ if self._authorisation_status is not None:
return False
- if self._attachment is not None:
+ if self._authorisation_type is not None:
return False
- if self._status is not None:
+ if self._pan_entry_mode_user is not None:
return False
- if self._batch_id is not None:
+ if self._settlement_status is not None:
return False
- if self._scheduled_id is not None:
+ if self._clearing_status is not None:
return False
- if self._minimum_age is not None:
+ if self._maturity_date is not None:
return False
- if self._require_address is not None:
+ if self._city is not None:
return False
- if self._bunqme_share_url is not None:
+ if self._alias is not None:
return False
- if self._redirect_url is not None:
+ if self._counterparty_alias is not None:
return False
- if self._address_shipping is not None:
+ if self._label_card is not None:
return False
- if self._address_billing is not None:
+ if self._token_status is not None:
return False
- if self._geolocation is not None:
+ if self._reservation_expiry_time is not None:
return False
- if self._allow_chat is not None:
+ if self._clearing_expiry_time is not None:
return False
- if self._reference_split_the_bill is not None:
+ if self._applied_limit is not None:
+ return False
+
+ if self._secure_code_id is not None:
+ return False
+
+ if self._wallet_provider_id is not None:
+ return False
+
+ if self._request_reference_split_the_bill is not None:
return False
return True
@@ -13402,265 +13396,173 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: RequestInquiry
+ :rtype: MasterCardAction
"""
- return converter.json_to_class(RequestInquiry, json_str)
+ return converter.json_to_class(MasterCardAction, json_str)
-class RequestResponse(BunqModel):
+class RequestInquiryBatch(BunqModel):
"""
- A RequestResponse is what a user on the other side of a RequestInquiry gets
- when he is sent one. So a RequestInquiry is the initiator and visible for
- the user that sent it and that wants to receive the money. A RequestResponse
- is what the other side sees, i.e. the user that pays the money to accept the
- request. The content is almost identical.
+ Create a batch of requests for payment, or show the request batches of a
+ monetary account.
- :param _amount_responded: The Amount the RequestResponse was accepted with.
- :type _amount_responded: object_.Amount
- :param _status: The status of the RequestResponse. Can be ACCEPTED, PENDING,
- REJECTED, REFUND_REQUESTED, REFUNDED or REVOKED.
+ :param _request_inquiries: The list of requests that were made.
+ :type _request_inquiries: list[RequestInquiry]
+ :param _status: The status of the request.
:type _status: str
- :param _address_shipping: The shipping address provided by the accepting
- user if an address was requested.
- :type _address_shipping: object_.Address
- :param _address_billing: The billing address provided by the accepting user
- if an address was requested.
- :type _address_billing: object_.Address
- :param _id_: The id of the Request Response.
- :type _id_: int
- :param _created: The timestamp when the Request Response was created.
- :type _created: str
- :param _updated: The timestamp when the Request Response was last updated
- (will be updated when chat messages are received).
- :type _updated: str
- :param _time_responded: The timestamp of when the RequestResponse was
- responded to.
- :type _time_responded: str
- :param _time_expiry: The timestamp of when the RequestResponse expired or
- will expire.
- :type _time_expiry: str
- :param _time_refund_requested: The timestamp of when a refund request for
- the RequestResponse was claimed.
- :type _time_refund_requested: str
- :param _time_refunded: The timestamp of when the RequestResponse was
- refunded.
- :type _time_refunded: str
- :param _user_refund_requested: The label of the user that requested the
- refund.
- :type _user_refund_requested: object_.LabelUser
- :param _monetary_account_id: The id of the MonetaryAccount the
- RequestResponse was received on.
- :type _monetary_account_id: int
- :param _amount_inquired: The requested Amount.
- :type _amount_inquired: object_.Amount
- :param _description: The description for the RequestResponse provided by the
- requesting party. Maximum 9000 characters.
- :type _description: str
- :param _alias: The LabelMonetaryAccount with the public information of the
- MonetaryAccount this RequestResponse was received on.
- :type _alias: object_.MonetaryAccountReference
- :param _counterparty_alias: The LabelMonetaryAccount with the public
- information of the MonetaryAccount that is requesting money with this
- RequestResponse.
- :type _counterparty_alias: object_.MonetaryAccountReference
- :param _attachment: The Attachments attached to the RequestResponse.
- :type _attachment: list[object_.Attachment]
- :param _minimum_age: The minimum age the user accepting the RequestResponse
- must have.
- :type _minimum_age: int
- :param _require_address: Whether or not an address must be provided on
- accept.
- :type _require_address: str
- :param _geolocation: The Geolocation where the RequestResponse was created.
- :type _geolocation: object_.Geolocation
- :param _type_: The type of the RequestInquiry. Can be DIRECT_DEBIT,
- DIRECT_DEBIT_B2B, IDEAL, SOFORT or INTERNAL.
- :type _type_: str
- :param _sub_type: The subtype of the RequestInquiry. Can be ONCE or
- RECURRING for DIRECT_DEBIT RequestInquiries and NONE for all other.
- :type _sub_type: str
- :param _redirect_url: The URL which the user is sent to after accepting or
- rejecting the Request.
- :type _redirect_url: str
- :param _allow_chat: Whether or not chat messages are allowed.
- :type _allow_chat: bool
- :param _credit_scheme_identifier: The credit scheme id provided by the
- counterparty for DIRECT_DEBIT inquiries.
- :type _credit_scheme_identifier: str
- :param _mandate_identifier: The mandate id provided by the counterparty for
- DIRECT_DEBIT inquiries.
- :type _mandate_identifier: str
- :param _eligible_whitelist_id: The whitelist id for this action or null.
- :type _eligible_whitelist_id: int
- :param _request_reference_split_the_bill: The reference to the object used
- for split the bill. Can be RequestInquiry or RequestInquiryBatch
- :type _request_reference_split_the_bill:
- list[object_.RequestInquiryReference]
+ :param _total_amount_inquired: The total amount originally inquired for this
+ batch.
+ :type _total_amount_inquired: object_.Amount
+ :param _event_id: The ID of the associated event if the request batch was
+ made using 'split the bill'.
+ :type _event_id: int
+ :param _reference_split_the_bill: The reference to the object used for split
+ the bill. Can be Payment, PaymentBatch, ScheduleInstance, RequestResponse
+ and MasterCardAction
+ :type _reference_split_the_bill:
+ object_.RequestReferenceSplitTheBillAnchorObject
"""
# Endpoint constants.
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/request-response/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/request-response"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/request-response/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/request-inquiry-batch"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/request-inquiry-batch/{}"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/request-inquiry-batch/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/request-inquiry-batch"
# Field constants.
- FIELD_AMOUNT_RESPONDED = "amount_responded"
+ FIELD_REQUEST_INQUIRIES = "request_inquiries"
FIELD_STATUS = "status"
- FIELD_ADDRESS_SHIPPING = "address_shipping"
- FIELD_ADDRESS_BILLING = "address_billing"
+ FIELD_TOTAL_AMOUNT_INQUIRED = "total_amount_inquired"
+ FIELD_EVENT_ID = "event_id"
# Object type.
- _OBJECT_TYPE_PUT = "RequestResponse"
- _OBJECT_TYPE_GET = "RequestResponse"
+ _OBJECT_TYPE_GET = "RequestInquiryBatch"
- _id_ = None
- _created = None
- _updated = None
- _time_responded = None
- _time_expiry = None
- _time_refund_requested = None
- _time_refunded = None
- _user_refund_requested = None
- _monetary_account_id = None
- _amount_inquired = None
- _amount_responded = None
- _status = None
- _description = None
- _alias = None
- _counterparty_alias = None
- _attachment = None
- _minimum_age = None
- _require_address = None
- _geolocation = None
- _type_ = None
- _sub_type = None
- _redirect_url = None
- _address_billing = None
- _address_shipping = None
- _allow_chat = None
- _credit_scheme_identifier = None
- _mandate_identifier = None
- _eligible_whitelist_id = None
- _request_reference_split_the_bill = None
- _amount_responded_field_for_request = None
+ _request_inquiries = None
+ _total_amount_inquired = None
+ _reference_split_the_bill = None
+ _request_inquiries_field_for_request = None
_status_field_for_request = None
- _address_shipping_field_for_request = None
- _address_billing_field_for_request = None
+ _total_amount_inquired_field_for_request = None
+ _event_id_field_for_request = None
- def __init__(self, status=None, amount_responded=None, address_shipping=None, address_billing=None):
+ def __init__(self, request_inquiries, total_amount_inquired, status=None, event_id=None):
"""
- :param status: The responding status of the RequestResponse. Can be ACCEPTED
- or REJECTED.
+ :param request_inquiries: The list of request inquiries we want to send in 1
+ batch.
+ :type request_inquiries: list[RequestInquiry]
+ :param total_amount_inquired: The total amount originally inquired for this
+ batch.
+ :type total_amount_inquired: object_.Amount
+ :param status: The status of the request.
:type status: str
- :param amount_responded: The Amount the user decides to pay.
- :type amount_responded: object_.Amount
- :param address_shipping: The shipping Address to return to the user who
- created the RequestInquiry. Should only be provided if 'require_address' is
- set to SHIPPING, BILLING_SHIPPING or OPTIONAL.
- :type address_shipping: object_.Address
- :param address_billing: The billing Address to return to the user who
- created the RequestInquiry. Should only be provided if 'require_address' is
- set to BILLING, BILLING_SHIPPING or OPTIONAL.
- :type address_billing: object_.Address
+ :param event_id: The ID of the associated event if the request batch was
+ made using 'split the bill'.
+ :type event_id: int
"""
+ self._request_inquiries_field_for_request = request_inquiries
+ self._total_amount_inquired_field_for_request = total_amount_inquired
self._status_field_for_request = status
- self._amount_responded_field_for_request = amount_responded
- self._address_shipping_field_for_request = address_shipping
- self._address_billing_field_for_request = address_billing
+ self._event_id_field_for_request = event_id
@classmethod
- def update(cls, request_response_id, monetary_account_id=None, amount_responded=None, status=None,
- address_shipping=None, address_billing=None, custom_headers=None):
+ def create(cls, request_inquiries, total_amount_inquired, monetary_account_id=None, status=None, event_id=None,
+ custom_headers=None):
"""
- Update the status to accept or reject the RequestResponse.
+ Create a request batch by sending an array of single request objects,
+ that will become part of the batch.
:type user_id: int
:type monetary_account_id: int
- :type request_response_id: int
- :param amount_responded: The Amount the user decides to pay.
- :type amount_responded: object_.Amount
- :param status: The responding status of the RequestResponse. Can be
- ACCEPTED or REJECTED.
+ :param request_inquiries: The list of request inquiries we want to send
+ in 1 batch.
+ :type request_inquiries: list[RequestInquiry]
+ :param total_amount_inquired: The total amount originally inquired for
+ this batch.
+ :type total_amount_inquired: object_.Amount
+ :param status: The status of the request.
:type status: str
- :param address_shipping: The shipping Address to return to the user who
- created the RequestInquiry. Should only be provided if 'require_address'
- is set to SHIPPING, BILLING_SHIPPING or OPTIONAL.
- :type address_shipping: object_.Address
- :param address_billing: The billing Address to return to the user who
- created the RequestInquiry. Should only be provided if 'require_address'
- is set to BILLING, BILLING_SHIPPING or OPTIONAL.
- :type address_billing: object_.Address
+ :param event_id: The ID of the associated event if the request batch was
+ made using 'split the bill'.
+ :type event_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseRequestResponse
+ :rtype: BunqResponseInt
"""
if custom_headers is None:
custom_headers = {}
- api_client = ApiClient(cls._get_api_context())
-
request_map = {
- cls.FIELD_AMOUNT_RESPONDED: amount_responded,
+ cls.FIELD_REQUEST_INQUIRIES: request_inquiries,
cls.FIELD_STATUS: status,
- cls.FIELD_ADDRESS_SHIPPING: address_shipping,
- cls.FIELD_ADDRESS_BILLING: address_billing
+ cls.FIELD_TOTAL_AMOUNT_INQUIRED: total_amount_inquired,
+ cls.FIELD_EVENT_ID: event_id
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
+ api_client = ApiClient(cls._get_api_context())
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- request_response_id)
- response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id))
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
- return BunqResponseRequestResponse.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_PUT)
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
)
@classmethod
- def list(cls, monetary_account_id=None, params=None, custom_headers=None):
+ def update(cls, request_inquiry_batch_id, monetary_account_id=None, status=None, custom_headers=None):
"""
- Get all RequestResponses for a MonetaryAccount.
+ Revoke a request batch. The status of all the requests will be set to
+ REVOKED.
:type user_id: int
:type monetary_account_id: int
- :type params: dict[str, str]|None
+ :type request_inquiry_batch_id: int
+ :param status: The status of the request.
+ :type status: str
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseRequestResponseList
+ :rtype: BunqResponseInt
"""
- if params is None:
- params = {}
-
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
- response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseRequestResponseList.cast_from_bunq_response(
- cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ request_map = {
+ cls.FIELD_STATUS: status
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ request_inquiry_batch_id)
+ response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
)
@classmethod
- def get(cls, request_response_id, monetary_account_id=None, custom_headers=None):
+ def get(cls, request_inquiry_batch_id, monetary_account_id=None, custom_headers=None):
"""
- Get the details for a specific existing RequestResponse.
+ Return the details of a specific request batch.
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type request_response_id: int
+ :type request_inquiry_batch_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseRequestResponse
+ :rtype: BunqResponseRequestInquiryBatch
"""
if custom_headers is None:
@@ -13669,244 +13571,708 @@ def get(cls, request_response_id, monetary_account_id=None, custom_headers=None)
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_response_id)
+ request_inquiry_batch_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseRequestResponse.cast_from_bunq_response(
+ return BunqResponseRequestInquiryBatch.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
- @property
- def id_(self):
- """
- :rtype: int
- """
-
- return self._id_
-
- @property
- def created(self):
- """
- :rtype: str
- """
-
- return self._created
-
- @property
- def updated(self):
- """
- :rtype: str
- """
-
- return self._updated
-
- @property
- def time_responded(self):
- """
- :rtype: str
- """
-
- return self._time_responded
-
- @property
- def time_expiry(self):
- """
- :rtype: str
- """
-
- return self._time_expiry
-
- @property
- def time_refund_requested(self):
+ @classmethod
+ def list(cls, monetary_account_id=None, params=None, custom_headers=None):
"""
- :rtype: str
+ Return all the request batches for a monetary account.
+
+ :type user_id: int
+ :type monetary_account_id: int
+ :type params: dict[str, str]|None
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseRequestInquiryBatchList
"""
- return self._time_refund_requested
-
- @property
- def time_refunded(self):
- """
- :rtype: str
- """
+ if params is None:
+ params = {}
- return self._time_refunded
+ if custom_headers is None:
+ custom_headers = {}
- @property
- def user_refund_requested(self):
- """
- :rtype: object_.LabelUser
- """
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id))
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
- return self._user_refund_requested
+ return BunqResponseRequestInquiryBatchList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ )
@property
- def monetary_account_id(self):
+ def request_inquiries(self):
"""
- :rtype: int
+ :rtype: list[RequestInquiry]
"""
- return self._monetary_account_id
+ return self._request_inquiries
@property
- def amount_inquired(self):
+ def total_amount_inquired(self):
"""
:rtype: object_.Amount
"""
- return self._amount_inquired
+ return self._total_amount_inquired
@property
- def amount_responded(self):
+ def reference_split_the_bill(self):
"""
- :rtype: object_.Amount
+ :rtype: object_.RequestReferenceSplitTheBillAnchorObject
"""
- return self._amount_responded
+ return self._reference_split_the_bill
- @property
- def status(self):
+ def is_all_field_none(self):
"""
- :rtype: str
+ :rtype: bool
"""
- return self._status
-
- @property
- def description(self):
- """
- :rtype: str
- """
+ if self._request_inquiries is not None:
+ return False
- return self._description
+ if self._total_amount_inquired is not None:
+ return False
- @property
- def alias(self):
- """
- :rtype: object_.MonetaryAccountReference
- """
+ if self._reference_split_the_bill is not None:
+ return False
- return self._alias
+ return True
- @property
- def counterparty_alias(self):
+ @staticmethod
+ def from_json(json_str):
"""
- :rtype: object_.MonetaryAccountReference
+ :type json_str: str
+
+ :rtype: RequestInquiryBatch
"""
- return self._counterparty_alias
+ return converter.json_to_class(RequestInquiryBatch, json_str)
- @property
- def attachment(self):
- """
- :rtype: list[object_.Attachment]
- """
- return self._attachment
+class RequestInquiry(BunqModel):
+ """
+ RequestInquiry, aka 'RFP' (Request for Payment), is one of the innovative
+ features that bunq offers. To request payment from another bunq account a
+ new Request Inquiry is created. As with payments you can add attachments to
+ a RFP. Requests for Payment are the foundation for a number of consumer
+ features like 'Split the bill' and 'Request forwarding'. We invite you to
+ invent your own based on the bunq api!
+
+ :param _amount_inquired: The requested amount.
+ :type _amount_inquired: object_.Amount
+ :param _counterparty_alias: The LabelMonetaryAccount with the public
+ information of the MonetaryAccount the money was requested from.
+ :type _counterparty_alias: object_.MonetaryAccountReference
+ :param _description: The description of the inquiry.
+ :type _description: str
+ :param _attachment: The attachments attached to the payment.
+ :type _attachment: list[object_.BunqId]
+ :param _merchant_reference: The client's custom reference that was attached
+ to the request and the mutation.
+ :type _merchant_reference: str
+ :param _status: The status of the request.
+ :type _status: str
+ :param _minimum_age: The minimum age the user accepting the RequestInquiry
+ must have.
+ :type _minimum_age: int
+ :param _require_address: Whether or not an address must be provided on
+ accept.
+ :type _require_address: str
+ :param _want_tip: [DEPRECATED] Whether or not the accepting user can give an
+ extra tip on top of the requested Amount. Defaults to false.
+ :type _want_tip: bool
+ :param _allow_amount_lower: [DEPRECATED] Whether or not the accepting user
+ can choose to accept with a lower amount than requested. Defaults to false.
+ :type _allow_amount_lower: bool
+ :param _allow_amount_higher: [DEPRECATED] Whether or not the accepting user
+ can choose to accept with a higher amount than requested. Defaults to false.
+ :type _allow_amount_higher: bool
+ :param _allow_bunqme: Whether or not sending a bunq.me request is allowed.
+ :type _allow_bunqme: bool
+ :param _redirect_url: The URL which the user is sent to after accepting or
+ rejecting the Request.
+ :type _redirect_url: str
+ :param _event_id: The ID of the associated event if the request was made
+ using 'split the bill'.
+ :type _event_id: int
+ :param _id_: The id of the created RequestInquiry.
+ :type _id_: int
+ :param _created: The timestamp of the payment request's creation.
+ :type _created: str
+ :param _updated: The timestamp of the payment request's last update.
+ :type _updated: str
+ :param _time_responded: The timestamp of when the payment request was
+ responded to.
+ :type _time_responded: str
+ :param _time_expiry: The timestamp of when the payment request expired.
+ :type _time_expiry: str
+ :param _monetary_account_id: The id of the monetary account the request
+ response applies to.
+ :type _monetary_account_id: int
+ :param _amount_responded: The responded amount.
+ :type _amount_responded: object_.Amount
+ :param _user_alias_created: The label that's displayed to the counterparty
+ with the mutation. Includes user.
+ :type _user_alias_created: object_.LabelUser
+ :param _user_alias_revoked: The label that's displayed to the counterparty
+ with the mutation. Includes user.
+ :type _user_alias_revoked: object_.LabelUser
+ :param _batch_id: The id of the batch if the request was part of a batch.
+ :type _batch_id: int
+ :param _scheduled_id: The id of the scheduled job if the request was
+ scheduled.
+ :type _scheduled_id: int
+ :param _bunqme_share_url: The url that points to the bunq.me request.
+ :type _bunqme_share_url: str
+ :param _address_shipping: The shipping address provided by the accepting
+ user if an address was requested.
+ :type _address_shipping: object_.Address
+ :param _address_billing: The billing address provided by the accepting user
+ if an address was requested.
+ :type _address_billing: object_.Address
+ :param _geolocation: The geolocation where the payment was done.
+ :type _geolocation: object_.Geolocation
+ :param _reference_split_the_bill: The reference to the object used for split
+ the bill. Can be Payment, PaymentBatch, ScheduleInstance, RequestResponse
+ and MasterCardAction
+ :type _reference_split_the_bill:
+ object_.RequestReferenceSplitTheBillAnchorObject
+ """
- @property
- def minimum_age(self):
- """
- :rtype: int
- """
+ # Endpoint constants.
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/request-inquiry"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/request-inquiry/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/request-inquiry"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/request-inquiry/{}"
- return self._minimum_age
+ # Field constants.
+ FIELD_AMOUNT_INQUIRED = "amount_inquired"
+ FIELD_COUNTERPARTY_ALIAS = "counterparty_alias"
+ FIELD_DESCRIPTION = "description"
+ FIELD_ATTACHMENT = "attachment"
+ FIELD_MERCHANT_REFERENCE = "merchant_reference"
+ FIELD_STATUS = "status"
+ FIELD_MINIMUM_AGE = "minimum_age"
+ FIELD_REQUIRE_ADDRESS = "require_address"
+ FIELD_WANT_TIP = "want_tip"
+ FIELD_ALLOW_AMOUNT_LOWER = "allow_amount_lower"
+ FIELD_ALLOW_AMOUNT_HIGHER = "allow_amount_higher"
+ FIELD_ALLOW_BUNQME = "allow_bunqme"
+ FIELD_REDIRECT_URL = "redirect_url"
+ FIELD_EVENT_ID = "event_id"
- @property
- def require_address(self):
- """
- :rtype: str
+ # Object type.
+ _OBJECT_TYPE_PUT = "RequestInquiry"
+ _OBJECT_TYPE_GET = "RequestInquiry"
+
+ _id_ = None
+ _created = None
+ _updated = None
+ _time_responded = None
+ _time_expiry = None
+ _monetary_account_id = None
+ _amount_inquired = None
+ _amount_responded = None
+ _user_alias_created = None
+ _user_alias_revoked = None
+ _counterparty_alias = None
+ _description = None
+ _merchant_reference = None
+ _attachment = None
+ _status = None
+ _batch_id = None
+ _scheduled_id = None
+ _minimum_age = None
+ _require_address = None
+ _bunqme_share_url = None
+ _redirect_url = None
+ _address_shipping = None
+ _address_billing = None
+ _geolocation = None
+ _reference_split_the_bill = None
+ _amount_inquired_field_for_request = None
+ _counterparty_alias_field_for_request = None
+ _description_field_for_request = None
+ _attachment_field_for_request = None
+ _merchant_reference_field_for_request = None
+ _status_field_for_request = None
+ _minimum_age_field_for_request = None
+ _require_address_field_for_request = None
+ _want_tip_field_for_request = None
+ _allow_amount_lower_field_for_request = None
+ _allow_amount_higher_field_for_request = None
+ _allow_bunqme_field_for_request = None
+ _redirect_url_field_for_request = None
+ _event_id_field_for_request = None
+
+ def __init__(self, amount_inquired, counterparty_alias, description, allow_bunqme, attachment=None,
+ merchant_reference=None, status=None, minimum_age=None, require_address=None, want_tip=None,
+ allow_amount_lower=None, allow_amount_higher=None, redirect_url=None, event_id=None):
+ """
+ :param amount_inquired: The Amount requested to be paid by the person the
+ RequestInquiry is sent to. Must be bigger than 0.
+ :type amount_inquired: object_.Amount
+ :param counterparty_alias: The Alias of the party we are requesting the
+ money from. Can be an Alias of type EMAIL, PHONE_NUMBER or IBAN. In case the
+ EMAIL or PHONE_NUMBER Alias does not refer to a bunq monetary account,
+ 'allow_bunqme' needs to be 'true' in order to trigger the creation of a
+ bunq.me request. Otherwise no request inquiry will be sent.
+ :type counterparty_alias: object_.Pointer
+ :param description: The description for the RequestInquiry. Maximum 9000
+ characters. Field is required but can be an empty string.
+ :type description: str
+ :param allow_bunqme: Whether or not sending a bunq.me request is allowed.
+ :type allow_bunqme: bool
+ :param attachment: The Attachments to attach to the RequestInquiry.
+ :type attachment: list[object_.BunqId]
+ :param merchant_reference: Optional data to be included with the
+ RequestInquiry specific to the merchant. Has to be unique for the same
+ source MonetaryAccount.
+ :type merchant_reference: str
+ :param status: The status of the RequestInquiry. Ignored in POST requests
+ but can be used for revoking (cancelling) the RequestInquiry by setting
+ REVOKED with a PUT request.
+ :type status: str
+ :param minimum_age: The minimum age the user accepting the RequestInquiry
+ must have. Defaults to not checking. If set, must be between 12 and 100
+ inclusive.
+ :type minimum_age: int
+ :param require_address: Whether a billing and shipping address must be
+ provided when paying the request. Possible values are: BILLING, SHIPPING,
+ BILLING_SHIPPING, NONE, OPTIONAL. Default is NONE.
+ :type require_address: str
+ :param want_tip: [DEPRECATED] Whether or not the accepting user can give an
+ extra tip on top of the requested Amount. Defaults to false.
+ :type want_tip: bool
+ :param allow_amount_lower: [DEPRECATED] Whether or not the accepting user
+ can choose to accept with a lower amount than requested. Defaults to false.
+ :type allow_amount_lower: bool
+ :param allow_amount_higher: [DEPRECATED] Whether or not the accepting user
+ can choose to accept with a higher amount than requested. Defaults to false.
+ :type allow_amount_higher: bool
+ :param redirect_url: The URL which the user is sent to after accepting or
+ rejecting the Request.
+ :type redirect_url: str
+ :param event_id: The ID of the associated event if the request was made
+ using 'split the bill'.
+ :type event_id: int
"""
- return self._require_address
+ self._amount_inquired_field_for_request = amount_inquired
+ self._counterparty_alias_field_for_request = counterparty_alias
+ self._description_field_for_request = description
+ self._allow_bunqme_field_for_request = allow_bunqme
+ self._attachment_field_for_request = attachment
+ self._merchant_reference_field_for_request = merchant_reference
+ self._status_field_for_request = status
+ self._minimum_age_field_for_request = minimum_age
+ self._require_address_field_for_request = require_address
+ self._want_tip_field_for_request = want_tip
+ self._allow_amount_lower_field_for_request = allow_amount_lower
+ self._allow_amount_higher_field_for_request = allow_amount_higher
+ self._redirect_url_field_for_request = redirect_url
+ self._event_id_field_for_request = event_id
+
+ @classmethod
+ def create(cls, amount_inquired, counterparty_alias, description, allow_bunqme, monetary_account_id=None,
+ attachment=None, merchant_reference=None, status=None, minimum_age=None, require_address=None,
+ want_tip=None, allow_amount_lower=None, allow_amount_higher=None, redirect_url=None, event_id=None,
+ custom_headers=None):
+ """
+ Create a new payment request.
+
+ :type user_id: int
+ :type monetary_account_id: int
+ :param amount_inquired: The Amount requested to be paid by the person
+ the RequestInquiry is sent to. Must be bigger than 0.
+ :type amount_inquired: object_.Amount
+ :param counterparty_alias: The Alias of the party we are requesting the
+ money from. Can be an Alias of type EMAIL, PHONE_NUMBER or IBAN. In case
+ the EMAIL or PHONE_NUMBER Alias does not refer to a bunq monetary
+ account, 'allow_bunqme' needs to be 'true' in order to trigger the
+ creation of a bunq.me request. Otherwise no request inquiry will be
+ sent.
+ :type counterparty_alias: object_.Pointer
+ :param description: The description for the RequestInquiry. Maximum 9000
+ characters. Field is required but can be an empty string.
+ :type description: str
+ :param allow_bunqme: Whether or not sending a bunq.me request is
+ allowed.
+ :type allow_bunqme: bool
+ :param attachment: The Attachments to attach to the RequestInquiry.
+ :type attachment: list[object_.BunqId]
+ :param merchant_reference: Optional data to be included with the
+ RequestInquiry specific to the merchant. Has to be unique for the same
+ source MonetaryAccount.
+ :type merchant_reference: str
+ :param status: The status of the RequestInquiry. Ignored in POST
+ requests but can be used for revoking (cancelling) the RequestInquiry by
+ setting REVOKED with a PUT request.
+ :type status: str
+ :param minimum_age: The minimum age the user accepting the
+ RequestInquiry must have. Defaults to not checking. If set, must be
+ between 12 and 100 inclusive.
+ :type minimum_age: int
+ :param require_address: Whether a billing and shipping address must be
+ provided when paying the request. Possible values are: BILLING,
+ SHIPPING, BILLING_SHIPPING, NONE, OPTIONAL. Default is NONE.
+ :type require_address: str
+ :param want_tip: [DEPRECATED] Whether or not the accepting user can give
+ an extra tip on top of the requested Amount. Defaults to false.
+ :type want_tip: bool
+ :param allow_amount_lower: [DEPRECATED] Whether or not the accepting
+ user can choose to accept with a lower amount than requested. Defaults
+ to false.
+ :type allow_amount_lower: bool
+ :param allow_amount_higher: [DEPRECATED] Whether or not the accepting
+ user can choose to accept with a higher amount than requested. Defaults
+ to false.
+ :type allow_amount_higher: bool
+ :param redirect_url: The URL which the user is sent to after accepting
+ or rejecting the Request.
+ :type redirect_url: str
+ :param event_id: The ID of the associated event if the request was made
+ using 'split the bill'.
+ :type event_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ request_map = {
+ cls.FIELD_AMOUNT_INQUIRED: amount_inquired,
+ cls.FIELD_COUNTERPARTY_ALIAS: counterparty_alias,
+ cls.FIELD_DESCRIPTION: description,
+ cls.FIELD_ATTACHMENT: attachment,
+ cls.FIELD_MERCHANT_REFERENCE: merchant_reference,
+ cls.FIELD_STATUS: status,
+ cls.FIELD_MINIMUM_AGE: minimum_age,
+ cls.FIELD_REQUIRE_ADDRESS: require_address,
+ cls.FIELD_WANT_TIP: want_tip,
+ cls.FIELD_ALLOW_AMOUNT_LOWER: allow_amount_lower,
+ cls.FIELD_ALLOW_AMOUNT_HIGHER: allow_amount_higher,
+ cls.FIELD_ALLOW_BUNQME: allow_bunqme,
+ cls.FIELD_REDIRECT_URL: redirect_url,
+ cls.FIELD_EVENT_ID: event_id
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ api_client = ApiClient(cls._get_api_context())
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id))
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
+
+ @classmethod
+ def update(cls, request_inquiry_id, monetary_account_id=None, status=None, custom_headers=None):
+ """
+ Revoke a request for payment, by updating the status to REVOKED.
+
+ :type user_id: int
+ :type monetary_account_id: int
+ :type request_inquiry_id: int
+ :param status: The status of the RequestInquiry. Ignored in POST
+ requests but can be used for revoking (cancelling) the RequestInquiry by
+ setting REVOKED with a PUT request.
+ :type status: str
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseRequestInquiry
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+
+ request_map = {
+ cls.FIELD_STATUS: status
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ request_inquiry_id)
+ response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseRequestInquiry.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_PUT)
+ )
+
+ @classmethod
+ def list(cls, monetary_account_id=None, params=None, custom_headers=None):
+ """
+ Get all payment requests for a user's monetary account. bunqme_share_url
+ is always null if the counterparty is a bunq user.
+
+ :type user_id: int
+ :type monetary_account_id: int
+ :type params: dict[str, str]|None
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseRequestInquiryList
+ """
+
+ if params is None:
+ params = {}
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id))
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
+
+ return BunqResponseRequestInquiryList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @classmethod
+ def get(cls, request_inquiry_id, monetary_account_id=None, custom_headers=None):
+ """
+ Get the details of a specific payment request, including its status.
+ bunqme_share_url is always null if the counterparty is a bunq user.
+
+ :type api_context: ApiContext
+ :type user_id: int
+ :type monetary_account_id: int
+ :type request_inquiry_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseRequestInquiry
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ request_inquiry_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponseRequestInquiry.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
@property
- def geolocation(self):
+ def id_(self):
"""
- :rtype: object_.Geolocation
+ :rtype: int
"""
- return self._geolocation
+ return self._id_
@property
- def type_(self):
+ def created(self):
"""
:rtype: str
"""
- return self._type_
+ return self._created
@property
- def sub_type(self):
+ def updated(self):
"""
:rtype: str
"""
- return self._sub_type
+ return self._updated
@property
- def redirect_url(self):
+ def time_responded(self):
"""
:rtype: str
"""
- return self._redirect_url
+ return self._time_responded
@property
- def address_billing(self):
+ def time_expiry(self):
"""
- :rtype: object_.Address
+ :rtype: str
"""
- return self._address_billing
+ return self._time_expiry
@property
- def address_shipping(self):
+ def monetary_account_id(self):
"""
- :rtype: object_.Address
+ :rtype: int
"""
- return self._address_shipping
+ return self._monetary_account_id
@property
- def allow_chat(self):
+ def amount_inquired(self):
"""
- :rtype: bool
+ :rtype: object_.Amount
"""
- return self._allow_chat
+ return self._amount_inquired
@property
- def credit_scheme_identifier(self):
+ def amount_responded(self):
+ """
+ :rtype: object_.Amount
+ """
+
+ return self._amount_responded
+
+ @property
+ def user_alias_created(self):
+ """
+ :rtype: object_.LabelUser
+ """
+
+ return self._user_alias_created
+
+ @property
+ def user_alias_revoked(self):
+ """
+ :rtype: object_.LabelUser
+ """
+
+ return self._user_alias_revoked
+
+ @property
+ def counterparty_alias(self):
+ """
+ :rtype: object_.MonetaryAccountReference
+ """
+
+ return self._counterparty_alias
+
+ @property
+ def description(self):
"""
:rtype: str
"""
- return self._credit_scheme_identifier
+ return self._description
@property
- def mandate_identifier(self):
+ def merchant_reference(self):
"""
:rtype: str
"""
- return self._mandate_identifier
+ return self._merchant_reference
@property
- def eligible_whitelist_id(self):
+ def attachment(self):
+ """
+ :rtype: list[object_.BunqId]
+ """
+
+ return self._attachment
+
+ @property
+ def status(self):
+ """
+ :rtype: str
+ """
+
+ return self._status
+
+ @property
+ def batch_id(self):
"""
:rtype: int
"""
- return self._eligible_whitelist_id
+ return self._batch_id
@property
- def request_reference_split_the_bill(self):
+ def scheduled_id(self):
"""
- :rtype: list[object_.RequestInquiryReference]
+ :rtype: int
"""
- return self._request_reference_split_the_bill
+ return self._scheduled_id
+
+ @property
+ def minimum_age(self):
+ """
+ :rtype: int
+ """
+
+ return self._minimum_age
+
+ @property
+ def require_address(self):
+ """
+ :rtype: str
+ """
+
+ return self._require_address
+
+ @property
+ def bunqme_share_url(self):
+ """
+ :rtype: str
+ """
+
+ return self._bunqme_share_url
+
+ @property
+ def redirect_url(self):
+ """
+ :rtype: str
+ """
+
+ return self._redirect_url
+
+ @property
+ def address_shipping(self):
+ """
+ :rtype: object_.Address
+ """
+
+ return self._address_shipping
+
+ @property
+ def address_billing(self):
+ """
+ :rtype: object_.Address
+ """
+
+ return self._address_billing
+
+ @property
+ def geolocation(self):
+ """
+ :rtype: object_.Geolocation
+ """
+
+ return self._geolocation
+
+ @property
+ def reference_split_the_bill(self):
+ """
+ :rtype: object_.RequestReferenceSplitTheBillAnchorObject
+ """
+
+ return self._reference_split_the_bill
def is_all_field_none(self):
"""
@@ -13928,15 +14294,6 @@ def is_all_field_none(self):
if self._time_expiry is not None:
return False
- if self._time_refund_requested is not None:
- return False
-
- if self._time_refunded is not None:
- return False
-
- if self._user_refund_requested is not None:
- return False
-
if self._monetary_account_id is not None:
return False
@@ -13946,58 +14303,55 @@ def is_all_field_none(self):
if self._amount_responded is not None:
return False
- if self._status is not None:
- return False
-
- if self._description is not None:
+ if self._user_alias_created is not None:
return False
- if self._alias is not None:
+ if self._user_alias_revoked is not None:
return False
if self._counterparty_alias is not None:
return False
- if self._attachment is not None:
+ if self._description is not None:
return False
- if self._minimum_age is not None:
+ if self._merchant_reference is not None:
return False
- if self._require_address is not None:
+ if self._attachment is not None:
return False
- if self._geolocation is not None:
+ if self._status is not None:
return False
- if self._type_ is not None:
+ if self._batch_id is not None:
return False
- if self._sub_type is not None:
+ if self._scheduled_id is not None:
return False
- if self._redirect_url is not None:
+ if self._minimum_age is not None:
return False
- if self._address_billing is not None:
+ if self._require_address is not None:
return False
- if self._address_shipping is not None:
+ if self._bunqme_share_url is not None:
return False
- if self._allow_chat is not None:
+ if self._redirect_url is not None:
return False
- if self._credit_scheme_identifier is not None:
+ if self._address_shipping is not None:
return False
- if self._mandate_identifier is not None:
+ if self._address_billing is not None:
return False
- if self._eligible_whitelist_id is not None:
+ if self._geolocation is not None:
return False
- if self._request_reference_split_the_bill is not None:
+ if self._reference_split_the_bill is not None:
return False
return True
@@ -14007,22 +14361,95 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: RequestResponse
+ :rtype: RequestInquiry
"""
- return converter.json_to_class(RequestResponse, json_str)
+ return converter.json_to_class(RequestInquiry, json_str)
-class TabResultResponse(BunqModel):
+class RequestResponse(BunqModel):
"""
- Used to view TabResultResponse objects belonging to a tab. A
- TabResultResponse is an object that holds details on a tab which has been
- paid from the provided monetary account.
+ A RequestResponse is what a user on the other side of a RequestInquiry gets
+ when he is sent one. So a RequestInquiry is the initiator and visible for
+ the user that sent it and that wants to receive the money. A RequestResponse
+ is what the other side sees, i.e. the user that pays the money to accept the
+ request. The content is almost identical.
- :param _tab: The Tab details.
- :type _tab: Tab
- :param _payment: The payment made for the Tab.
- :type _payment: Payment
+ :param _amount_responded: The Amount the RequestResponse was accepted with.
+ :type _amount_responded: object_.Amount
+ :param _status: The status of the RequestResponse. Can be ACCEPTED, PENDING,
+ REJECTED, REFUND_REQUESTED, REFUNDED or REVOKED.
+ :type _status: str
+ :param _address_shipping: The shipping address provided by the accepting
+ user if an address was requested.
+ :type _address_shipping: object_.Address
+ :param _address_billing: The billing address provided by the accepting user
+ if an address was requested.
+ :type _address_billing: object_.Address
+ :param _id_: The id of the Request Response.
+ :type _id_: int
+ :param _created: The timestamp when the Request Response was created.
+ :type _created: str
+ :param _updated: The timestamp when the Request Response was last updated
+ (will be updated when chat messages are received).
+ :type _updated: str
+ :param _time_responded: The timestamp of when the RequestResponse was
+ responded to.
+ :type _time_responded: str
+ :param _time_expiry: The timestamp of when the RequestResponse expired or
+ will expire.
+ :type _time_expiry: str
+ :param _time_refund_requested: The timestamp of when a refund request for
+ the RequestResponse was claimed.
+ :type _time_refund_requested: str
+ :param _time_refunded: The timestamp of when the RequestResponse was
+ refunded.
+ :type _time_refunded: str
+ :param _user_refund_requested: The label of the user that requested the
+ refund.
+ :type _user_refund_requested: object_.LabelUser
+ :param _monetary_account_id: The id of the MonetaryAccount the
+ RequestResponse was received on.
+ :type _monetary_account_id: int
+ :param _amount_inquired: The requested Amount.
+ :type _amount_inquired: object_.Amount
+ :param _description: The description for the RequestResponse provided by the
+ requesting party. Maximum 9000 characters.
+ :type _description: str
+ :param _alias: The LabelMonetaryAccount with the public information of the
+ MonetaryAccount this RequestResponse was received on.
+ :type _alias: object_.MonetaryAccountReference
+ :param _counterparty_alias: The LabelMonetaryAccount with the public
+ information of the MonetaryAccount that is requesting money with this
+ RequestResponse.
+ :type _counterparty_alias: object_.MonetaryAccountReference
+ :param _attachment: The Attachments attached to the RequestResponse.
+ :type _attachment: list[object_.Attachment]
+ :param _minimum_age: The minimum age the user accepting the RequestResponse
+ must have.
+ :type _minimum_age: int
+ :param _require_address: Whether or not an address must be provided on
+ accept.
+ :type _require_address: str
+ :param _geolocation: The Geolocation where the RequestResponse was created.
+ :type _geolocation: object_.Geolocation
+ :param _type_: The type of the RequestInquiry. Can be DIRECT_DEBIT,
+ DIRECT_DEBIT_B2B, IDEAL, SOFORT or INTERNAL.
+ :type _type_: str
+ :param _sub_type: The subtype of the RequestInquiry. Can be ONCE or
+ RECURRING for DIRECT_DEBIT RequestInquiries and NONE for all other.
+ :type _sub_type: str
+ :param _redirect_url: The URL which the user is sent to after accepting or
+ rejecting the Request.
+ :type _redirect_url: str
+ :param _credit_scheme_identifier: The credit scheme id provided by the
+ counterparty for DIRECT_DEBIT inquiries.
+ :type _credit_scheme_identifier: str
+ :param _mandate_identifier: The mandate id provided by the counterparty for
+ DIRECT_DEBIT inquiries.
+ :type _mandate_identifier: str
+ :param _eligible_whitelist_id: The whitelist id for this action or null.
+ :type _eligible_whitelist_id: int
:param _request_reference_split_the_bill: The reference to the object used
for split the bill. Can be RequestInquiry or RequestInquiryBatch
:type _request_reference_split_the_bill:
@@ -14030,54 +14457,137 @@ class TabResultResponse(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/tab-result-response/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/tab-result-response"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/request-response/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/request-response"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/request-response/{}"
+
+ # Field constants.
+ FIELD_AMOUNT_RESPONDED = "amount_responded"
+ FIELD_STATUS = "status"
+ FIELD_ADDRESS_SHIPPING = "address_shipping"
+ FIELD_ADDRESS_BILLING = "address_billing"
# Object type.
- _OBJECT_TYPE_GET = "TabResultResponse"
+ _OBJECT_TYPE_PUT = "RequestResponse"
+ _OBJECT_TYPE_GET = "RequestResponse"
- _tab = None
- _payment = None
+ _id_ = None
+ _created = None
+ _updated = None
+ _time_responded = None
+ _time_expiry = None
+ _time_refund_requested = None
+ _time_refunded = None
+ _user_refund_requested = None
+ _monetary_account_id = None
+ _amount_inquired = None
+ _amount_responded = None
+ _status = None
+ _description = None
+ _alias = None
+ _counterparty_alias = None
+ _attachment = None
+ _minimum_age = None
+ _require_address = None
+ _geolocation = None
+ _type_ = None
+ _sub_type = None
+ _redirect_url = None
+ _address_billing = None
+ _address_shipping = None
+ _credit_scheme_identifier = None
+ _mandate_identifier = None
+ _eligible_whitelist_id = None
_request_reference_split_the_bill = None
+ _amount_responded_field_for_request = None
+ _status_field_for_request = None
+ _address_shipping_field_for_request = None
+ _address_billing_field_for_request = None
+
+ def __init__(self, status=None, amount_responded=None, address_shipping=None, address_billing=None):
+ """
+ :param status: The responding status of the RequestResponse. Can be ACCEPTED
+ or REJECTED.
+ :type status: str
+ :param amount_responded: The Amount the user decides to pay.
+ :type amount_responded: object_.Amount
+ :param address_shipping: The shipping Address to return to the user who
+ created the RequestInquiry. Should only be provided if 'require_address' is
+ set to SHIPPING, BILLING_SHIPPING or OPTIONAL.
+ :type address_shipping: object_.Address
+ :param address_billing: The billing Address to return to the user who
+ created the RequestInquiry. Should only be provided if 'require_address' is
+ set to BILLING, BILLING_SHIPPING or OPTIONAL.
+ :type address_billing: object_.Address
+ """
+
+ self._status_field_for_request = status
+ self._amount_responded_field_for_request = amount_responded
+ self._address_shipping_field_for_request = address_shipping
+ self._address_billing_field_for_request = address_billing
@classmethod
- def get(cls, tab_result_response_id, monetary_account_id=None, custom_headers=None):
+ def update(cls, request_response_id, monetary_account_id=None, amount_responded=None, status=None,
+ address_shipping=None, address_billing=None, custom_headers=None):
"""
- Used to view a single TabResultResponse belonging to a tab.
+ Update the status to accept or reject the RequestResponse.
- :type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type tab_result_response_id: int
+ :type request_response_id: int
+ :param amount_responded: The Amount the user decides to pay.
+ :type amount_responded: object_.Amount
+ :param status: The responding status of the RequestResponse. Can be
+ ACCEPTED or REJECTED.
+ :type status: str
+ :param address_shipping: The shipping Address to return to the user who
+ created the RequestInquiry. Should only be provided if 'require_address'
+ is set to SHIPPING, BILLING_SHIPPING or OPTIONAL.
+ :type address_shipping: object_.Address
+ :param address_billing: The billing Address to return to the user who
+ created the RequestInquiry. Should only be provided if 'require_address'
+ is set to BILLING, BILLING_SHIPPING or OPTIONAL.
+ :type address_billing: object_.Address
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseTabResultResponse
+ :rtype: BunqResponseRequestResponse
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- tab_result_response_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseTabResultResponse.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ request_map = {
+ cls.FIELD_AMOUNT_RESPONDED: amount_responded,
+ cls.FIELD_STATUS: status,
+ cls.FIELD_ADDRESS_SHIPPING: address_shipping,
+ cls.FIELD_ADDRESS_BILLING: address_billing
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ request_response_id)
+ response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseRequestResponse.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_PUT)
)
@classmethod
def list(cls, monetary_account_id=None, params=None, custom_headers=None):
"""
- Used to view a list of TabResultResponse objects belonging to a tab.
+ Get all RequestResponses for a MonetaryAccount.
:type user_id: int
:type monetary_account_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseTabResultResponseList
+ :rtype: BunqResponseRequestResponseList
"""
if params is None:
@@ -14091,96 +14601,36 @@ def list(cls, monetary_account_id=None, params=None, custom_headers=None):
cls._determine_monetary_account_id(monetary_account_id))
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseTabResultResponseList.cast_from_bunq_response(
+ return BunqResponseRequestResponseList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
- @property
- def tab(self):
- """
- :rtype: Tab
- """
-
- return self._tab
-
- @property
- def payment(self):
- """
- :rtype: Payment
- """
-
- return self._payment
-
- @property
- def request_reference_split_the_bill(self):
- """
- :rtype: list[object_.RequestInquiryReference]
- """
-
- return self._request_reference_split_the_bill
-
- def is_all_field_none(self):
- """
- :rtype: bool
- """
-
- if self._tab is not None:
- return False
-
- if self._payment is not None:
- return False
-
- if self._request_reference_split_the_bill is not None:
- return False
-
- return True
-
- @staticmethod
- def from_json(json_str):
+ @classmethod
+ def get(cls, request_response_id, monetary_account_id=None, custom_headers=None):
"""
- :type json_str: str
+ Get the details for a specific existing RequestResponse.
- :rtype: TabResultResponse
+ :type api_context: ApiContext
+ :type user_id: int
+ :type monetary_account_id: int
+ :type request_response_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseRequestResponse
"""
- return converter.json_to_class(TabResultResponse, json_str)
-
+ if custom_headers is None:
+ custom_headers = {}
-class WhitelistResult(BunqModel):
- """
- Whitelist an SDD so that when one comes in, it is automatically accepted.
-
- :param _id_: The ID of the whitelist entry.
- :type _id_: int
- :param _monetary_account_paying_id: The account from which payments will be
- deducted when a transaction is matched with this whitelist.
- :type _monetary_account_paying_id: int
- :param _status: The status of the WhitelistResult.
- :type _status: str
- :param _sub_status: The subStatus of the WhitelistResult.
- :type _sub_status: str
- :param _error_message: The message when the whitelist result has failed due
- to user error.
- :type _error_message: list[object_.Error]
- :param _whitelist: The corresponding whitelist.
- :type _whitelist: Whitelist
- :param _object_: The details of the external object the event was created
- for.
- :type _object_: object_.WhitelistResultViewAnchoredObject
- :param _request_reference_split_the_bill: The reference to the object used
- for split the bill. Can be RequestInquiry or RequestInquiryBatch
- :type _request_reference_split_the_bill:
- list[object_.RequestInquiryReference]
- """
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ request_response_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
- _id_ = None
- _monetary_account_paying_id = None
- _status = None
- _sub_status = None
- _error_message = None
- _whitelist = None
- _object_ = None
- _request_reference_split_the_bill = None
+ return BunqResponseRequestResponse.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
@property
def id_(self):
@@ -14191,197 +14641,100 @@ def id_(self):
return self._id_
@property
- def monetary_account_paying_id(self):
+ def created(self):
"""
- :rtype: int
+ :rtype: str
"""
- return self._monetary_account_paying_id
+ return self._created
@property
- def status(self):
+ def updated(self):
"""
:rtype: str
"""
- return self._status
+ return self._updated
@property
- def sub_status(self):
+ def time_responded(self):
"""
:rtype: str
"""
- return self._sub_status
+ return self._time_responded
@property
- def error_message(self):
+ def time_expiry(self):
"""
- :rtype: list[object_.Error]
+ :rtype: str
"""
- return self._error_message
+ return self._time_expiry
@property
- def whitelist(self):
+ def time_refund_requested(self):
"""
- :rtype: Whitelist
+ :rtype: str
"""
- return self._whitelist
+ return self._time_refund_requested
@property
- def object_(self):
+ def time_refunded(self):
"""
- :rtype: object_.WhitelistResultViewAnchoredObject
+ :rtype: str
"""
- return self._object_
+ return self._time_refunded
@property
- def request_reference_split_the_bill(self):
+ def user_refund_requested(self):
"""
- :rtype: list[object_.RequestInquiryReference]
+ :rtype: object_.LabelUser
"""
- return self._request_reference_split_the_bill
+ return self._user_refund_requested
- def is_all_field_none(self):
+ @property
+ def monetary_account_id(self):
"""
- :rtype: bool
+ :rtype: int
"""
- if self._id_ is not None:
- return False
-
- if self._monetary_account_paying_id is not None:
- return False
-
- if self._status is not None:
- return False
-
- if self._sub_status is not None:
- return False
-
- if self._error_message is not None:
- return False
-
- if self._whitelist is not None:
- return False
-
- if self._object_ is not None:
- return False
-
- if self._request_reference_split_the_bill is not None:
- return False
-
- return True
+ return self._monetary_account_id
- @staticmethod
- def from_json(json_str):
+ @property
+ def amount_inquired(self):
"""
- :type json_str: str
-
- :rtype: WhitelistResult
+ :rtype: object_.Amount
"""
- return converter.json_to_class(WhitelistResult, json_str)
-
-
-class Whitelist(BunqModel):
- """
- Whitelist a Request so that when one comes in, it is automatically accepted.
- """
+ return self._amount_inquired
- def is_all_field_none(self):
+ @property
+ def amount_responded(self):
"""
- :rtype: bool
+ :rtype: object_.Amount
"""
- return True
+ return self._amount_responded
- @staticmethod
- def from_json(json_str):
+ @property
+ def status(self):
"""
- :type json_str: str
-
- :rtype: Whitelist
+ :rtype: str
"""
- return converter.json_to_class(Whitelist, json_str)
-
-
-class TransferwiseTransfer(BunqModel):
- """
- Used to create Transferwise payments.
-
- :param _monetary_account_id: The id of the monetary account the payment
- should be made from.
- :type _monetary_account_id: str
- :param _recipient_id: The id of the target account.
- :type _recipient_id: str
- :param _alias: The LabelMonetaryAccount containing the public information of
- 'this' (party) side of the Payment.
- :type _alias: object_.MonetaryAccountReference
- :param _counterparty_alias: The LabelMonetaryAccount containing the public
- information of the other (counterparty) side of the Payment.
- :type _counterparty_alias: object_.MonetaryAccountReference
- :param _status: The status.
- :type _status: str
- :param _sub_status: The subStatus.
- :type _sub_status: str
- :param _status_transferwise: The status as Transferwise reports it.
- :type _status_transferwise: str
- :param _status_transferwise_issue: A status to indicatie if Transferwise has
- an issue with this payment and requires more information.
- :type _status_transferwise_issue: str
- :param _amount_source: The source amount.
- :type _amount_source: object_.Amount
- :param _amount_target: The target amount.
- :type _amount_target: object_.Amount
- :param _rate: The rate of the payment.
- :type _rate: str
- :param _reference: The reference of the payment.
- :type _reference: str
- :param _pay_in_reference: The Pay-In reference of the payment.
- :type _pay_in_reference: str
- :param _time_delivery_estimate: The estimated delivery time.
- :type _time_delivery_estimate: str
- :param _quote: The quote details used to created the payment.
- :type _quote: TransferwiseQuote
- """
-
- # Field constants.
- FIELD_MONETARY_ACCOUNT_ID = "monetary_account_id"
- FIELD_RECIPIENT_ID = "recipient_id"
-
- _alias = None
- _counterparty_alias = None
- _status = None
- _sub_status = None
- _status_transferwise = None
- _status_transferwise_issue = None
- _amount_source = None
- _amount_target = None
- _rate = None
- _reference = None
- _pay_in_reference = None
- _time_delivery_estimate = None
- _quote = None
- _monetary_account_id_field_for_request = None
- _recipient_id_field_for_request = None
+ return self._status
- def __init__(self, monetary_account_id, recipient_id):
+ @property
+ def description(self):
"""
- :param monetary_account_id: The id of the monetary account the payment
- should be made from.
- :type monetary_account_id: str
- :param recipient_id: The id of the target account.
- :type recipient_id: str
+ :rtype: str
"""
- self._monetary_account_id_field_for_request = monetary_account_id
- self._recipient_id_field_for_request = recipient_id
+ return self._description
@property
def alias(self):
@@ -14400,334 +14753,196 @@ def counterparty_alias(self):
return self._counterparty_alias
@property
- def status(self):
+ def attachment(self):
"""
- :rtype: str
+ :rtype: list[object_.Attachment]
"""
- return self._status
+ return self._attachment
@property
- def sub_status(self):
+ def minimum_age(self):
"""
- :rtype: str
+ :rtype: int
"""
- return self._sub_status
+ return self._minimum_age
@property
- def status_transferwise(self):
+ def require_address(self):
"""
:rtype: str
"""
- return self._status_transferwise
+ return self._require_address
@property
- def status_transferwise_issue(self):
+ def geolocation(self):
"""
- :rtype: str
+ :rtype: object_.Geolocation
"""
- return self._status_transferwise_issue
+ return self._geolocation
@property
- def amount_source(self):
+ def type_(self):
"""
- :rtype: object_.Amount
+ :rtype: str
"""
- return self._amount_source
+ return self._type_
@property
- def amount_target(self):
+ def sub_type(self):
"""
- :rtype: object_.Amount
+ :rtype: str
"""
- return self._amount_target
+ return self._sub_type
@property
- def rate(self):
+ def redirect_url(self):
"""
:rtype: str
"""
- return self._rate
+ return self._redirect_url
@property
- def reference(self):
+ def address_billing(self):
"""
- :rtype: str
+ :rtype: object_.Address
"""
- return self._reference
+ return self._address_billing
@property
- def pay_in_reference(self):
+ def address_shipping(self):
+ """
+ :rtype: object_.Address
+ """
+
+ return self._address_shipping
+
+ @property
+ def credit_scheme_identifier(self):
"""
:rtype: str
"""
- return self._pay_in_reference
+ return self._credit_scheme_identifier
@property
- def time_delivery_estimate(self):
+ def mandate_identifier(self):
"""
:rtype: str
"""
- return self._time_delivery_estimate
+ return self._mandate_identifier
@property
- def quote(self):
+ def eligible_whitelist_id(self):
"""
- :rtype: TransferwiseQuote
+ :rtype: int
"""
- return self._quote
+ return self._eligible_whitelist_id
+
+ @property
+ def request_reference_split_the_bill(self):
+ """
+ :rtype: list[object_.RequestInquiryReference]
+ """
+
+ return self._request_reference_split_the_bill
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._alias is not None:
+ if self._id_ is not None:
return False
- if self._counterparty_alias is not None:
+ if self._created is not None:
return False
- if self._status is not None:
+ if self._updated is not None:
return False
- if self._sub_status is not None:
+ if self._time_responded is not None:
return False
- if self._status_transferwise is not None:
+ if self._time_expiry is not None:
return False
- if self._status_transferwise_issue is not None:
+ if self._time_refund_requested is not None:
return False
- if self._amount_source is not None:
+ if self._time_refunded is not None:
return False
- if self._amount_target is not None:
+ if self._user_refund_requested is not None:
return False
- if self._rate is not None:
+ if self._monetary_account_id is not None:
return False
- if self._reference is not None:
+ if self._amount_inquired is not None:
return False
- if self._pay_in_reference is not None:
+ if self._amount_responded is not None:
return False
- if self._time_delivery_estimate is not None:
+ if self._status is not None:
return False
- if self._quote is not None:
+ if self._description is not None:
return False
- return True
-
- @staticmethod
- def from_json(json_str):
- """
- :type json_str: str
-
- :rtype: TransferwiseTransfer
- """
-
- return converter.json_to_class(TransferwiseTransfer, json_str)
-
-
-class TransferwiseQuote(BunqModel):
- """
- Used to get quotes from Transferwise. These can be used to initiate
- payments.
-
- :param _currency_source: The source currency.
- :type _currency_source: str
- :param _currency_target: The target currency.
- :type _currency_target: str
- :param _amount_source: The source amount.
- :type _amount_source: object_.Amount
- :param _amount_target: The target amount.
- :type _amount_target: object_.Amount
- :param _id_: The id of the quote.
- :type _id_: int
- :param _created: The timestamp of the quote's creation.
- :type _created: str
- :param _updated: The timestamp of the quote's last update.
- :type _updated: str
- :param _time_expiry: The expiration timestamp of the quote.
- :type _time_expiry: str
- :param _quote_id: The quote id Transferwise needs.
- :type _quote_id: str
- :param _amount_fee: The fee amount.
- :type _amount_fee: object_.Amount
- :param _rate: The rate.
- :type _rate: str
- :param _time_delivery_estimate: The estimated delivery time.
- :type _time_delivery_estimate: str
- """
-
- # Field constants.
- FIELD_CURRENCY_SOURCE = "currency_source"
- FIELD_CURRENCY_TARGET = "currency_target"
- FIELD_AMOUNT_SOURCE = "amount_source"
- FIELD_AMOUNT_TARGET = "amount_target"
-
- _id_ = None
- _created = None
- _updated = None
- _time_expiry = None
- _quote_id = None
- _amount_source = None
- _amount_target = None
- _amount_fee = None
- _rate = None
- _time_delivery_estimate = None
- _currency_source_field_for_request = None
- _currency_target_field_for_request = None
- _amount_source_field_for_request = None
- _amount_target_field_for_request = None
-
- def __init__(self, currency_source, currency_target, amount_source=None, amount_target=None):
- """
- :param currency_source: The source currency.
- :type currency_source: str
- :param currency_target: The target currency.
- :type currency_target: str
- :param amount_source: The source amount. Required if target amount is left
- empty.
- :type amount_source: object_.Amount
- :param amount_target: The target amount. Required if source amount is left
- empty.
- :type amount_target: object_.Amount
- """
-
- self._currency_source_field_for_request = currency_source
- self._currency_target_field_for_request = currency_target
- self._amount_source_field_for_request = amount_source
- self._amount_target_field_for_request = amount_target
-
- @property
- def id_(self):
- """
- :rtype: int
- """
-
- return self._id_
-
- @property
- def created(self):
- """
- :rtype: str
- """
-
- return self._created
-
- @property
- def updated(self):
- """
- :rtype: str
- """
-
- return self._updated
-
- @property
- def time_expiry(self):
- """
- :rtype: str
- """
-
- return self._time_expiry
-
- @property
- def quote_id(self):
- """
- :rtype: str
- """
-
- return self._quote_id
-
- @property
- def amount_source(self):
- """
- :rtype: object_.Amount
- """
-
- return self._amount_source
-
- @property
- def amount_target(self):
- """
- :rtype: object_.Amount
- """
-
- return self._amount_target
-
- @property
- def amount_fee(self):
- """
- :rtype: object_.Amount
- """
-
- return self._amount_fee
-
- @property
- def rate(self):
- """
- :rtype: str
- """
+ if self._alias is not None:
+ return False
- return self._rate
+ if self._counterparty_alias is not None:
+ return False
- @property
- def time_delivery_estimate(self):
- """
- :rtype: str
- """
+ if self._attachment is not None:
+ return False
- return self._time_delivery_estimate
+ if self._minimum_age is not None:
+ return False
- def is_all_field_none(self):
- """
- :rtype: bool
- """
+ if self._require_address is not None:
+ return False
- if self._id_ is not None:
+ if self._geolocation is not None:
return False
- if self._created is not None:
+ if self._type_ is not None:
return False
- if self._updated is not None:
+ if self._sub_type is not None:
return False
- if self._time_expiry is not None:
+ if self._redirect_url is not None:
return False
- if self._quote_id is not None:
+ if self._address_billing is not None:
return False
- if self._amount_source is not None:
+ if self._address_shipping is not None:
return False
- if self._amount_target is not None:
+ if self._credit_scheme_identifier is not None:
return False
- if self._amount_fee is not None:
+ if self._mandate_identifier is not None:
return False
- if self._rate is not None:
+ if self._eligible_whitelist_id is not None:
return False
- if self._time_delivery_estimate is not None:
+ if self._request_reference_split_the_bill is not None:
return False
return True
@@ -14737,82 +14952,77 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: TransferwiseQuote
+ :rtype: RequestResponse
"""
- return converter.json_to_class(TransferwiseQuote, json_str)
+ return converter.json_to_class(RequestResponse, json_str)
-class RewardRecipient(BunqModel):
+class TabResultResponse(BunqModel):
"""
- Used to view Rewards.
+ Used to view TabResultResponse objects belonging to a tab. A
+ TabResultResponse is an object that holds details on a tab which has been
+ paid from the provided monetary account.
- :param _id_: The id of the reward.
- :type _id_: int
- :param _created: The time the reward was created.
- :type _created: str
- :param _updated: The time the reward was last updated.
- :type _updated: str
- :param _status: The status of the reward.
- :type _status: str
- :param _sub_status: The subStatus of the reward.
- :type _sub_status: str
- :param _type_: The type of the reward.
- :type _type_: str
- :param _counterparty_alias: The alias of the other user eligible for the
- reward award.
- :type _counterparty_alias: object_.LabelUser
- :param _amount_reward: The amount that will be/was awarded as reward for the
- reward.
- :type _amount_reward: object_.Amount
+ :param _tab: The Tab details.
+ :type _tab: Tab
+ :param _payment: The payment made for the Tab.
+ :type _payment: Payment
+ :param _request_reference_split_the_bill: The reference to the object used
+ for split the bill. Can be RequestInquiry or RequestInquiryBatch
+ :type _request_reference_split_the_bill:
+ list[object_.RequestInquiryReference]
"""
# Endpoint constants.
- _ENDPOINT_URL_READ = "user/{}/reward-recipient/{}"
- _ENDPOINT_URL_LISTING = "user/{}/reward-recipient"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/tab-result-response/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/tab-result-response"
# Object type.
- _OBJECT_TYPE_GET = "RewardRecipient"
+ _OBJECT_TYPE_GET = "TabResultResponse"
- _id_ = None
- _created = None
- _updated = None
- _status = None
- _sub_status = None
- _type_ = None
- _counterparty_alias = None
- _amount_reward = None
+ _tab = None
+ _payment = None
+ _request_reference_split_the_bill = None
@classmethod
- def get(cls, reward_recipient_id, custom_headers=None):
+ def get(cls, tab_result_response_id, monetary_account_id=None, custom_headers=None):
"""
+ Used to view a single TabResultResponse belonging to a tab.
+
:type api_context: ApiContext
:type user_id: int
- :type reward_recipient_id: int
+ :type monetary_account_id: int
+ :type tab_result_response_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseRewardRecipient
+ :rtype: BunqResponseTabResultResponse
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), reward_recipient_id)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ tab_result_response_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseRewardRecipient.cast_from_bunq_response(
+ return BunqResponseTabResultResponse.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def list(cls, params=None, custom_headers=None):
+ def list(cls, monetary_account_id=None, params=None, custom_headers=None):
"""
+ Used to view a list of TabResultResponse objects belonging to a tab.
+
:type user_id: int
+ :type monetary_account_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseRewardRecipientList
+ :rtype: BunqResponseTabResultResponseList
"""
if params is None:
@@ -14822,36 +15032,116 @@ def list(cls, params=None, custom_headers=None):
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id))
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseRewardRecipientList.cast_from_bunq_response(
+ return BunqResponseTabResultResponseList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@property
- def id_(self):
+ def tab(self):
"""
- :rtype: int
+ :rtype: Tab
"""
- return self._id_
+ return self._tab
@property
- def created(self):
+ def payment(self):
"""
- :rtype: str
+ :rtype: Payment
"""
- return self._created
+ return self._payment
@property
- def updated(self):
+ def request_reference_split_the_bill(self):
"""
- :rtype: str
+ :rtype: list[object_.RequestInquiryReference]
"""
- return self._updated
+ return self._request_reference_split_the_bill
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._tab is not None:
+ return False
+
+ if self._payment is not None:
+ return False
+
+ if self._request_reference_split_the_bill is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: TabResultResponse
+ """
+
+ return converter.json_to_class(TabResultResponse, json_str)
+
+
+class WhitelistResult(BunqModel):
+ """
+ Whitelist an SDD so that when one comes in, it is automatically accepted.
+
+ :param _id_: The ID of the whitelist entry.
+ :type _id_: int
+ :param _monetary_account_paying_id: The account from which payments will be
+ deducted when a transaction is matched with this whitelist.
+ :type _monetary_account_paying_id: int
+ :param _status: The status of the WhitelistResult.
+ :type _status: str
+ :param _sub_status: The subStatus of the WhitelistResult.
+ :type _sub_status: str
+ :param _error_message: The message when the whitelist result has failed due
+ to user error.
+ :type _error_message: list[object_.Error]
+ :param _whitelist: The corresponding whitelist.
+ :type _whitelist: Whitelist
+ :param _object_: The details of the external object the event was created
+ for.
+ :type _object_: object_.WhitelistResultViewAnchoredObject
+ :param _request_reference_split_the_bill: The reference to the object used
+ for split the bill. Can be RequestInquiry or RequestInquiryBatch
+ :type _request_reference_split_the_bill:
+ list[object_.RequestInquiryReference]
+ """
+
+ _id_ = None
+ _monetary_account_paying_id = None
+ _status = None
+ _sub_status = None
+ _error_message = None
+ _whitelist = None
+ _object_ = None
+ _request_reference_split_the_bill = None
+
+ @property
+ def id_(self):
+ """
+ :rtype: int
+ """
+
+ return self._id_
+
+ @property
+ def monetary_account_paying_id(self):
+ """
+ :rtype: int
+ """
+
+ return self._monetary_account_paying_id
@property
def status(self):
@@ -14870,28 +15160,36 @@ def sub_status(self):
return self._sub_status
@property
- def type_(self):
+ def error_message(self):
"""
- :rtype: str
+ :rtype: list[object_.Error]
"""
- return self._type_
+ return self._error_message
@property
- def counterparty_alias(self):
+ def whitelist(self):
"""
- :rtype: object_.LabelUser
+ :rtype: Whitelist
"""
- return self._counterparty_alias
+ return self._whitelist
@property
- def amount_reward(self):
+ def object_(self):
"""
- :rtype: object_.Amount
+ :rtype: object_.WhitelistResultViewAnchoredObject
"""
- return self._amount_reward
+ return self._object_
+
+ @property
+ def request_reference_split_the_bill(self):
+ """
+ :rtype: list[object_.RequestInquiryReference]
+ """
+
+ return self._request_reference_split_the_bill
def is_all_field_none(self):
"""
@@ -14901,10 +15199,7 @@ def is_all_field_none(self):
if self._id_ is not None:
return False
- if self._created is not None:
- return False
-
- if self._updated is not None:
+ if self._monetary_account_paying_id is not None:
return False
if self._status is not None:
@@ -14913,13 +15208,16 @@ def is_all_field_none(self):
if self._sub_status is not None:
return False
- if self._type_ is not None:
+ if self._error_message is not None:
return False
- if self._counterparty_alias is not None:
+ if self._whitelist is not None:
return False
- if self._amount_reward is not None:
+ if self._object_ is not None:
+ return False
+
+ if self._request_reference_split_the_bill is not None:
return False
return True
@@ -14929,82 +15227,182 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: RewardRecipient
+ :rtype: WhitelistResult
"""
- return converter.json_to_class(RewardRecipient, json_str)
+ return converter.json_to_class(WhitelistResult, json_str)
-class RewardSender(BunqModel):
+class Whitelist(BunqModel):
"""
- Used to view Rewards.
-
- :param _id_: The id of the reward.
- :type _id_: int
- :param _created: The time the reward was created.
- :type _created: str
- :param _updated: The time the reward was last updated.
- :type _updated: str
- :param _status: The status of the reward.
- :type _status: str
- :param _sub_status: The subStatus of the reward.
- :type _sub_status: str
- :param _type_: The type of the reward.
- :type _type_: str
- :param _counterparty_alias: The alias of the other user eligible for the
- reward award.
- :type _counterparty_alias: object_.LabelUser
- :param _amount_reward: The amount that will be/was awarded as reward for the
- reward.
- :type _amount_reward: object_.Amount
+ Whitelist a Request so that when one comes in, it is automatically accepted.
"""
- # Endpoint constants.
- _ENDPOINT_URL_READ = "user/{}/reward-sender/{}"
- _ENDPOINT_URL_LISTING = "user/{}/reward-sender"
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: Whitelist
+ """
+
+ return converter.json_to_class(Whitelist, json_str)
+
+
+class TransferwiseTransfer(BunqModel):
+ """
+ Used to create Transferwise payments.
+
+ :param _monetary_account_id: The id of the monetary account the payment
+ should be made from.
+ :type _monetary_account_id: str
+ :param _recipient_id: The id of the target account.
+ :type _recipient_id: str
+ :param _alias: The LabelMonetaryAccount containing the public information of
+ 'this' (party) side of the Payment.
+ :type _alias: object_.MonetaryAccountReference
+ :param _counterparty_alias: The LabelMonetaryAccount containing the public
+ information of the other (counterparty) side of the Payment.
+ :type _counterparty_alias: object_.MonetaryAccountReference
+ :param _status: The status.
+ :type _status: str
+ :param _sub_status: The subStatus.
+ :type _sub_status: str
+ :param _status_transferwise: The status as Transferwise reports it.
+ :type _status_transferwise: str
+ :param _status_transferwise_issue: A status to indicatie if Transferwise has
+ an issue with this payment and requires more information.
+ :type _status_transferwise_issue: str
+ :param _amount_source: The source amount.
+ :type _amount_source: object_.Amount
+ :param _amount_target: The target amount.
+ :type _amount_target: object_.Amount
+ :param _rate: The rate of the payment.
+ :type _rate: str
+ :param _reference: The reference of the payment.
+ :type _reference: str
+ :param _pay_in_reference: The Pay-In reference of the payment.
+ :type _pay_in_reference: str
+ :param _time_delivery_estimate: The estimated delivery time.
+ :type _time_delivery_estimate: str
+ :param _quote: The quote details used to created the payment.
+ :type _quote: TransferwiseQuote
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_CREATE = "user/{}/transferwise-quote/{}/transferwise-transfer"
+ _ENDPOINT_URL_READ = "user/{}/transferwise-quote/{}/transferwise-transfer/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/transferwise-quote/{}/transferwise-transfer"
+
+ # Field constants.
+ FIELD_MONETARY_ACCOUNT_ID = "monetary_account_id"
+ FIELD_RECIPIENT_ID = "recipient_id"
# Object type.
- _OBJECT_TYPE_GET = "RewardSender"
+ _OBJECT_TYPE_GET = "TransferwisePayment"
- _id_ = None
- _created = None
- _updated = None
+ _alias = None
+ _counterparty_alias = None
_status = None
_sub_status = None
- _type_ = None
- _counterparty_alias = None
- _amount_reward = None
+ _status_transferwise = None
+ _status_transferwise_issue = None
+ _amount_source = None
+ _amount_target = None
+ _rate = None
+ _reference = None
+ _pay_in_reference = None
+ _time_delivery_estimate = None
+ _quote = None
+ _monetary_account_id_field_for_request = None
+ _recipient_id_field_for_request = None
+
+ def __init__(self, monetary_account_id, recipient_id):
+ """
+ :param monetary_account_id: The id of the monetary account the payment
+ should be made from.
+ :type monetary_account_id: str
+ :param recipient_id: The id of the target account.
+ :type recipient_id: str
+ """
+
+ self._monetary_account_id_field_for_request = monetary_account_id
+ self._recipient_id_field_for_request = recipient_id
@classmethod
- def get(cls, reward_sender_id, custom_headers=None):
+ def create(cls, transferwise_quote_id, monetary_account_id, recipient_id, custom_headers=None):
+ """
+ :type user_id: int
+ :type transferwise_quote_id: int
+ :param monetary_account_id: The id of the monetary account the payment
+ should be made from.
+ :type monetary_account_id: str
+ :param recipient_id: The id of the target account.
+ :type recipient_id: str
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ request_map = {
+ cls.FIELD_MONETARY_ACCOUNT_ID: monetary_account_id,
+ cls.FIELD_RECIPIENT_ID: recipient_id
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ api_client = ApiClient(cls._get_api_context())
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(), transferwise_quote_id)
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
+
+ @classmethod
+ def get(cls, transferwise_quote_id, transferwise_transfer_id, custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
- :type reward_sender_id: int
+ :type transferwise_quote_id: int
+ :type transferwise_transfer_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseRewardSender
+ :rtype: BunqResponseTransferwiseTransfer
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), reward_sender_id)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), transferwise_quote_id,
+ transferwise_transfer_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseRewardSender.cast_from_bunq_response(
+ return BunqResponseTransferwiseTransfer.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def list(cls, params=None, custom_headers=None):
+ def list(cls, transferwise_quote_id, params=None, custom_headers=None):
"""
:type user_id: int
+ :type transferwise_quote_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseRewardSenderList
+ :rtype: BunqResponseTransferwiseTransferList
"""
if params is None:
@@ -15014,36 +15412,28 @@ def list(cls, params=None, custom_headers=None):
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(), transferwise_quote_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseRewardSenderList.cast_from_bunq_response(
+ return BunqResponseTransferwiseTransferList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@property
- def id_(self):
- """
- :rtype: int
- """
-
- return self._id_
-
- @property
- def created(self):
+ def alias(self):
"""
- :rtype: str
+ :rtype: object_.MonetaryAccountReference
"""
- return self._created
+ return self._alias
@property
- def updated(self):
+ def counterparty_alias(self):
"""
- :rtype: str
+ :rtype: object_.MonetaryAccountReference
"""
- return self._updated
+ return self._counterparty_alias
@property
def status(self):
@@ -15062,114 +15452,119 @@ def sub_status(self):
return self._sub_status
@property
- def type_(self):
+ def status_transferwise(self):
"""
:rtype: str
"""
- return self._type_
+ return self._status_transferwise
@property
- def counterparty_alias(self):
+ def status_transferwise_issue(self):
"""
- :rtype: object_.LabelUser
+ :rtype: str
"""
- return self._counterparty_alias
+ return self._status_transferwise_issue
@property
- def amount_reward(self):
+ def amount_source(self):
"""
:rtype: object_.Amount
"""
- return self._amount_reward
+ return self._amount_source
- def is_all_field_none(self):
+ @property
+ def amount_target(self):
"""
- :rtype: bool
+ :rtype: object_.Amount
"""
- if self._id_ is not None:
- return False
-
- if self._created is not None:
- return False
-
- if self._updated is not None:
- return False
-
- if self._status is not None:
- return False
-
- if self._sub_status is not None:
- return False
-
- if self._type_ is not None:
- return False
-
- if self._counterparty_alias is not None:
- return False
+ return self._amount_target
- if self._amount_reward is not None:
- return False
+ @property
+ def rate(self):
+ """
+ :rtype: str
+ """
- return True
+ return self._rate
- @staticmethod
- def from_json(json_str):
+ @property
+ def reference(self):
"""
- :type json_str: str
-
- :rtype: RewardSender
+ :rtype: str
"""
- return converter.json_to_class(RewardSender, json_str)
-
+ return self._reference
-class ShareInviteBankInquiryBatch(BunqModel):
- """
- Used to share a monetary account with another bunq user, as in the 'Connect'
- feature in the bunq app. Allow the creation of share inquiries that, in the
- same way as request inquiries, can be revoked by the user creating them or
- accepted/rejected by the other party.
-
- :param _share_invite_bank_inquiries: The list of share invite bank inquiries
- that were made.
- :type _share_invite_bank_inquiries: list[ShareInviteMonetaryAccountInquiry]
- :param _alias: The LabelMonetaryAccount containing the public information of
- this share invite inquiry batch.
- :type _alias: object_.MonetaryAccountReference
- """
+ @property
+ def pay_in_reference(self):
+ """
+ :rtype: str
+ """
- _share_invite_bank_inquiries = None
- _alias = None
+ return self._pay_in_reference
@property
- def share_invite_bank_inquiries(self):
+ def time_delivery_estimate(self):
"""
- :rtype: list[ShareInviteMonetaryAccountInquiry]
+ :rtype: str
"""
- return self._share_invite_bank_inquiries
+ return self._time_delivery_estimate
@property
- def alias(self):
+ def quote(self):
"""
- :rtype: object_.MonetaryAccountReference
+ :rtype: TransferwiseQuote
"""
- return self._alias
+ return self._quote
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._share_invite_bank_inquiries is not None:
+ if self._alias is not None:
return False
- if self._alias is not None:
+ if self._counterparty_alias is not None:
+ return False
+
+ if self._status is not None:
+ return False
+
+ if self._sub_status is not None:
+ return False
+
+ if self._status_transferwise is not None:
+ return False
+
+ if self._status_transferwise_issue is not None:
+ return False
+
+ if self._amount_source is not None:
+ return False
+
+ if self._amount_target is not None:
+ return False
+
+ if self._rate is not None:
+ return False
+
+ if self._reference is not None:
+ return False
+
+ if self._pay_in_reference is not None:
+ return False
+
+ if self._time_delivery_estimate is not None:
+ return False
+
+ if self._quote is not None:
return False
return True
@@ -15179,151 +15574,104 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: ShareInviteBankInquiryBatch
+ :rtype: TransferwiseTransfer
"""
- return converter.json_to_class(ShareInviteBankInquiryBatch, json_str)
+ return converter.json_to_class(TransferwiseTransfer, json_str)
-class ShareInviteMonetaryAccountInquiry(BunqModel):
+class TransferwiseQuote(BunqModel):
"""
- [DEPRECATED - use /share-invite-monetary-account-response] Used to share a
- monetary account with another bunq user, as in the 'Connect' feature in the
- bunq app. Allow the creation of share inquiries that, in the same way as
- request inquiries, can be revoked by the user creating them or
- accepted/rejected by the other party.
+ Used to get quotes from Transferwise. These can be used to initiate
+ payments.
- :param _counter_user_alias: The label of the user to share with.
- :type _counter_user_alias: object_.LabelUser
- :param _draft_share_invite_bank_id: The id of the draft share invite bank.
- :type _draft_share_invite_bank_id: int
- :param _share_detail: The share details. Only one of these objects is
- returned.
- :type _share_detail: object_.ShareDetail
- :param _status: The status of the share. Can be PENDING, REVOKED (the user
- deletes the share inquiry before it's accepted), ACCEPTED, CANCELLED (the
- user deletes an active share) or CANCELLATION_PENDING,
- CANCELLATION_ACCEPTED, CANCELLATION_REJECTED (for canceling mutual connects)
- :type _status: str
- :param _share_type: The share type, either STANDARD or MUTUAL.
- :type _share_type: str
- :param _start_date: The start date of this share.
- :type _start_date: str
- :param _end_date: The expiration date of this share.
- :type _end_date: str
- :param _alias: The label of the monetary account that's being shared.
- :type _alias: object_.MonetaryAccountReference
- :param _user_alias_created: The user who created the share.
- :type _user_alias_created: object_.LabelUser
- :param _user_alias_revoked: The user who revoked the share.
- :type _user_alias_revoked: object_.LabelUser
- :param _monetary_account_id: The id of the monetary account the share
- applies to.
- :type _monetary_account_id: int
- :param _id_: The id of the newly created share invite.
+ :param _currency_source: The source currency.
+ :type _currency_source: str
+ :param _currency_target: The target currency.
+ :type _currency_target: str
+ :param _amount_source: The source amount.
+ :type _amount_source: object_.Amount
+ :param _amount_target: The target amount.
+ :type _amount_target: object_.Amount
+ :param _id_: The id of the quote.
:type _id_: int
+ :param _created: The timestamp of the quote's creation.
+ :type _created: str
+ :param _updated: The timestamp of the quote's last update.
+ :type _updated: str
+ :param _time_expiry: The expiration timestamp of the quote.
+ :type _time_expiry: str
+ :param _quote_id: The quote id Transferwise needs.
+ :type _quote_id: str
+ :param _amount_fee: The fee amount.
+ :type _amount_fee: object_.Amount
+ :param _rate: The rate.
+ :type _rate: str
+ :param _time_delivery_estimate: The estimated delivery time.
+ :type _time_delivery_estimate: str
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/share-invite-monetary-account-inquiry"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/share-invite-monetary-account-inquiry/{}"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/share-invite-monetary-account-inquiry/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/share-invite-monetary-account-inquiry"
+ _ENDPOINT_URL_CREATE = "user/{}/transferwise-quote"
+ _ENDPOINT_URL_READ = "user/{}/transferwise-quote/{}"
# Field constants.
- FIELD_COUNTER_USER_ALIAS = "counter_user_alias"
- FIELD_DRAFT_SHARE_INVITE_BANK_ID = "draft_share_invite_bank_id"
- FIELD_SHARE_DETAIL = "share_detail"
- FIELD_STATUS = "status"
- FIELD_SHARE_TYPE = "share_type"
- FIELD_START_DATE = "start_date"
- FIELD_END_DATE = "end_date"
+ FIELD_CURRENCY_SOURCE = "currency_source"
+ FIELD_CURRENCY_TARGET = "currency_target"
+ FIELD_AMOUNT_SOURCE = "amount_source"
+ FIELD_AMOUNT_TARGET = "amount_target"
# Object type.
- _OBJECT_TYPE_GET = "ShareInviteMonetaryAccountInquiry"
+ _OBJECT_TYPE_GET = "TransferwiseQuote"
- _alias = None
- _user_alias_created = None
- _user_alias_revoked = None
- _counter_user_alias = None
- _monetary_account_id = None
- _draft_share_invite_bank_id = None
- _share_detail = None
- _status = None
- _share_type = None
- _start_date = None
- _end_date = None
_id_ = None
- _counter_user_alias_field_for_request = None
- _draft_share_invite_bank_id_field_for_request = None
- _share_detail_field_for_request = None
- _status_field_for_request = None
- _share_type_field_for_request = None
- _start_date_field_for_request = None
- _end_date_field_for_request = None
+ _created = None
+ _updated = None
+ _time_expiry = None
+ _quote_id = None
+ _amount_source = None
+ _amount_target = None
+ _amount_fee = None
+ _rate = None
+ _time_delivery_estimate = None
+ _currency_source_field_for_request = None
+ _currency_target_field_for_request = None
+ _amount_source_field_for_request = None
+ _amount_target_field_for_request = None
- def __init__(self, counter_user_alias, share_detail=None, status=None, draft_share_invite_bank_id=None,
- share_type=None, start_date=None, end_date=None):
+ def __init__(self, currency_source, currency_target, amount_source=None, amount_target=None):
"""
- :param counter_user_alias: The pointer of the user to share with.
- :type counter_user_alias: object_.Pointer
- :param share_detail: The share details. Only one of these objects may be
- passed.
- :type share_detail: object_.ShareDetail
- :param status: The status of the share. Can be PENDING, REVOKED (the user
- deletes the share inquiry before it's accepted), ACCEPTED, CANCELLED (the
- user deletes an active share) or CANCELLATION_PENDING,
- CANCELLATION_ACCEPTED, CANCELLATION_REJECTED (for canceling mutual
- connects).
- :type status: str
- :param draft_share_invite_bank_id: The id of the draft share invite bank.
- :type draft_share_invite_bank_id: int
- :param share_type: The share type, either STANDARD or MUTUAL.
- :type share_type: str
- :param start_date: The start date of this share.
- :type start_date: str
- :param end_date: The expiration date of this share.
- :type end_date: str
+ :param currency_source: The source currency.
+ :type currency_source: str
+ :param currency_target: The target currency.
+ :type currency_target: str
+ :param amount_source: The source amount. Required if target amount is left
+ empty.
+ :type amount_source: object_.Amount
+ :param amount_target: The target amount. Required if source amount is left
+ empty.
+ :type amount_target: object_.Amount
"""
- self._counter_user_alias_field_for_request = counter_user_alias
- self._share_detail_field_for_request = share_detail
- self._status_field_for_request = status
- self._draft_share_invite_bank_id_field_for_request = draft_share_invite_bank_id
- self._share_type_field_for_request = share_type
- self._start_date_field_for_request = start_date
- self._end_date_field_for_request = end_date
+ self._currency_source_field_for_request = currency_source
+ self._currency_target_field_for_request = currency_target
+ self._amount_source_field_for_request = amount_source
+ self._amount_target_field_for_request = amount_target
@classmethod
- def create(cls, counter_user_alias, share_detail, status, monetary_account_id=None, draft_share_invite_bank_id=None,
- share_type=None, start_date=None, end_date=None, custom_headers=None):
+ def create(cls, currency_source, currency_target, amount_source=None, amount_target=None, custom_headers=None):
"""
- [DEPRECATED - use /share-invite-monetary-account-response] Create a new
- share inquiry for a monetary account, specifying the permission the
- other bunq user will have on it.
-
:type user_id: int
- :type monetary_account_id: int
- :param counter_user_alias: The pointer of the user to share with.
- :type counter_user_alias: object_.Pointer
- :param share_detail: The share details. Only one of these objects may be
- passed.
- :type share_detail: object_.ShareDetail
- :param status: The status of the share. Can be PENDING, REVOKED (the
- user deletes the share inquiry before it's accepted), ACCEPTED,
- CANCELLED (the user deletes an active share) or CANCELLATION_PENDING,
- CANCELLATION_ACCEPTED, CANCELLATION_REJECTED (for canceling mutual
- connects).
- :type status: str
- :param draft_share_invite_bank_id: The id of the draft share invite
- bank.
- :type draft_share_invite_bank_id: int
- :param share_type: The share type, either STANDARD or MUTUAL.
- :type share_type: str
- :param start_date: The start date of this share.
- :type start_date: str
- :param end_date: The expiration date of this share.
- :type end_date: str
+ :param currency_source: The source currency.
+ :type currency_source: str
+ :param currency_target: The target currency.
+ :type currency_target: str
+ :param amount_source: The source amount. Required if target amount is
+ left empty.
+ :type amount_source: object_.Amount
+ :param amount_target: The target amount. Required if source amount is
+ left empty.
+ :type amount_target: object_.Amount
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -15333,21 +15681,17 @@ def create(cls, counter_user_alias, share_detail, status, monetary_account_id=No
custom_headers = {}
request_map = {
- cls.FIELD_COUNTER_USER_ALIAS: counter_user_alias,
- cls.FIELD_DRAFT_SHARE_INVITE_BANK_ID: draft_share_invite_bank_id,
- cls.FIELD_SHARE_DETAIL: share_detail,
- cls.FIELD_STATUS: status,
- cls.FIELD_SHARE_TYPE: share_type,
- cls.FIELD_START_DATE: start_date,
- cls.FIELD_END_DATE: end_date
+ cls.FIELD_CURRENCY_SOURCE: currency_source,
+ cls.FIELD_CURRENCY_TARGET: currency_target,
+ cls.FIELD_AMOUNT_SOURCE: amount_source,
+ cls.FIELD_AMOUNT_TARGET: amount_target
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
api_client = ApiClient(cls._get_api_context())
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -15355,252 +15699,140 @@ def create(cls, counter_user_alias, share_detail, status, monetary_account_id=No
)
@classmethod
- def get(cls, share_invite_monetary_account_inquiry_id, monetary_account_id=None, custom_headers=None):
+ def get(cls, transferwise_quote_id, custom_headers=None):
"""
- [DEPRECATED - use /share-invite-monetary-account-response] Get the
- details of a specific share inquiry.
-
:type api_context: ApiContext
:type user_id: int
- :type monetary_account_id: int
- :type share_invite_monetary_account_inquiry_id: int
+ :type transferwise_quote_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseShareInviteMonetaryAccountInquiry
+ :rtype: BunqResponseTransferwiseQuote
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- share_invite_monetary_account_inquiry_id)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), transferwise_quote_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseShareInviteMonetaryAccountInquiry.cast_from_bunq_response(
+ return BunqResponseTransferwiseQuote.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
- @classmethod
- def update(cls, share_invite_monetary_account_inquiry_id, monetary_account_id=None, share_detail=None, status=None,
- start_date=None, end_date=None, custom_headers=None):
+ @property
+ def id_(self):
"""
- [DEPRECATED - use /share-invite-monetary-account-response] Update the
- details of a share. This includes updating status (revoking or
- cancelling it), granted permission and validity period of this share.
-
- :type user_id: int
- :type monetary_account_id: int
- :type share_invite_monetary_account_inquiry_id: int
- :param share_detail: The share details. Only one of these objects may be
- passed.
- :type share_detail: object_.ShareDetail
- :param status: The status of the share. Can be PENDING, REVOKED (the
- user deletes the share inquiry before it's accepted), ACCEPTED,
- CANCELLED (the user deletes an active share) or CANCELLATION_PENDING,
- CANCELLATION_ACCEPTED, CANCELLATION_REJECTED (for canceling mutual
- connects).
- :type status: str
- :param start_date: The start date of this share.
- :type start_date: str
- :param end_date: The expiration date of this share.
- :type end_date: str
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseInt
- """
-
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
-
- request_map = {
- cls.FIELD_SHARE_DETAIL: share_detail,
- cls.FIELD_STATUS: status,
- cls.FIELD_START_DATE: start_date,
- cls.FIELD_END_DATE: end_date
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
-
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- share_invite_monetary_account_inquiry_id)
- response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
-
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
- )
-
- @classmethod
- def list(cls, monetary_account_id=None, params=None, custom_headers=None):
- """
- [DEPRECATED - use /share-invite-monetary-account-response] Get a list
- with all the share inquiries for a monetary account, only if the
- requesting user has permission to change the details of the various
- ones.
-
- :type user_id: int
- :type monetary_account_id: int
- :type params: dict[str, str]|None
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseShareInviteMonetaryAccountInquiryList
- """
-
- if params is None:
- params = {}
-
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
- response_raw = api_client.get(endpoint_url, params, custom_headers)
-
- return BunqResponseShareInviteMonetaryAccountInquiryList.cast_from_bunq_response(
- cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
- )
-
- @property
- def alias(self):
- """
- :rtype: object_.MonetaryAccountReference
- """
-
- return self._alias
-
- @property
- def user_alias_created(self):
- """
- :rtype: object_.LabelUser
+ :rtype: int
"""
- return self._user_alias_created
+ return self._id_
@property
- def user_alias_revoked(self):
+ def created(self):
"""
- :rtype: object_.LabelUser
+ :rtype: str
"""
- return self._user_alias_revoked
+ return self._created
@property
- def counter_user_alias(self):
+ def updated(self):
"""
- :rtype: object_.LabelUser
+ :rtype: str
"""
- return self._counter_user_alias
+ return self._updated
@property
- def monetary_account_id(self):
+ def time_expiry(self):
"""
- :rtype: int
+ :rtype: str
"""
- return self._monetary_account_id
+ return self._time_expiry
@property
- def draft_share_invite_bank_id(self):
+ def quote_id(self):
"""
- :rtype: int
+ :rtype: str
"""
- return self._draft_share_invite_bank_id
+ return self._quote_id
@property
- def share_detail(self):
+ def amount_source(self):
"""
- :rtype: object_.ShareDetail
+ :rtype: object_.Amount
"""
- return self._share_detail
+ return self._amount_source
@property
- def status(self):
+ def amount_target(self):
"""
- :rtype: str
+ :rtype: object_.Amount
"""
- return self._status
+ return self._amount_target
@property
- def share_type(self):
+ def amount_fee(self):
"""
- :rtype: str
+ :rtype: object_.Amount
"""
- return self._share_type
+ return self._amount_fee
@property
- def start_date(self):
+ def rate(self):
"""
:rtype: str
"""
- return self._start_date
+ return self._rate
@property
- def end_date(self):
+ def time_delivery_estimate(self):
"""
:rtype: str
"""
- return self._end_date
-
- @property
- def id_(self):
- """
- :rtype: int
- """
-
- return self._id_
+ return self._time_delivery_estimate
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._alias is not None:
- return False
-
- if self._user_alias_created is not None:
- return False
-
- if self._user_alias_revoked is not None:
+ if self._id_ is not None:
return False
- if self._counter_user_alias is not None:
+ if self._created is not None:
return False
- if self._monetary_account_id is not None:
+ if self._updated is not None:
return False
- if self._draft_share_invite_bank_id is not None:
+ if self._time_expiry is not None:
return False
- if self._share_detail is not None:
+ if self._quote_id is not None:
return False
- if self._status is not None:
+ if self._amount_source is not None:
return False
- if self._share_type is not None:
+ if self._amount_target is not None:
return False
- if self._start_date is not None:
+ if self._amount_fee is not None:
return False
- if self._end_date is not None:
+ if self._rate is not None:
return False
- if self._id_ is not None:
+ if self._time_delivery_estimate is not None:
return False
return True
@@ -15610,175 +15842,82 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: ShareInviteMonetaryAccountInquiry
+ :rtype: TransferwiseQuote
"""
- return converter.json_to_class(ShareInviteMonetaryAccountInquiry, json_str)
+ return converter.json_to_class(TransferwiseQuote, json_str)
-class ShareInviteMonetaryAccountResponse(BunqModel):
+class RewardRecipient(BunqModel):
"""
- Used to view or respond to shares a user was invited to. See
- 'share-invite-bank-inquiry' for more information about the inquiring
- endpoint.
+ Used to view Rewards.
- :param _status: The status of the share. Can be PENDING, REVOKED (the user
- deletes the share inquiry before it's accepted), ACCEPTED, CANCELLED (the
- user deletes an active share) or CANCELLATION_PENDING,
- CANCELLATION_ACCEPTED, CANCELLATION_REJECTED (for canceling mutual connects)
- :type _status: str
- :param _card_id: The card to link to the shared monetary account. Used only
- if share_detail is ShareDetailCardPayment.
- :type _card_id: int
- :param _id_: The id of the ShareInviteBankResponse.
+ :param _id_: The id of the reward.
:type _id_: int
- :param _created: The timestamp of the ShareInviteBankResponse creation.
+ :param _created: The time the reward was created.
:type _created: str
- :param _updated: The timestamp of the ShareInviteBankResponse last update.
+ :param _updated: The time the reward was last updated.
:type _updated: str
- :param _counter_alias: The monetary account and user who created the share.
- :type _counter_alias: object_.MonetaryAccountReference
- :param _user_alias_cancelled: The user who cancelled the share if it has
- been revoked or rejected.
- :type _user_alias_cancelled: object_.LabelUser
- :param _monetary_account_id: The id of the monetary account the ACCEPTED
- share applies to. null otherwise.
- :type _monetary_account_id: int
- :param _draft_share_invite_bank_id: The id of the draft share invite bank.
- :type _draft_share_invite_bank_id: int
- :param _share_detail: The share details.
- :type _share_detail: object_.ShareDetail
- :param _share_type: The share type, either STANDARD or MUTUAL.
- :type _share_type: str
- :param _start_date: The start date of this share.
- :type _start_date: str
- :param _end_date: The expiration date of this share.
- :type _end_date: str
- :param _description: The description of this share. It is basically the
- monetary account description.
- :type _description: str
+ :param _status: The status of the reward.
+ :type _status: str
+ :param _sub_status: The subStatus of the reward.
+ :type _sub_status: str
+ :param _type_: The type of the reward.
+ :type _type_: str
+ :param _counterparty_alias: The alias of the other user eligible for the
+ reward award.
+ :type _counterparty_alias: object_.LabelUser
+ :param _amount_reward: The amount that will be/was awarded as reward for the
+ reward.
+ :type _amount_reward: object_.Amount
"""
# Endpoint constants.
- _ENDPOINT_URL_READ = "user/{}/share-invite-monetary-account-response/{}"
- _ENDPOINT_URL_UPDATE = "user/{}/share-invite-monetary-account-response/{}"
- _ENDPOINT_URL_LISTING = "user/{}/share-invite-monetary-account-response"
-
- # Field constants.
- FIELD_STATUS = "status"
- FIELD_CARD_ID = "card_id"
+ _ENDPOINT_URL_READ = "user/{}/reward-recipient/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/reward-recipient"
# Object type.
- _OBJECT_TYPE_GET = "ShareInviteMonetaryAccountResponse"
+ _OBJECT_TYPE_GET = "RewardRecipient"
_id_ = None
_created = None
_updated = None
- _counter_alias = None
- _user_alias_cancelled = None
- _monetary_account_id = None
- _draft_share_invite_bank_id = None
- _share_detail = None
_status = None
- _share_type = None
- _start_date = None
- _end_date = None
- _description = None
- _status_field_for_request = None
- _card_id_field_for_request = None
-
- def __init__(self, status=None, card_id=None):
- """
- :param status: The status of the share. Can be PENDING, REVOKED (the user
- deletes the share inquiry before it's accepted), ACCEPTED, CANCELLED (the
- user deletes an active share) or CANCELLATION_PENDING,
- CANCELLATION_ACCEPTED, CANCELLATION_REJECTED (for canceling mutual connects)
- :type status: str
- :param card_id: The card to link to the shared monetary account. Used only
- if share_detail is ShareDetailCardPayment.
- :type card_id: int
- """
-
- self._status_field_for_request = status
- self._card_id_field_for_request = card_id
+ _sub_status = None
+ _type_ = None
+ _counterparty_alias = None
+ _amount_reward = None
@classmethod
- def get(cls, share_invite_monetary_account_response_id, custom_headers=None):
+ def get(cls, reward_recipient_id, custom_headers=None):
"""
- Return the details of a specific share a user was invited to.
-
:type api_context: ApiContext
:type user_id: int
- :type share_invite_monetary_account_response_id: int
+ :type reward_recipient_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseShareInviteMonetaryAccountResponse
+ :rtype: BunqResponseRewardRecipient
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
- share_invite_monetary_account_response_id)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), reward_recipient_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseShareInviteMonetaryAccountResponse.cast_from_bunq_response(
+ return BunqResponseRewardRecipient.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
- @classmethod
- def update(cls, share_invite_monetary_account_response_id, status=None, card_id=None, custom_headers=None):
- """
- Accept or reject a share a user was invited to.
-
- :type user_id: int
- :type share_invite_monetary_account_response_id: int
- :param status: The status of the share. Can be PENDING, REVOKED (the
- user deletes the share inquiry before it's accepted), ACCEPTED,
- CANCELLED (the user deletes an active share) or CANCELLATION_PENDING,
- CANCELLATION_ACCEPTED, CANCELLATION_REJECTED (for canceling mutual
- connects)
- :type status: str
- :param card_id: The card to link to the shared monetary account. Used
- only if share_detail is ShareDetailCardPayment.
- :type card_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseInt
- """
-
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
-
- request_map = {
- cls.FIELD_STATUS: status,
- cls.FIELD_CARD_ID: card_id
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
-
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
- share_invite_monetary_account_response_id)
- response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
-
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
- )
-
@classmethod
def list(cls, params=None, custom_headers=None):
"""
- Return all the shares a user was invited to.
-
:type user_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseShareInviteMonetaryAccountResponseList
+ :rtype: BunqResponseRewardRecipientList
"""
if params is None:
@@ -15791,7 +15930,7 @@ def list(cls, params=None, custom_headers=None):
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseShareInviteMonetaryAccountResponseList.cast_from_bunq_response(
+ return BunqResponseRewardRecipientList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -15819,46 +15958,6 @@ def updated(self):
return self._updated
- @property
- def counter_alias(self):
- """
- :rtype: object_.MonetaryAccountReference
- """
-
- return self._counter_alias
-
- @property
- def user_alias_cancelled(self):
- """
- :rtype: object_.LabelUser
- """
-
- return self._user_alias_cancelled
-
- @property
- def monetary_account_id(self):
- """
- :rtype: int
- """
-
- return self._monetary_account_id
-
- @property
- def draft_share_invite_bank_id(self):
- """
- :rtype: int
- """
-
- return self._draft_share_invite_bank_id
-
- @property
- def share_detail(self):
- """
- :rtype: object_.ShareDetail
- """
-
- return self._share_detail
-
@property
def status(self):
"""
@@ -15868,36 +15967,36 @@ def status(self):
return self._status
@property
- def share_type(self):
+ def sub_status(self):
"""
:rtype: str
"""
- return self._share_type
+ return self._sub_status
@property
- def start_date(self):
+ def type_(self):
"""
:rtype: str
"""
- return self._start_date
+ return self._type_
@property
- def end_date(self):
+ def counterparty_alias(self):
"""
- :rtype: str
+ :rtype: object_.LabelUser
"""
- return self._end_date
+ return self._counterparty_alias
@property
- def description(self):
+ def amount_reward(self):
"""
- :rtype: str
+ :rtype: object_.Amount
"""
- return self._description
+ return self._amount_reward
def is_all_field_none(self):
"""
@@ -15913,34 +16012,19 @@ def is_all_field_none(self):
if self._updated is not None:
return False
- if self._counter_alias is not None:
- return False
-
- if self._user_alias_cancelled is not None:
- return False
-
- if self._monetary_account_id is not None:
- return False
-
- if self._draft_share_invite_bank_id is not None:
- return False
-
- if self._share_detail is not None:
- return False
-
if self._status is not None:
return False
- if self._share_type is not None:
+ if self._sub_status is not None:
return False
- if self._start_date is not None:
+ if self._type_ is not None:
return False
- if self._end_date is not None:
+ if self._counterparty_alias is not None:
return False
- if self._description is not None:
+ if self._amount_reward is not None:
return False
return True
@@ -15950,111 +16034,82 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: ShareInviteMonetaryAccountResponse
+ :rtype: RewardRecipient
"""
- return converter.json_to_class(ShareInviteMonetaryAccountResponse, json_str)
+ return converter.json_to_class(RewardRecipient, json_str)
-class SofortMerchantTransaction(BunqModel):
+class RewardSender(BunqModel):
"""
- View for requesting Sofort transactions and polling their status.
+ Used to view Rewards.
- :param _amount_requested: The requested amount of money to add.
- :type _amount_requested: object_.Amount
- :param _issuer: The BIC of the issuer.
- :type _issuer: str
- :param _monetary_account_id: The id of the monetary account this sofort
- merchant transaction links to.
- :type _monetary_account_id: int
- :param _alias: The alias of the monetary account to add money to.
- :type _alias: object_.MonetaryAccountReference
- :param _counterparty_alias: The alias of the monetary account the money
- comes from.
- :type _counterparty_alias: object_.MonetaryAccountReference
- :param _amount_guaranteed: In case of a successful transaction, the amount
- of money that will be transferred.
- :type _amount_guaranteed: object_.Amount
- :param _issuer_authentication_url: The URL to visit to
- :type _issuer_authentication_url: str
- :param _status: The status of the transaction.
+ :param _id_: The id of the reward.
+ :type _id_: int
+ :param _created: The time the reward was created.
+ :type _created: str
+ :param _updated: The time the reward was last updated.
+ :type _updated: str
+ :param _status: The status of the reward.
:type _status: str
- :param _error_message: The error message of the transaction.
- :type _error_message: list[object_.Error]
- :param _transaction_identifier: The 'transaction ID' of the Sofort
- transaction.
- :type _transaction_identifier: str
+ :param _sub_status: The subStatus of the reward.
+ :type _sub_status: str
+ :param _type_: The type of the reward.
+ :type _type_: str
+ :param _counterparty_alias: The alias of the other user eligible for the
+ reward award.
+ :type _counterparty_alias: object_.LabelUser
+ :param _amount_reward: The amount that will be/was awarded as reward for the
+ reward.
+ :type _amount_reward: object_.Amount
"""
# Endpoint constants.
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/sofort-merchant-transaction"
-
- # Field constants.
- FIELD_AMOUNT_REQUESTED = "amount_requested"
- FIELD_ISSUER = "issuer"
+ _ENDPOINT_URL_READ = "user/{}/reward-sender/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/reward-sender"
# Object type.
- _OBJECT_TYPE_GET = "SofortMerchantTransaction"
+ _OBJECT_TYPE_GET = "RewardSender"
- _monetary_account_id = None
- _alias = None
- _counterparty_alias = None
- _amount_guaranteed = None
- _amount_requested = None
- _issuer = None
- _issuer_authentication_url = None
+ _id_ = None
+ _created = None
+ _updated = None
_status = None
- _error_message = None
- _transaction_identifier = None
- _amount_requested_field_for_request = None
- _issuer_field_for_request = None
-
- def __init__(self, amount_requested, issuer=None):
- """
- :param amount_requested: The requested amount of money to add.
- :type amount_requested: object_.Amount
- :param issuer: The BIC of the issuing bank to ask for money.
- :type issuer: str
- """
-
- self._amount_requested_field_for_request = amount_requested
- self._issuer_field_for_request = issuer
+ _sub_status = None
+ _type_ = None
+ _counterparty_alias = None
+ _amount_reward = None
@classmethod
- def get(cls, sofort_merchant_transaction_id, monetary_account_id=None, custom_headers=None):
+ def get(cls, reward_sender_id, custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
- :type monetary_account_id: int
- :type sofort_merchant_transaction_id: int
+ :type reward_sender_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseSofortMerchantTransaction
+ :rtype: BunqResponseRewardSender
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- sofort_merchant_transaction_id)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), reward_sender_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseSofortMerchantTransaction.cast_from_bunq_response(
+ return BunqResponseRewardSender.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def list(cls, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, params=None, custom_headers=None):
"""
:type user_id: int
- :type monetary_account_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseSofortMerchantTransactionList
+ :rtype: BunqResponseRewardSenderList
"""
if params is None:
@@ -16064,127 +16119,104 @@ def list(cls, monetary_account_id=None, params=None, custom_headers=None):
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseSofortMerchantTransactionList.cast_from_bunq_response(
+ return BunqResponseRewardSenderList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@property
- def monetary_account_id(self):
+ def id_(self):
"""
:rtype: int
"""
- return self._monetary_account_id
-
- @property
- def alias(self):
- """
- :rtype: object_.MonetaryAccountReference
- """
-
- return self._alias
-
- @property
- def counterparty_alias(self):
- """
- :rtype: object_.MonetaryAccountReference
- """
-
- return self._counterparty_alias
+ return self._id_
@property
- def amount_guaranteed(self):
+ def created(self):
"""
- :rtype: object_.Amount
+ :rtype: str
"""
- return self._amount_guaranteed
+ return self._created
@property
- def amount_requested(self):
+ def updated(self):
"""
- :rtype: object_.Amount
+ :rtype: str
"""
- return self._amount_requested
+ return self._updated
@property
- def issuer(self):
+ def status(self):
"""
:rtype: str
"""
- return self._issuer
+ return self._status
@property
- def issuer_authentication_url(self):
+ def sub_status(self):
"""
:rtype: str
"""
- return self._issuer_authentication_url
+ return self._sub_status
@property
- def status(self):
+ def type_(self):
"""
:rtype: str
"""
- return self._status
+ return self._type_
@property
- def error_message(self):
+ def counterparty_alias(self):
"""
- :rtype: list[object_.Error]
+ :rtype: object_.LabelUser
"""
- return self._error_message
+ return self._counterparty_alias
@property
- def transaction_identifier(self):
+ def amount_reward(self):
"""
- :rtype: str
+ :rtype: object_.Amount
"""
- return self._transaction_identifier
+ return self._amount_reward
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._monetary_account_id is not None:
- return False
-
- if self._alias is not None:
- return False
-
- if self._counterparty_alias is not None:
+ if self._id_ is not None:
return False
- if self._amount_guaranteed is not None:
+ if self._created is not None:
return False
- if self._amount_requested is not None:
+ if self._updated is not None:
return False
- if self._issuer is not None:
+ if self._status is not None:
return False
- if self._issuer_authentication_url is not None:
+ if self._sub_status is not None:
return False
- if self._status is not None:
+ if self._type_ is not None:
return False
- if self._error_message is not None:
+ if self._counterparty_alias is not None:
return False
- if self._transaction_identifier is not None:
+ if self._amount_reward is not None:
return False
return True
@@ -16194,119 +16226,55 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: SofortMerchantTransaction
+ :rtype: RewardSender
"""
- return converter.json_to_class(SofortMerchantTransaction, json_str)
+ return converter.json_to_class(RewardSender, json_str)
-class TabResultInquiry(BunqModel):
+class ShareInviteBankInquiryBatch(BunqModel):
"""
- Used to view TabResultInquiry objects belonging to a tab. A TabResultInquiry
- is an object that holds details on both the tab and a single payment made
- for that tab.
+ Used to share a monetary account with another bunq user, as in the 'Connect'
+ feature in the bunq app. Allow the creation of share inquiries that, in the
+ same way as request inquiries, can be revoked by the user creating them or
+ accepted/rejected by the other party.
- :param _tab: The Tab details.
- :type _tab: Tab
- :param _payment: The payment made for the Tab.
- :type _payment: Payment
+ :param _share_invite_bank_inquiries: The list of share invite bank inquiries
+ that were made.
+ :type _share_invite_bank_inquiries: list[ShareInviteMonetaryAccountInquiry]
+ :param _alias: The LabelMonetaryAccount containing the public information of
+ this share invite inquiry batch.
+ :type _alias: object_.MonetaryAccountReference
"""
- # Endpoint constants.
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/cash-register/{}/tab/{}/tab-result-inquiry/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/cash-register/{}/tab/{}/tab-result-inquiry"
-
- # Object type.
- _OBJECT_TYPE_GET = "TabResultInquiry"
-
- _tab = None
- _payment = None
-
- @classmethod
- def get(cls, cash_register_id, tab_uuid, tab_result_inquiry_id, monetary_account_id=None, custom_headers=None):
- """
- Used to view a single TabResultInquiry belonging to a tab.
-
- :type api_context: ApiContext
- :type user_id: int
- :type monetary_account_id: int
- :type cash_register_id: int
- :type tab_uuid: str
- :type tab_result_inquiry_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseTabResultInquiry
- """
-
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- cash_register_id, tab_uuid, tab_result_inquiry_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
-
- return BunqResponseTabResultInquiry.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
- )
-
- @classmethod
- def list(cls, cash_register_id, tab_uuid, monetary_account_id=None, params=None, custom_headers=None):
- """
- Used to view a list of TabResultInquiry objects belonging to a tab.
-
- :type user_id: int
- :type monetary_account_id: int
- :type cash_register_id: int
- :type tab_uuid: str
- :type params: dict[str, str]|None
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseTabResultInquiryList
- """
-
- if params is None:
- params = {}
-
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- cash_register_id, tab_uuid)
- response_raw = api_client.get(endpoint_url, params, custom_headers)
-
- return BunqResponseTabResultInquiryList.cast_from_bunq_response(
- cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
- )
+ _share_invite_bank_inquiries = None
+ _alias = None
@property
- def tab(self):
+ def share_invite_bank_inquiries(self):
"""
- :rtype: Tab
+ :rtype: list[ShareInviteMonetaryAccountInquiry]
"""
- return self._tab
+ return self._share_invite_bank_inquiries
@property
- def payment(self):
+ def alias(self):
"""
- :rtype: Payment
+ :rtype: object_.MonetaryAccountReference
"""
- return self._payment
+ return self._alias
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._tab is not None:
+ if self._share_invite_bank_inquiries is not None:
return False
- if self._payment is not None:
+ if self._alias is not None:
return False
return True
@@ -16316,120 +16284,164 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: TabResultInquiry
- """
-
- return converter.json_to_class(TabResultInquiry, json_str)
-
-
-class ExportAnnualOverviewContent(BunqModel):
- """
- Fetch the raw content of an annual overview. The annual overview is always
- in PDF format. Doc won't display the response of a request to get the
- content of an annual overview.
- """
-
- # Endpoint constants.
- _ENDPOINT_URL_LISTING = "user/{}/export-annual-overview/{}/content"
-
- # Object type.
- _OBJECT_TYPE_GET = "ExportAnnualOverviewContent"
-
- @classmethod
- def list(cls, export_annual_overview_id, custom_headers=None):
- """
- Used to retrieve the raw content of an annual overview.
-
- :type user_id: int
- :type export_annual_overview_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseBytes
- """
-
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(), export_annual_overview_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
-
- return BunqResponseBytes.cast_from_bunq_response(
- BunqResponse(response_raw.body_bytes, response_raw.headers)
- )
-
- def is_all_field_none(self):
- """
- :rtype: bool
- """
-
- return True
-
- @staticmethod
- def from_json(json_str):
- """
- :type json_str: str
-
- :rtype: ExportAnnualOverviewContent
+ :rtype: ShareInviteBankInquiryBatch
"""
- return converter.json_to_class(ExportAnnualOverviewContent, json_str)
+ return converter.json_to_class(ShareInviteBankInquiryBatch, json_str)
-class ExportAnnualOverview(BunqModel):
+class ShareInviteMonetaryAccountInquiry(BunqModel):
"""
- Used to create new and read existing annual overviews of all the user's
- monetary accounts. Once created, annual overviews can be downloaded in PDF
- format via the 'export-annual-overview/{id}/content' endpoint.
+ [DEPRECATED - use /share-invite-monetary-account-response] Used to share a
+ monetary account with another bunq user, as in the 'Connect' feature in the
+ bunq app. Allow the creation of share inquiries that, in the same way as
+ request inquiries, can be revoked by the user creating them or
+ accepted/rejected by the other party.
- :param _year: The year for which the overview is.
- :type _year: int
- :param _id_: The id of the annual overview as created on the server.
+ :param _counter_user_alias: The label of the user to share with.
+ :type _counter_user_alias: object_.LabelUser
+ :param _draft_share_invite_bank_id: The id of the draft share invite bank.
+ :type _draft_share_invite_bank_id: int
+ :param _share_detail: The share details. Only one of these objects is
+ returned.
+ :type _share_detail: object_.ShareDetail
+ :param _status: The status of the share. Can be PENDING, REVOKED (the user
+ deletes the share inquiry before it's accepted), ACCEPTED, CANCELLED (the
+ user deletes an active share) or CANCELLATION_PENDING,
+ CANCELLATION_ACCEPTED, CANCELLATION_REJECTED (for canceling mutual connects)
+ :type _status: str
+ :param _relationship: The relationship: COMPANY_DIRECTOR, COMPANY_EMPLOYEE,
+ etc
+ :type _relationship: str
+ :param _share_type: The share type, either STANDARD or MUTUAL.
+ :type _share_type: str
+ :param _start_date: The start date of this share.
+ :type _start_date: str
+ :param _end_date: The expiration date of this share.
+ :type _end_date: str
+ :param _alias: The label of the monetary account that's being shared.
+ :type _alias: object_.MonetaryAccountReference
+ :param _user_alias_created: The user who created the share.
+ :type _user_alias_created: object_.LabelUser
+ :param _user_alias_revoked: The user who revoked the share.
+ :type _user_alias_revoked: object_.LabelUser
+ :param _monetary_account_id: The id of the monetary account the share
+ applies to.
+ :type _monetary_account_id: int
+ :param _id_: The id of the newly created share invite.
:type _id_: int
- :param _created: The timestamp of the annual overview 's creation.
- :type _created: str
- :param _updated: The timestamp of the annual overview 's last update.
- :type _updated: str
- :param _alias_user: The user to which this annual overview belongs.
- :type _alias_user: object_.LabelUser
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/export-annual-overview"
- _ENDPOINT_URL_READ = "user/{}/export-annual-overview/{}"
- _ENDPOINT_URL_DELETE = "user/{}/export-annual-overview/{}"
- _ENDPOINT_URL_LISTING = "user/{}/export-annual-overview"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/share-invite-monetary-account-inquiry"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/share-invite-monetary-account-inquiry/{}"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/share-invite-monetary-account-inquiry/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/share-invite-monetary-account-inquiry"
# Field constants.
- FIELD_YEAR = "year"
+ FIELD_COUNTER_USER_ALIAS = "counter_user_alias"
+ FIELD_DRAFT_SHARE_INVITE_BANK_ID = "draft_share_invite_bank_id"
+ FIELD_SHARE_DETAIL = "share_detail"
+ FIELD_STATUS = "status"
+ FIELD_RELATIONSHIP = "relationship"
+ FIELD_SHARE_TYPE = "share_type"
+ FIELD_START_DATE = "start_date"
+ FIELD_END_DATE = "end_date"
# Object type.
- _OBJECT_TYPE_GET = "ExportAnnualOverview"
+ _OBJECT_TYPE_GET = "ShareInviteMonetaryAccountInquiry"
+ _alias = None
+ _user_alias_created = None
+ _user_alias_revoked = None
+ _counter_user_alias = None
+ _monetary_account_id = None
+ _draft_share_invite_bank_id = None
+ _share_detail = None
+ _status = None
+ _relationship = None
+ _share_type = None
+ _start_date = None
+ _end_date = None
_id_ = None
- _created = None
- _updated = None
- _year = None
- _alias_user = None
- _year_field_for_request = None
+ _counter_user_alias_field_for_request = None
+ _draft_share_invite_bank_id_field_for_request = None
+ _share_detail_field_for_request = None
+ _status_field_for_request = None
+ _relationship_field_for_request = None
+ _share_type_field_for_request = None
+ _start_date_field_for_request = None
+ _end_date_field_for_request = None
- def __init__(self, year):
+ def __init__(self, counter_user_alias, share_detail=None, status=None, draft_share_invite_bank_id=None,
+ relationship=None, share_type=None, start_date=None, end_date=None):
"""
- :param year: The year for which the overview is.
- :type year: int
+ :param counter_user_alias: The pointer of the user to share with.
+ :type counter_user_alias: object_.Pointer
+ :param share_detail: The share details. Only one of these objects may be
+ passed.
+ :type share_detail: object_.ShareDetail
+ :param status: The status of the share. Can be PENDING, REVOKED (the user
+ deletes the share inquiry before it's accepted), ACCEPTED, CANCELLED (the
+ user deletes an active share) or CANCELLATION_PENDING,
+ CANCELLATION_ACCEPTED, CANCELLATION_REJECTED (for canceling mutual
+ connects).
+ :type status: str
+ :param draft_share_invite_bank_id: The id of the draft share invite bank.
+ :type draft_share_invite_bank_id: int
+ :param relationship: The relationship: COMPANY_DIRECTOR, COMPANY_EMPLOYEE,
+ etc
+ :type relationship: str
+ :param share_type: The share type, either STANDARD or MUTUAL.
+ :type share_type: str
+ :param start_date: The start date of this share.
+ :type start_date: str
+ :param end_date: The expiration date of this share.
+ :type end_date: str
"""
- self._year_field_for_request = year
+ self._counter_user_alias_field_for_request = counter_user_alias
+ self._share_detail_field_for_request = share_detail
+ self._status_field_for_request = status
+ self._draft_share_invite_bank_id_field_for_request = draft_share_invite_bank_id
+ self._relationship_field_for_request = relationship
+ self._share_type_field_for_request = share_type
+ self._start_date_field_for_request = start_date
+ self._end_date_field_for_request = end_date
@classmethod
- def create(cls, year, custom_headers=None):
+ def create(cls, counter_user_alias, share_detail, status, monetary_account_id=None, draft_share_invite_bank_id=None,
+ relationship=None, share_type=None, start_date=None, end_date=None, custom_headers=None):
"""
- Create a new annual overview for a specific year. An overview can be
- generated only for a past year.
+ [DEPRECATED - use /share-invite-monetary-account-response] Create a new
+ share inquiry for a monetary account, specifying the permission the
+ other bunq user will have on it.
:type user_id: int
- :param year: The year for which the overview is.
- :type year: int
+ :type monetary_account_id: int
+ :param counter_user_alias: The pointer of the user to share with.
+ :type counter_user_alias: object_.Pointer
+ :param share_detail: The share details. Only one of these objects may be
+ passed.
+ :type share_detail: object_.ShareDetail
+ :param status: The status of the share. Can be PENDING, REVOKED (the
+ user deletes the share inquiry before it's accepted), ACCEPTED,
+ CANCELLED (the user deletes an active share) or CANCELLATION_PENDING,
+ CANCELLATION_ACCEPTED, CANCELLATION_REJECTED (for canceling mutual
+ connects).
+ :type status: str
+ :param draft_share_invite_bank_id: The id of the draft share invite
+ bank.
+ :type draft_share_invite_bank_id: int
+ :param relationship: The relationship: COMPANY_DIRECTOR,
+ COMPANY_EMPLOYEE, etc
+ :type relationship: str
+ :param share_type: The share type, either STANDARD or MUTUAL.
+ :type share_type: str
+ :param start_date: The start date of this share.
+ :type start_date: str
+ :param end_date: The expiration date of this share.
+ :type end_date: str
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -16439,14 +16451,22 @@ def create(cls, year, custom_headers=None):
custom_headers = {}
request_map = {
- cls.FIELD_YEAR: year
+ cls.FIELD_COUNTER_USER_ALIAS: counter_user_alias,
+ cls.FIELD_DRAFT_SHARE_INVITE_BANK_ID: draft_share_invite_bank_id,
+ cls.FIELD_SHARE_DETAIL: share_detail,
+ cls.FIELD_STATUS: status,
+ cls.FIELD_RELATIONSHIP: relationship,
+ cls.FIELD_SHARE_TYPE: share_type,
+ cls.FIELD_START_DATE: start_date,
+ cls.FIELD_END_DATE: end_date
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
api_client = ApiClient(cls._get_api_context())
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id))
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -16454,60 +16474,100 @@ def create(cls, year, custom_headers=None):
)
@classmethod
- def get(cls, export_annual_overview_id, custom_headers=None):
+ def get(cls, share_invite_monetary_account_inquiry_id, monetary_account_id=None, custom_headers=None):
"""
- Get an annual overview for a user by its id.
+ [DEPRECATED - use /share-invite-monetary-account-response] Get the
+ details of a specific share inquiry.
:type api_context: ApiContext
:type user_id: int
- :type export_annual_overview_id: int
+ :type monetary_account_id: int
+ :type share_invite_monetary_account_inquiry_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseExportAnnualOverview
+ :rtype: BunqResponseShareInviteMonetaryAccountInquiry
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), export_annual_overview_id)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ share_invite_monetary_account_inquiry_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseExportAnnualOverview.cast_from_bunq_response(
+ return BunqResponseShareInviteMonetaryAccountInquiry.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def delete(cls, export_annual_overview_id, custom_headers=None):
+ def update(cls, share_invite_monetary_account_inquiry_id, monetary_account_id=None, share_detail=None, status=None,
+ start_date=None, end_date=None, custom_headers=None):
"""
+ [DEPRECATED - use /share-invite-monetary-account-response] Update the
+ details of a share. This includes updating status (revoking or
+ cancelling it), granted permission and validity period of this share.
+
:type user_id: int
- :type export_annual_overview_id: int
+ :type monetary_account_id: int
+ :type share_invite_monetary_account_inquiry_id: int
+ :param share_detail: The share details. Only one of these objects may be
+ passed.
+ :type share_detail: object_.ShareDetail
+ :param status: The status of the share. Can be PENDING, REVOKED (the
+ user deletes the share inquiry before it's accepted), ACCEPTED,
+ CANCELLED (the user deletes an active share) or CANCELLATION_PENDING,
+ CANCELLATION_ACCEPTED, CANCELLATION_REJECTED (for canceling mutual
+ connects).
+ :type status: str
+ :param start_date: The start date of this share.
+ :type start_date: str
+ :param end_date: The expiration date of this share.
+ :type end_date: str
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNone
+ :rtype: BunqResponseInt
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(), export_annual_overview_id)
- response_raw = api_client.delete(endpoint_url, custom_headers)
- return BunqResponseNone.cast_from_bunq_response(
- BunqResponse(None, response_raw.headers)
+ request_map = {
+ cls.FIELD_SHARE_DETAIL: share_detail,
+ cls.FIELD_STATUS: status,
+ cls.FIELD_START_DATE: start_date,
+ cls.FIELD_END_DATE: end_date
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ share_invite_monetary_account_inquiry_id)
+ response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
)
@classmethod
- def list(cls, params=None, custom_headers=None):
+ def list(cls, monetary_account_id=None, params=None, custom_headers=None):
"""
- List all the annual overviews for a user.
+ [DEPRECATED - use /share-invite-monetary-account-response] Get a list
+ with all the share inquiries for a monetary account, only if the
+ requesting user has permission to change the details of the various
+ ones.
:type user_id: int
+ :type monetary_account_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseExportAnnualOverviewList
+ :rtype: BunqResponseShareInviteMonetaryAccountInquiryList
"""
if params is None:
@@ -16517,128 +16577,162 @@ def list(cls, params=None, custom_headers=None):
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id))
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseExportAnnualOverviewList.cast_from_bunq_response(
+ return BunqResponseShareInviteMonetaryAccountInquiryList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@property
- def id_(self):
+ def alias(self):
"""
- :rtype: int
+ :rtype: object_.MonetaryAccountReference
"""
- return self._id_
+ return self._alias
@property
- def created(self):
+ def user_alias_created(self):
"""
- :rtype: str
+ :rtype: object_.LabelUser
"""
- return self._created
+ return self._user_alias_created
@property
- def updated(self):
+ def user_alias_revoked(self):
"""
- :rtype: str
+ :rtype: object_.LabelUser
"""
- return self._updated
+ return self._user_alias_revoked
@property
- def year(self):
+ def counter_user_alias(self):
"""
- :rtype: int
+ :rtype: object_.LabelUser
"""
- return self._year
+ return self._counter_user_alias
@property
- def alias_user(self):
+ def monetary_account_id(self):
"""
- :rtype: object_.LabelUser
+ :rtype: int
"""
- return self._alias_user
+ return self._monetary_account_id
- def is_all_field_none(self):
+ @property
+ def draft_share_invite_bank_id(self):
"""
- :rtype: bool
+ :rtype: int
"""
- if self._id_ is not None:
- return False
-
- if self._created is not None:
- return False
+ return self._draft_share_invite_bank_id
- if self._updated is not None:
- return False
+ @property
+ def share_detail(self):
+ """
+ :rtype: object_.ShareDetail
+ """
- if self._year is not None:
- return False
+ return self._share_detail
- if self._alias_user is not None:
- return False
+ @property
+ def status(self):
+ """
+ :rtype: str
+ """
- return True
+ return self._status
- @staticmethod
- def from_json(json_str):
+ @property
+ def relationship(self):
"""
- :type json_str: str
-
- :rtype: ExportAnnualOverview
+ :rtype: str
"""
- return converter.json_to_class(ExportAnnualOverview, json_str)
+ return self._relationship
+ @property
+ def share_type(self):
+ """
+ :rtype: str
+ """
-class ExportRibContent(BunqModel):
- """
- Fetch the raw content of an RIB. The RIB is always in PDF format.
- """
+ return self._share_type
- # Endpoint constants.
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/export-rib/{}/content"
+ @property
+ def start_date(self):
+ """
+ :rtype: str
+ """
- # Object type.
- _OBJECT_TYPE_GET = "ExportRibContent"
+ return self._start_date
- @classmethod
- def list(cls, export_rib_id, monetary_account_id=None, custom_headers=None):
+ @property
+ def end_date(self):
"""
- Used to retrieve the raw content of an RIB.
-
- :type user_id: int
- :type monetary_account_id: int
- :type export_rib_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseBytes
+ :rtype: str
"""
- if custom_headers is None:
- custom_headers = {}
+ return self._end_date
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- export_rib_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
+ @property
+ def id_(self):
+ """
+ :rtype: int
+ """
- return BunqResponseBytes.cast_from_bunq_response(
- BunqResponse(response_raw.body_bytes, response_raw.headers)
- )
+ return self._id_
def is_all_field_none(self):
"""
:rtype: bool
"""
+ if self._alias is not None:
+ return False
+
+ if self._user_alias_created is not None:
+ return False
+
+ if self._user_alias_revoked is not None:
+ return False
+
+ if self._counter_user_alias is not None:
+ return False
+
+ if self._monetary_account_id is not None:
+ return False
+
+ if self._draft_share_invite_bank_id is not None:
+ return False
+
+ if self._share_detail is not None:
+ return False
+
+ if self._status is not None:
+ return False
+
+ if self._relationship is not None:
+ return False
+
+ if self._share_type is not None:
+ return False
+
+ if self._start_date is not None:
+ return False
+
+ if self._end_date is not None:
+ return False
+
+ if self._id_ is not None:
+ return False
+
return True
@staticmethod
@@ -16646,80 +16740,112 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: ExportRibContent
+ :rtype: ShareInviteMonetaryAccountInquiry
"""
- return converter.json_to_class(ExportRibContent, json_str)
+ return converter.json_to_class(ShareInviteMonetaryAccountInquiry, json_str)
-class ExportRib(BunqModel):
+class ShareInviteMonetaryAccountResponse(BunqModel):
"""
- Used to create new and read existing RIBs of a monetary account
+ Used to view or respond to shares a user was invited to. See
+ 'share-invite-bank-inquiry' for more information about the inquiring
+ endpoint.
- :param _id_: The id of the rib as created on the server.
+ :param _status: The status of the share. Can be PENDING, REVOKED (the user
+ deletes the share inquiry before it's accepted), ACCEPTED, CANCELLED (the
+ user deletes an active share) or CANCELLATION_PENDING,
+ CANCELLATION_ACCEPTED, CANCELLATION_REJECTED (for canceling mutual connects)
+ :type _status: str
+ :param _card_id: The card to link to the shared monetary account. Used only
+ if share_detail is ShareDetailCardPayment.
+ :type _card_id: int
+ :param _id_: The id of the ShareInviteBankResponse.
:type _id_: int
- :param _created: The timestamp of the RIB's creation.
+ :param _created: The timestamp of the ShareInviteBankResponse creation.
:type _created: str
- :param _updated: The timestamp of the RIB's last update.
+ :param _updated: The timestamp of the ShareInviteBankResponse last update.
:type _updated: str
+ :param _counter_alias: The monetary account and user who created the share.
+ :type _counter_alias: object_.MonetaryAccountReference
+ :param _user_alias_cancelled: The user who cancelled the share if it has
+ been revoked or rejected.
+ :type _user_alias_cancelled: object_.LabelUser
+ :param _monetary_account_id: The id of the monetary account the ACCEPTED
+ share applies to. null otherwise.
+ :type _monetary_account_id: int
+ :param _draft_share_invite_bank_id: The id of the draft share invite bank.
+ :type _draft_share_invite_bank_id: int
+ :param _share_detail: The share details.
+ :type _share_detail: object_.ShareDetail
+ :param _relation_user: All of the relation users towards this MA.
+ :type _relation_user: RelationUser
+ :param _share_type: The share type, either STANDARD or MUTUAL.
+ :type _share_type: str
+ :param _start_date: The start date of this share.
+ :type _start_date: str
+ :param _end_date: The expiration date of this share.
+ :type _end_date: str
+ :param _description: The description of this share. It is basically the
+ monetary account description.
+ :type _description: str
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/export-rib"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/export-rib/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/export-rib/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/export-rib"
+ _ENDPOINT_URL_READ = "user/{}/share-invite-monetary-account-response/{}"
+ _ENDPOINT_URL_UPDATE = "user/{}/share-invite-monetary-account-response/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/share-invite-monetary-account-response"
+
+ # Field constants.
+ FIELD_STATUS = "status"
+ FIELD_CARD_ID = "card_id"
# Object type.
- _OBJECT_TYPE_GET = "ExportRib"
+ _OBJECT_TYPE_GET = "ShareInviteMonetaryAccountResponse"
_id_ = None
_created = None
_updated = None
+ _counter_alias = None
+ _user_alias_cancelled = None
+ _monetary_account_id = None
+ _draft_share_invite_bank_id = None
+ _share_detail = None
+ _status = None
+ _relation_user = None
+ _share_type = None
+ _start_date = None
+ _end_date = None
+ _description = None
+ _status_field_for_request = None
+ _card_id_field_for_request = None
- @classmethod
- def create(cls, monetary_account_id=None, custom_headers=None):
+ def __init__(self, status=None, card_id=None):
"""
- Create a new RIB.
-
- :type user_id: int
- :type monetary_account_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseInt
+ :param status: The status of the share. Can be PENDING, REVOKED (the user
+ deletes the share inquiry before it's accepted), ACCEPTED, CANCELLED (the
+ user deletes an active share) or CANCELLATION_PENDING,
+ CANCELLATION_ACCEPTED, CANCELLATION_REJECTED (for canceling mutual connects)
+ :type status: str
+ :param card_id: The card to link to the shared monetary account. Used only
+ if share_detail is ShareDetailCardPayment.
+ :type card_id: int
"""
- if custom_headers is None:
- custom_headers = {}
-
- request_map = {
-
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
-
- api_client = ApiClient(cls._get_api_context())
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
- response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
-
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
- )
+ self._status_field_for_request = status
+ self._card_id_field_for_request = card_id
@classmethod
- def get(cls, export_rib_id, monetary_account_id=None, custom_headers=None):
+ def get(cls, share_invite_monetary_account_response_id, custom_headers=None):
"""
- Get a RIB for a monetary account by its id.
+ Return the details of a specific share a user was invited to.
:type api_context: ApiContext
:type user_id: int
- :type monetary_account_id: int
- :type export_rib_id: int
+ :type share_invite_monetary_account_response_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseExportRib
+ :rtype: BunqResponseShareInviteMonetaryAccountResponse
"""
if custom_headers is None:
@@ -16727,49 +16853,65 @@ def get(cls, export_rib_id, monetary_account_id=None, custom_headers=None):
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- export_rib_id)
+ share_invite_monetary_account_response_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseExportRib.cast_from_bunq_response(
+ return BunqResponseShareInviteMonetaryAccountResponse.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def delete(cls, export_rib_id, monetary_account_id=None, custom_headers=None):
+ def update(cls, share_invite_monetary_account_response_id, status=None, card_id=None, custom_headers=None):
"""
+ Accept or reject a share a user was invited to.
+
:type user_id: int
- :type monetary_account_id: int
- :type export_rib_id: int
+ :type share_invite_monetary_account_response_id: int
+ :param status: The status of the share. Can be PENDING, REVOKED (the
+ user deletes the share inquiry before it's accepted), ACCEPTED,
+ CANCELLED (the user deletes an active share) or CANCELLATION_PENDING,
+ CANCELLATION_ACCEPTED, CANCELLATION_REJECTED (for canceling mutual
+ connects)
+ :type status: str
+ :param card_id: The card to link to the shared monetary account. Used
+ only if share_detail is ShareDetailCardPayment.
+ :type card_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNone
+ :rtype: BunqResponseInt
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- export_rib_id)
- response_raw = api_client.delete(endpoint_url, custom_headers)
- return BunqResponseNone.cast_from_bunq_response(
- BunqResponse(None, response_raw.headers)
+ request_map = {
+ cls.FIELD_STATUS: status,
+ cls.FIELD_CARD_ID: card_id
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
+ share_invite_monetary_account_response_id)
+ response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
)
@classmethod
- def list(cls, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, params=None, custom_headers=None):
"""
- List all the RIBs for a monetary account.
+ Return all the shares a user was invited to.
:type user_id: int
- :type monetary_account_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseExportRibList
+ :rtype: BunqResponseShareInviteMonetaryAccountResponseList
"""
if params is None:
@@ -16779,11 +16921,10 @@ def list(cls, monetary_account_id=None, params=None, custom_headers=None):
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseExportRibList.cast_from_bunq_response(
+ return BunqResponseShareInviteMonetaryAccountResponseList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -16811,130 +16952,141 @@ def updated(self):
return self._updated
- def is_all_field_none(self):
+ @property
+ def counter_alias(self):
"""
- :rtype: bool
+ :rtype: object_.MonetaryAccountReference
"""
- if self._id_ is not None:
- return False
-
- if self._created is not None:
- return False
-
- if self._updated is not None:
- return False
-
- return True
+ return self._counter_alias
- @staticmethod
- def from_json(json_str):
+ @property
+ def user_alias_cancelled(self):
"""
- :type json_str: str
-
- :rtype: ExportRib
+ :rtype: object_.LabelUser
"""
- return converter.json_to_class(ExportRib, json_str)
-
-
-class ExportStatementContent(BunqModel):
- """
- Fetch the raw content of a statement export. The returned file format could
- be MT940, CSV or PDF depending on the statement format specified during the
- statement creation. The doc won't display the response of a request to get
- the content of a statement export.
- """
+ return self._user_alias_cancelled
- # Endpoint constants.
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/customer-statement/{}/content"
+ @property
+ def monetary_account_id(self):
+ """
+ :rtype: int
+ """
- # Object type.
- _OBJECT_TYPE_GET = "ExportStatementContent"
+ return self._monetary_account_id
- @classmethod
- def list(cls, customer_statement_id, monetary_account_id=None, custom_headers=None):
+ @property
+ def draft_share_invite_bank_id(self):
"""
- :type user_id: int
- :type monetary_account_id: int
- :type customer_statement_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseBytes
+ :rtype: int
"""
- if custom_headers is None:
- custom_headers = {}
+ return self._draft_share_invite_bank_id
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- customer_statement_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
+ @property
+ def share_detail(self):
+ """
+ :rtype: object_.ShareDetail
+ """
- return BunqResponseBytes.cast_from_bunq_response(
- BunqResponse(response_raw.body_bytes, response_raw.headers)
- )
+ return self._share_detail
- def is_all_field_none(self):
+ @property
+ def status(self):
"""
- :rtype: bool
+ :rtype: str
"""
- return True
+ return self._status
- @staticmethod
- def from_json(json_str):
+ @property
+ def relation_user(self):
"""
- :type json_str: str
-
- :rtype: ExportStatementContent
+ :rtype: RelationUser
"""
- return converter.json_to_class(ExportStatementContent, json_str)
+ return self._relation_user
+ @property
+ def share_type(self):
+ """
+ :rtype: str
+ """
-class ExportStatementPaymentContent(BunqModel):
- """
- Fetch the raw content of a payment statement export.
- """
+ return self._share_type
- # Endpoint constants.
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/event/{}/statement/{}/content"
+ @property
+ def start_date(self):
+ """
+ :rtype: str
+ """
- # Object type.
- _OBJECT_TYPE_GET = "ExportStatementPayment"
+ return self._start_date
- @classmethod
- def list(cls, event_id, statement_id, monetary_account_id=None, custom_headers=None):
+ @property
+ def end_date(self):
"""
- :type user_id: int
- :type monetary_account_id: int
- :type event_id: int
- :type statement_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseBytes
+ :rtype: str
"""
- if custom_headers is None:
- custom_headers = {}
+ return self._end_date
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- event_id, statement_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
+ @property
+ def description(self):
+ """
+ :rtype: str
+ """
- return BunqResponseBytes.cast_from_bunq_response(
- BunqResponse(response_raw.body_bytes, response_raw.headers)
- )
+ return self._description
def is_all_field_none(self):
"""
:rtype: bool
"""
+ if self._id_ is not None:
+ return False
+
+ if self._created is not None:
+ return False
+
+ if self._updated is not None:
+ return False
+
+ if self._counter_alias is not None:
+ return False
+
+ if self._user_alias_cancelled is not None:
+ return False
+
+ if self._monetary_account_id is not None:
+ return False
+
+ if self._draft_share_invite_bank_id is not None:
+ return False
+
+ if self._share_detail is not None:
+ return False
+
+ if self._status is not None:
+ return False
+
+ if self._relation_user is not None:
+ return False
+
+ if self._share_type is not None:
+ return False
+
+ if self._start_date is not None:
+ return False
+
+ if self._end_date is not None:
+ return False
+
+ if self._description is not None:
+ return False
+
return True
@staticmethod
@@ -16942,118 +17094,183 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: ExportStatementPaymentContent
+ :rtype: ShareInviteMonetaryAccountResponse
"""
- return converter.json_to_class(ExportStatementPaymentContent, json_str)
+ return converter.json_to_class(ShareInviteMonetaryAccountResponse, json_str)
-class ExportStatementPayment(BunqModel):
+class SofortMerchantTransaction(BunqModel):
"""
- Used to create a statement export of a single payment.
+ View for requesting Sofort transactions and polling their status.
- :param _id_: The id of the single payment statement model.
- :type _id_: int
- :param _created: The timestamp of the statement model's creation.
- :type _created: str
- :param _updated: The timestamp of the statement model's last update.
- :type _updated: str
- :param _status: The status of the export.
+ :param _amount_requested: The requested amount of money to add.
+ :type _amount_requested: object_.Amount
+ :param _issuer: The BIC of the issuer.
+ :type _issuer: str
+ :param _monetary_account_id: The id of the monetary account this sofort
+ merchant transaction links to.
+ :type _monetary_account_id: int
+ :param _alias: The alias of the monetary account to add money to.
+ :type _alias: object_.MonetaryAccountReference
+ :param _counterparty_alias: The alias of the monetary account the money
+ comes from.
+ :type _counterparty_alias: object_.MonetaryAccountReference
+ :param _amount_guaranteed: In case of a successful transaction, the amount
+ of money that will be transferred.
+ :type _amount_guaranteed: object_.Amount
+ :param _issuer_authentication_url: The URL to visit to
+ :type _issuer_authentication_url: str
+ :param _status: The status of the transaction.
:type _status: str
+ :param _error_message: The error message of the transaction.
+ :type _error_message: list[object_.Error]
+ :param _transaction_identifier: The 'transaction ID' of the Sofort
+ transaction.
+ :type _transaction_identifier: str
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/event/{}/statement"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/event/{}/statement/{}"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/sofort-merchant-transaction"
+
+ # Field constants.
+ FIELD_AMOUNT_REQUESTED = "amount_requested"
+ FIELD_ISSUER = "issuer"
# Object type.
- _OBJECT_TYPE_GET = "ExportStatementPayment"
+ _OBJECT_TYPE_GET = "SofortMerchantTransaction"
- _id_ = None
- _created = None
- _updated = None
+ _monetary_account_id = None
+ _alias = None
+ _counterparty_alias = None
+ _amount_guaranteed = None
+ _amount_requested = None
+ _issuer = None
+ _issuer_authentication_url = None
_status = None
+ _error_message = None
+ _transaction_identifier = None
+ _amount_requested_field_for_request = None
+ _issuer_field_for_request = None
+
+ def __init__(self, amount_requested, issuer=None):
+ """
+ :param amount_requested: The requested amount of money to add.
+ :type amount_requested: object_.Amount
+ :param issuer: The BIC of the issuing bank to ask for money.
+ :type issuer: str
+ """
+
+ self._amount_requested_field_for_request = amount_requested
+ self._issuer_field_for_request = issuer
@classmethod
- def create(cls, event_id, monetary_account_id=None, custom_headers=None):
+ def get(cls, sofort_merchant_transaction_id, monetary_account_id=None, custom_headers=None):
"""
+ :type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type event_id: int
+ :type sofort_merchant_transaction_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseInt
+ :rtype: BunqResponseSofortMerchantTransaction
"""
if custom_headers is None:
custom_headers = {}
- request_map = {
-
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
-
api_client = ApiClient(cls._get_api_context())
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- event_id)
- response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ sofort_merchant_transaction_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
+ return BunqResponseSofortMerchantTransaction.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, event_id, export_statement_payment_id, monetary_account_id=None, custom_headers=None):
+ def list(cls, monetary_account_id=None, params=None, custom_headers=None):
"""
- :type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type event_id: int
- :type export_statement_payment_id: int
+ :type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseExportStatementPayment
+ :rtype: BunqResponseSofortMerchantTransactionList
"""
+ if params is None:
+ params = {}
+
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id), event_id,
- export_statement_payment_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id))
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseExportStatementPayment.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ return BunqResponseSofortMerchantTransactionList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@property
- def id_(self):
+ def monetary_account_id(self):
"""
:rtype: int
"""
- return self._id_
+ return self._monetary_account_id
@property
- def created(self):
+ def alias(self):
+ """
+ :rtype: object_.MonetaryAccountReference
+ """
+
+ return self._alias
+
+ @property
+ def counterparty_alias(self):
+ """
+ :rtype: object_.MonetaryAccountReference
+ """
+
+ return self._counterparty_alias
+
+ @property
+ def amount_guaranteed(self):
+ """
+ :rtype: object_.Amount
+ """
+
+ return self._amount_guaranteed
+
+ @property
+ def amount_requested(self):
+ """
+ :rtype: object_.Amount
+ """
+
+ return self._amount_requested
+
+ @property
+ def issuer(self):
"""
:rtype: str
"""
- return self._created
+ return self._issuer
@property
- def updated(self):
+ def issuer_authentication_url(self):
"""
:rtype: str
"""
- return self._updated
+ return self._issuer_authentication_url
@property
def status(self):
@@ -17063,23 +17280,57 @@ def status(self):
return self._status
+ @property
+ def error_message(self):
+ """
+ :rtype: list[object_.Error]
+ """
+
+ return self._error_message
+
+ @property
+ def transaction_identifier(self):
+ """
+ :rtype: str
+ """
+
+ return self._transaction_identifier
+
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._id_ is not None:
+ if self._monetary_account_id is not None:
return False
- if self._created is not None:
+ if self._alias is not None:
return False
- if self._updated is not None:
+ if self._counterparty_alias is not None:
+ return False
+
+ if self._amount_guaranteed is not None:
+ return False
+
+ if self._amount_requested is not None:
+ return False
+
+ if self._issuer is not None:
+ return False
+
+ if self._issuer_authentication_url is not None:
return False
if self._status is not None:
return False
+ if self._error_message is not None:
+ return False
+
+ if self._transaction_identifier is not None:
+ return False
+
return True
@staticmethod
@@ -17087,157 +17338,48 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: ExportStatementPayment
+ :rtype: SofortMerchantTransaction
"""
- return converter.json_to_class(ExportStatementPayment, json_str)
+ return converter.json_to_class(SofortMerchantTransaction, json_str)
-class ExportStatement(BunqModel):
+class TabResultInquiry(BunqModel):
"""
- Used to create new and read existing statement exports. Statement exports
- can be created in either CSV, MT940 or PDF file format.
+ Used to view TabResultInquiry objects belonging to a tab. A TabResultInquiry
+ is an object that holds details on both the tab and a single payment made
+ for that tab.
- :param _statement_format: The format of statement.
- :type _statement_format: str
- :param _date_start: The date from when this statement shows transactions.
- :type _date_start: str
- :param _date_end: The date until which statement shows transactions.
- :type _date_end: str
- :param _regional_format: The regional format of a CSV statement.
- :type _regional_format: str
- :param _include_attachment: Only for PDF exports. Includes attachments to
- mutations in the export, such as scanned receipts.
- :type _include_attachment: bool
- :param _id_: The id of the customer statement model.
- :type _id_: int
- :param _created: The timestamp of the statement model's creation.
- :type _created: str
- :param _updated: The timestamp of the statement model's last update.
- :type _updated: str
- :param _status: The status of the export.
- :type _status: str
- :param _statement_number: MT940 Statement number. Unique per monetary
- account.
- :type _statement_number: int
- :param _alias_monetary_account: The monetary account for which this
- statement was created.
- :type _alias_monetary_account: object_.MonetaryAccountReference
+ :param _tab: The Tab details.
+ :type _tab: Tab
+ :param _payment: The payment made for the Tab.
+ :type _payment: Payment
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/customer-statement"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/customer-statement/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/customer-statement"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/customer-statement/{}"
-
- # Field constants.
- FIELD_STATEMENT_FORMAT = "statement_format"
- FIELD_DATE_START = "date_start"
- FIELD_DATE_END = "date_end"
- FIELD_REGIONAL_FORMAT = "regional_format"
- FIELD_INCLUDE_ATTACHMENT = "include_attachment"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/cash-register/{}/tab/{}/tab-result-inquiry/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/cash-register/{}/tab/{}/tab-result-inquiry"
# Object type.
- _OBJECT_TYPE_GET = "CustomerStatement"
-
- _id_ = None
- _created = None
- _updated = None
- _date_start = None
- _date_end = None
- _status = None
- _statement_number = None
- _statement_format = None
- _regional_format = None
- _alias_monetary_account = None
- _statement_format_field_for_request = None
- _date_start_field_for_request = None
- _date_end_field_for_request = None
- _regional_format_field_for_request = None
- _include_attachment_field_for_request = None
-
- def __init__(self, statement_format, date_start, date_end, regional_format=None, include_attachment=None):
- """
- :param statement_format: The format type of statement. Allowed values:
- MT940, CSV, PDF.
- :type statement_format: str
- :param date_start: The start date for making statements.
- :type date_start: str
- :param date_end: The end date for making statements.
- :type date_end: str
- :param regional_format: Required for CSV exports. The regional format of the
- statement, can be UK_US (comma-separated) or EUROPEAN (semicolon-separated).
- :type regional_format: str
- :param include_attachment: Only for PDF exports. Includes attachments to
- mutations in the export, such as scanned receipts.
- :type include_attachment: bool
- """
+ _OBJECT_TYPE_GET = "TabResultInquiry"
- self._statement_format_field_for_request = statement_format
- self._date_start_field_for_request = date_start
- self._date_end_field_for_request = date_end
- self._regional_format_field_for_request = regional_format
- self._include_attachment_field_for_request = include_attachment
+ _tab = None
+ _payment = None
@classmethod
- def create(cls, statement_format, date_start, date_end, monetary_account_id=None, regional_format=None,
- include_attachment=None, custom_headers=None):
+ def get(cls, cash_register_id, tab_uuid, tab_result_inquiry_id, monetary_account_id=None, custom_headers=None):
"""
- :type user_id: int
- :type monetary_account_id: int
- :param statement_format: The format type of statement. Allowed values:
- MT940, CSV, PDF.
- :type statement_format: str
- :param date_start: The start date for making statements.
- :type date_start: str
- :param date_end: The end date for making statements.
- :type date_end: str
- :param regional_format: Required for CSV exports. The regional format of
- the statement, can be UK_US (comma-separated) or EUROPEAN
- (semicolon-separated).
- :type regional_format: str
- :param include_attachment: Only for PDF exports. Includes attachments to
- mutations in the export, such as scanned receipts.
- :type include_attachment: bool
- :type custom_headers: dict[str, str]|None
+ Used to view a single TabResultInquiry belonging to a tab.
- :rtype: BunqResponseInt
- """
-
- if custom_headers is None:
- custom_headers = {}
-
- request_map = {
- cls.FIELD_STATEMENT_FORMAT: statement_format,
- cls.FIELD_DATE_START: date_start,
- cls.FIELD_DATE_END: date_end,
- cls.FIELD_REGIONAL_FORMAT: regional_format,
- cls.FIELD_INCLUDE_ATTACHMENT: include_attachment
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
-
- api_client = ApiClient(cls._get_api_context())
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
- response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
-
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
- )
-
- @classmethod
- def get(cls, export_statement_id, monetary_account_id=None, custom_headers=None):
- """
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type export_statement_id: int
+ :type cash_register_id: int
+ :type tab_uuid: str
+ :type tab_result_inquiry_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseExportStatement
+ :rtype: BunqResponseTabResultInquiry
"""
if custom_headers is None:
@@ -17246,22 +17388,26 @@ def get(cls, export_statement_id, monetary_account_id=None, custom_headers=None)
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- export_statement_id)
+ cash_register_id, tab_uuid, tab_result_inquiry_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseExportStatement.cast_from_bunq_response(
+ return BunqResponseTabResultInquiry.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def list(cls, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, cash_register_id, tab_uuid, monetary_account_id=None, params=None, custom_headers=None):
"""
+ Used to view a list of TabResultInquiry objects belonging to a tab.
+
:type user_id: int
:type monetary_account_id: int
+ :type cash_register_id: int
+ :type tab_uuid: str
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseExportStatementList
+ :rtype: BunqResponseTabResultInquiryList
"""
if params is None:
@@ -17272,152 +17418,95 @@ def list(cls, monetary_account_id=None, params=None, custom_headers=None):
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
+ cls._determine_monetary_account_id(monetary_account_id),
+ cash_register_id, tab_uuid)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseExportStatementList.cast_from_bunq_response(
+ return BunqResponseTabResultInquiryList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
- @classmethod
- def delete(cls, export_statement_id, monetary_account_id=None, custom_headers=None):
- """
- :type user_id: int
- :type monetary_account_id: int
- :type export_statement_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseNone
- """
-
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- export_statement_id)
- response_raw = api_client.delete(endpoint_url, custom_headers)
-
- return BunqResponseNone.cast_from_bunq_response(
- BunqResponse(None, response_raw.headers)
- )
-
- @property
- def id_(self):
- """
- :rtype: int
- """
-
- return self._id_
-
@property
- def created(self):
+ def tab(self):
"""
- :rtype: str
+ :rtype: Tab
"""
- return self._created
+ return self._tab
@property
- def updated(self):
+ def payment(self):
"""
- :rtype: str
+ :rtype: Payment
"""
- return self._updated
+ return self._payment
- @property
- def date_start(self):
+ def is_all_field_none(self):
"""
- :rtype: str
+ :rtype: bool
"""
- return self._date_start
+ if self._tab is not None:
+ return False
- @property
- def date_end(self):
- """
- :rtype: str
- """
+ if self._payment is not None:
+ return False
- return self._date_end
+ return True
- @property
- def status(self):
+ @staticmethod
+ def from_json(json_str):
"""
- :rtype: str
+ :type json_str: str
+
+ :rtype: TabResultInquiry
"""
- return self._status
+ return converter.json_to_class(TabResultInquiry, json_str)
- @property
- def statement_number(self):
- """
- :rtype: int
- """
- return self._statement_number
+class ExportAnnualOverviewContent(BunqModel):
+ """
+ Fetch the raw content of an annual overview. The annual overview is always
+ in PDF format. Doc won't display the response of a request to get the
+ content of an annual overview.
+ """
- @property
- def statement_format(self):
- """
- :rtype: str
- """
+ # Endpoint constants.
+ _ENDPOINT_URL_LISTING = "user/{}/export-annual-overview/{}/content"
- return self._statement_format
+ # Object type.
+ _OBJECT_TYPE_GET = "ExportAnnualOverviewContent"
- @property
- def regional_format(self):
+ @classmethod
+ def list(cls, export_annual_overview_id, custom_headers=None):
"""
- :rtype: str
+ Used to retrieve the raw content of an annual overview.
+
+ :type user_id: int
+ :type export_annual_overview_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseBytes
"""
- return self._regional_format
+ if custom_headers is None:
+ custom_headers = {}
- @property
- def alias_monetary_account(self):
- """
- :rtype: object_.MonetaryAccountReference
- """
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(), export_annual_overview_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return self._alias_monetary_account
+ return BunqResponseBytes.cast_from_bunq_response(
+ BunqResponse(response_raw.body_bytes, response_raw.headers)
+ )
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._id_ is not None:
- return False
-
- if self._created is not None:
- return False
-
- if self._updated is not None:
- return False
-
- if self._date_start is not None:
- return False
-
- if self._date_end is not None:
- return False
-
- if self._status is not None:
- return False
-
- if self._statement_number is not None:
- return False
-
- if self._statement_format is not None:
- return False
-
- if self._regional_format is not None:
- return False
-
- if self._alias_monetary_account is not None:
- return False
-
return True
@staticmethod
@@ -17425,62 +17514,144 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: ExportStatement
+ :rtype: ExportAnnualOverviewContent
"""
- return converter.json_to_class(ExportStatement, json_str)
+ return converter.json_to_class(ExportAnnualOverviewContent, json_str)
-class InsightEvent(BunqModel):
+class ExportAnnualOverview(BunqModel):
"""
- Used to get events based on time and insight category.
+ Used to create new and read existing annual overviews of all the user's
+ monetary accounts. Once created, annual overviews can be downloaded in PDF
+ format via the 'export-annual-overview/{id}/content' endpoint.
- :param _id_: The id of the event.
+ :param _year: The year for which the overview is.
+ :type _year: int
+ :param _id_: The id of the annual overview as created on the server.
:type _id_: int
- :param _created: The timestamp of the event's creation.
+ :param _created: The timestamp of the annual overview 's creation.
:type _created: str
- :param _updated: The timestamp of the event's last update.
+ :param _updated: The timestamp of the annual overview 's last update.
:type _updated: str
- :param _action: The performed action. Can be: CREATE or UPDATE.
- :type _action: str
- :param _user_id: The id of the user the event applied to (if it was a user
- event).
- :type _user_id: str
- :param _monetary_account_id: The id of the monetary account the event
- applied to (if it was a monetary account event).
- :type _monetary_account_id: str
- :param _object_: The details of the external object the event was created
- for.
- :type _object_: object_.EventObject
- :param _status: The event status. Can be: FINALIZED or AWAITING_REPLY. An
- example of FINALIZED event is a payment received event, while an
- AWAITING_REPLY event is a request received event.
- :type _status: str
+ :param _alias_user: The user to which this annual overview belongs.
+ :type _alias_user: object_.LabelUser
"""
# Endpoint constants.
- _ENDPOINT_URL_LISTING = "user/{}/insights-search"
+ _ENDPOINT_URL_CREATE = "user/{}/export-annual-overview"
+ _ENDPOINT_URL_READ = "user/{}/export-annual-overview/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/export-annual-overview/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/export-annual-overview"
+
+ # Field constants.
+ FIELD_YEAR = "year"
# Object type.
- _OBJECT_TYPE_GET = "Event"
+ _OBJECT_TYPE_GET = "ExportAnnualOverview"
_id_ = None
_created = None
_updated = None
- _action = None
- _user_id = None
- _monetary_account_id = None
- _object_ = None
- _status = None
+ _year = None
+ _alias_user = None
+ _year_field_for_request = None
+
+ def __init__(self, year):
+ """
+ :param year: The year for which the overview is.
+ :type year: int
+ """
+
+ self._year_field_for_request = year
+
+ @classmethod
+ def create(cls, year, custom_headers=None):
+ """
+ Create a new annual overview for a specific year. An overview can be
+ generated only for a past year.
+
+ :type user_id: int
+ :param year: The year for which the overview is.
+ :type year: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ request_map = {
+ cls.FIELD_YEAR: year
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ api_client = ApiClient(cls._get_api_context())
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
+
+ @classmethod
+ def get(cls, export_annual_overview_id, custom_headers=None):
+ """
+ Get an annual overview for a user by its id.
+
+ :type api_context: ApiContext
+ :type user_id: int
+ :type export_annual_overview_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseExportAnnualOverview
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), export_annual_overview_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponseExportAnnualOverview.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @classmethod
+ def delete(cls, export_annual_overview_id, custom_headers=None):
+ """
+ :type user_id: int
+ :type export_annual_overview_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseNone
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(), export_annual_overview_id)
+ response_raw = api_client.delete(endpoint_url, custom_headers)
+
+ return BunqResponseNone.cast_from_bunq_response(
+ BunqResponse(None, response_raw.headers)
+ )
@classmethod
def list(cls, params=None, custom_headers=None):
"""
+ List all the annual overviews for a user.
+
:type user_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseInsightEventList
+ :rtype: BunqResponseExportAnnualOverviewList
"""
if params is None:
@@ -17493,7 +17664,7 @@ def list(cls, params=None, custom_headers=None):
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseInsightEventList.cast_from_bunq_response(
+ return BunqResponseExportAnnualOverviewList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -17522,44 +17693,20 @@ def updated(self):
return self._updated
@property
- def action(self):
- """
- :rtype: str
- """
-
- return self._action
-
- @property
- def user_id(self):
- """
- :rtype: str
- """
-
- return self._user_id
-
- @property
- def monetary_account_id(self):
- """
- :rtype: str
- """
-
- return self._monetary_account_id
-
- @property
- def object_(self):
+ def year(self):
"""
- :rtype: object_.EventObject
+ :rtype: int
"""
- return self._object_
+ return self._year
@property
- def status(self):
+ def alias_user(self):
"""
- :rtype: str
+ :rtype: object_.LabelUser
"""
- return self._status
+ return self._alias_user
def is_all_field_none(self):
"""
@@ -17575,20 +17722,66 @@ def is_all_field_none(self):
if self._updated is not None:
return False
- if self._action is not None:
+ if self._year is not None:
return False
- if self._user_id is not None:
+ if self._alias_user is not None:
return False
- if self._monetary_account_id is not None:
- return False
+ return True
- if self._object_ is not None:
- return False
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: ExportAnnualOverview
+ """
- if self._status is not None:
- return False
+ return converter.json_to_class(ExportAnnualOverview, json_str)
+
+
+class ExportRibContent(BunqModel):
+ """
+ Fetch the raw content of an RIB. The RIB is always in PDF format.
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/export-rib/{}/content"
+
+ # Object type.
+ _OBJECT_TYPE_GET = "ExportRibContent"
+
+ @classmethod
+ def list(cls, export_rib_id, monetary_account_id=None, custom_headers=None):
+ """
+ Used to retrieve the raw content of an RIB.
+
+ :type user_id: int
+ :type monetary_account_id: int
+ :type export_rib_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseBytes
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ export_rib_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponseBytes.cast_from_bunq_response(
+ BunqResponse(response_raw.body_bytes, response_raw.headers)
+ )
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
return True
@@ -17597,46 +17790,130 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: InsightEvent
+ :rtype: ExportRibContent
"""
- return converter.json_to_class(InsightEvent, json_str)
+ return converter.json_to_class(ExportRibContent, json_str)
-class Insight(BunqModel):
+class ExportRib(BunqModel):
"""
- Used to get insights about transactions between given time range.
+ Used to create new and read existing RIBs of a monetary account
- :param _category: The category.
- :type _category: str
- :param _category_translated: The translated category.
- :type _category_translated: str
- :param _amount_total: The total amount of the transactions in the category.
- :type _amount_total: object_.Amount
- :param _number_of_transactions: The number of the transactions in the
- category.
- :type _number_of_transactions: float
+ :param _id_: The id of the rib as created on the server.
+ :type _id_: int
+ :param _created: The timestamp of the RIB's creation.
+ :type _created: str
+ :param _updated: The timestamp of the RIB's last update.
+ :type _updated: str
"""
# Endpoint constants.
- _ENDPOINT_URL_LISTING = "user/{}/insights"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/export-rib"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/export-rib/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/export-rib/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/export-rib"
# Object type.
- _OBJECT_TYPE_GET = "InsightCategory"
+ _OBJECT_TYPE_GET = "ExportRib"
- _category = None
- _category_translated = None
- _amount_total = None
- _number_of_transactions = None
+ _id_ = None
+ _created = None
+ _updated = None
@classmethod
- def list(cls, params=None, custom_headers=None):
+ def create(cls, monetary_account_id=None, custom_headers=None):
+ """
+ Create a new RIB.
+
+ :type user_id: int
+ :type monetary_account_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ request_map = {
+
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ api_client = ApiClient(cls._get_api_context())
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id))
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
+
+ @classmethod
+ def get(cls, export_rib_id, monetary_account_id=None, custom_headers=None):
+ """
+ Get a RIB for a monetary account by its id.
+
+ :type api_context: ApiContext
+ :type user_id: int
+ :type monetary_account_id: int
+ :type export_rib_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseExportRib
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ export_rib_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponseExportRib.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @classmethod
+ def delete(cls, export_rib_id, monetary_account_id=None, custom_headers=None):
+ """
+ :type user_id: int
+ :type monetary_account_id: int
+ :type export_rib_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseNone
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ export_rib_id)
+ response_raw = api_client.delete(endpoint_url, custom_headers)
+
+ return BunqResponseNone.cast_from_bunq_response(
+ BunqResponse(None, response_raw.headers)
+ )
+
+ @classmethod
+ def list(cls, monetary_account_id=None, params=None, custom_headers=None):
"""
+ List all the RIBs for a monetary account.
+
:type user_id: int
+ :type monetary_account_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseInsightList
+ :rtype: BunqResponseExportRibList
"""
if params is None:
@@ -17646,60 +17923,50 @@ def list(cls, params=None, custom_headers=None):
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id))
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseInsightList.cast_from_bunq_response(
+ return BunqResponseExportRibList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@property
- def category(self):
+ def id_(self):
"""
- :rtype: str
+ :rtype: int
"""
- return self._category
+ return self._id_
@property
- def category_translated(self):
+ def created(self):
"""
:rtype: str
"""
- return self._category_translated
-
- @property
- def amount_total(self):
- """
- :rtype: object_.Amount
- """
-
- return self._amount_total
+ return self._created
@property
- def number_of_transactions(self):
+ def updated(self):
"""
- :rtype: float
+ :rtype: str
"""
- return self._number_of_transactions
+ return self._updated
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._category is not None:
- return False
-
- if self._category_translated is not None:
+ if self._id_ is not None:
return False
- if self._amount_total is not None:
+ if self._created is not None:
return False
- if self._number_of_transactions is not None:
+ if self._updated is not None:
return False
return True
@@ -17709,71 +17976,109 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: Insight
+ :rtype: ExportRib
"""
- return converter.json_to_class(Insight, json_str)
+ return converter.json_to_class(ExportRib, json_str)
-class InstallationServerPublicKey(BunqModel):
+class ExportStatementContent(BunqModel):
"""
- Using /installation/_/server-public-key you can request the ServerPublicKey
- again. This is done by referring to the id of the Installation.
-
- :param _server_public_key: The server's public key for this Installation.
- :type _server_public_key: str
+ Fetch the raw content of a statement export. The returned file format could
+ be MT940, CSV or PDF depending on the statement format specified during the
+ statement creation. The doc won't display the response of a request to get
+ the content of a statement export.
"""
# Endpoint constants.
- _ENDPOINT_URL_LISTING = "installation/{}/server-public-key"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/customer-statement/{}/content"
# Object type.
- _OBJECT_TYPE_GET = "ServerPublicKey"
-
- _server_public_key = None
+ _OBJECT_TYPE_GET = "ExportStatementContent"
@classmethod
- def list(cls, installation_id, params=None, custom_headers=None):
+ def list(cls, customer_statement_id, monetary_account_id=None, custom_headers=None):
"""
- Show the ServerPublicKey for this Installation.
-
- :type installation_id: int
- :type params: dict[str, str]|None
+ :type user_id: int
+ :type monetary_account_id: int
+ :type customer_statement_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseInstallationServerPublicKeyList
+ :rtype: BunqResponseBytes
"""
- if params is None:
- params = {}
-
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(installation_id)
- response_raw = api_client.get(endpoint_url, params, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ customer_statement_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseInstallationServerPublicKeyList.cast_from_bunq_response(
- cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ return BunqResponseBytes.cast_from_bunq_response(
+ BunqResponse(response_raw.body_bytes, response_raw.headers)
)
- @property
- def server_public_key(self):
+ def is_all_field_none(self):
"""
- :rtype: str
+ :rtype: bool
"""
- return self._server_public_key
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: ExportStatementContent
+ """
+
+ return converter.json_to_class(ExportStatementContent, json_str)
+
+
+class ExportStatementPaymentContent(BunqModel):
+ """
+ Fetch the raw content of a payment statement export.
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/event/{}/statement/{}/content"
+
+ # Object type.
+ _OBJECT_TYPE_GET = "ExportStatementPayment"
+
+ @classmethod
+ def list(cls, event_id, statement_id, monetary_account_id=None, custom_headers=None):
+ """
+ :type user_id: int
+ :type monetary_account_id: int
+ :type event_id: int
+ :type statement_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseBytes
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ event_id, statement_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponseBytes.cast_from_bunq_response(
+ BunqResponse(response_raw.body_bytes, response_raw.headers)
+ )
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._server_public_key is not None:
- return False
-
return True
@staticmethod
@@ -17781,234 +18086,44 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: InstallationServerPublicKey
+ :rtype: ExportStatementPaymentContent
"""
- return converter.json_to_class(InstallationServerPublicKey, json_str)
+ return converter.json_to_class(ExportStatementPaymentContent, json_str)
-class MonetaryAccountBank(BunqModel):
+class ExportStatementPayment(BunqModel):
"""
- With MonetaryAccountBank you can create a new bank account, retrieve
- information regarding your existing MonetaryAccountBanks and update specific
- fields of an existing MonetaryAccountBank. Examples of fields that can be
- updated are the description, the daily limit and the avatar of the
- account.
Notification filters can be set on a monetary account
- level to receive callbacks. For more information check the dedicated callbacks page.
+ Used to create a statement export of a single payment.
- :param _currency: The currency of the MonetaryAccountBank as an ISO 4217
- formatted currency code.
- :type _currency: str
- :param _description: The description of the MonetaryAccountBank. Defaults to
- 'bunq account'.
- :type _description: str
- :param _daily_limit: The daily spending limit Amount of the
- MonetaryAccountBank. Defaults to 1000 EUR. Currency must match the
- MonetaryAccountBank's currency. Limited to 10000 EUR.
- :type _daily_limit: object_.Amount
- :param _avatar_uuid: The UUID of the Avatar of the MonetaryAccountBank.
- :type _avatar_uuid: str
- :param _status: The status of the MonetaryAccountBank. Can be: ACTIVE,
- BLOCKED, CANCELLED or PENDING_REOPEN
- :type _status: str
- :param _sub_status: The sub-status of the MonetaryAccountBank providing
- extra information regarding the status. Will be NONE for ACTIVE or
- PENDING_REOPEN, COMPLETELY or ONLY_ACCEPTING_INCOMING for BLOCKED and
- REDEMPTION_INVOLUNTARY, REDEMPTION_VOLUNTARY or PERMANENT for CANCELLED.
- :type _sub_status: str
- :param _reason: The reason for voluntarily cancelling (closing) the
- MonetaryAccountBank, can only be OTHER.
- :type _reason: str
- :param _reason_description: The optional free-form reason for voluntarily
- cancelling (closing) the MonetaryAccountBank. Can be any user provided
- message.
- :type _reason_description: str
- :param _display_name: The legal name of the user / company using this
- monetary account.
- :type _display_name: str
- :param _setting: The settings of the MonetaryAccountBank.
- :type _setting: object_.MonetaryAccountSetting
- :param _id_: The id of the MonetaryAccountBank.
+ :param _id_: The id of the single payment statement model.
:type _id_: int
- :param _created: The timestamp of the MonetaryAccountBank's creation.
+ :param _created: The timestamp of the statement model's creation.
:type _created: str
- :param _updated: The timestamp of the MonetaryAccountBank's last update.
+ :param _updated: The timestamp of the statement model's last update.
:type _updated: str
- :param _avatar: The Avatar of the MonetaryAccountBank.
- :type _avatar: object_.Avatar
- :param _overdraft_limit: The maximum Amount the MonetaryAccountBank can be
- 'in the red'.
- :type _overdraft_limit: object_.Amount
- :param _balance: The current available balance Amount of the
- MonetaryAccountBank.
- :type _balance: object_.Amount
- :param _alias: The Aliases for the MonetaryAccountBank.
- :type _alias: list[object_.Pointer]
- :param _public_uuid: The MonetaryAccountBank's public UUID.
- :type _public_uuid: str
- :param _user_id: The id of the User who owns the MonetaryAccountBank.
- :type _user_id: int
- :param _monetary_account_profile: The profile of the account.
- :type _monetary_account_profile: MonetaryAccountProfile
- :param _auto_save_id: The id of the AutoSave.
- :type _auto_save_id: int
- :param _all_auto_save_id: The ids of the AutoSave.
- :type _all_auto_save_id: list[object_.BunqId]
+ :param _status: The status of the export.
+ :type _status: str
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account-bank"
- _ENDPOINT_URL_READ = "user/{}/monetary-account-bank/{}"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account-bank/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account-bank"
-
- # Field constants.
- FIELD_CURRENCY = "currency"
- FIELD_DESCRIPTION = "description"
- FIELD_DAILY_LIMIT = "daily_limit"
- FIELD_AVATAR_UUID = "avatar_uuid"
- FIELD_STATUS = "status"
- FIELD_SUB_STATUS = "sub_status"
- FIELD_REASON = "reason"
- FIELD_REASON_DESCRIPTION = "reason_description"
- FIELD_DISPLAY_NAME = "display_name"
- FIELD_SETTING = "setting"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/event/{}/statement"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/event/{}/statement/{}"
# Object type.
- _OBJECT_TYPE_GET = "MonetaryAccountBank"
+ _OBJECT_TYPE_GET = "ExportStatementPayment"
_id_ = None
_created = None
_updated = None
- _avatar = None
- _currency = None
- _description = None
- _daily_limit = None
- _overdraft_limit = None
- _balance = None
- _alias = None
- _public_uuid = None
_status = None
- _sub_status = None
- _reason = None
- _reason_description = None
- _user_id = None
- _monetary_account_profile = None
- _display_name = None
- _setting = None
- _auto_save_id = None
- _all_auto_save_id = None
- _currency_field_for_request = None
- _description_field_for_request = None
- _daily_limit_field_for_request = None
- _avatar_uuid_field_for_request = None
- _status_field_for_request = None
- _sub_status_field_for_request = None
- _reason_field_for_request = None
- _reason_description_field_for_request = None
- _display_name_field_for_request = None
- _setting_field_for_request = None
-
- def __init__(self, currency, description=None, daily_limit=None, avatar_uuid=None, status=None, sub_status=None,
- reason=None, reason_description=None, display_name=None, setting=None):
- """
- :param currency: The currency of the MonetaryAccountBank as an ISO 4217
- formatted currency code.
- :type currency: str
- :param description: The description of the MonetaryAccountBank. Defaults to
- 'bunq account'.
- :type description: str
- :param daily_limit: The daily spending limit Amount of the
- MonetaryAccountBank. Defaults to 1000 EUR. Currency must match the
- MonetaryAccountBank's currency. Limited to 10000 EUR.
- :type daily_limit: object_.Amount
- :param avatar_uuid: The UUID of the Avatar of the MonetaryAccountBank.
- :type avatar_uuid: str
- :param status: The status of the MonetaryAccountBank. Ignored in POST
- requests (always set to ACTIVE) can be CANCELLED or PENDING_REOPEN in PUT
- requests to cancel (close) or reopen the MonetaryAccountBank. When updating
- the status and/or sub_status no other fields can be updated in the same
- request (and vice versa).
- :type status: str
- :param sub_status: The sub-status of the MonetaryAccountBank providing extra
- information regarding the status. Should be ignored for POST requests. In
- case of PUT requests with status CANCELLED it can only be
- REDEMPTION_VOLUNTARY, while with status PENDING_REOPEN it can only be NONE.
- When updating the status and/or sub_status no other fields can be updated in
- the same request (and vice versa).
- :type sub_status: str
- :param reason: The reason for voluntarily cancelling (closing) the
- MonetaryAccountBank, can only be OTHER. Should only be specified if updating
- the status to CANCELLED.
- :type reason: str
- :param reason_description: The optional free-form reason for voluntarily
- cancelling (closing) the MonetaryAccountBank. Can be any user provided
- message. Should only be specified if updating the status to CANCELLED.
- :type reason_description: str
- :param display_name: The legal name of the user / company using this
- monetary account.
- :type display_name: str
- :param setting: The settings of the MonetaryAccountBank.
- :type setting: object_.MonetaryAccountSetting
- """
-
- self._currency_field_for_request = currency
- self._description_field_for_request = description
- self._daily_limit_field_for_request = daily_limit
- self._avatar_uuid_field_for_request = avatar_uuid
- self._status_field_for_request = status
- self._sub_status_field_for_request = sub_status
- self._reason_field_for_request = reason
- self._reason_description_field_for_request = reason_description
- self._display_name_field_for_request = display_name
- self._setting_field_for_request = setting
@classmethod
- def create(cls, currency, description=None, daily_limit=None, avatar_uuid=None, status=None, sub_status=None,
- reason=None, reason_description=None, display_name=None, setting=None, custom_headers=None):
+ def create(cls, event_id, monetary_account_id=None, custom_headers=None):
"""
- Create new MonetaryAccountBank.
-
:type user_id: int
- :param currency: The currency of the MonetaryAccountBank as an ISO 4217
- formatted currency code.
- :type currency: str
- :param description: The description of the MonetaryAccountBank. Defaults
- to 'bunq account'.
- :type description: str
- :param daily_limit: The daily spending limit Amount of the
- MonetaryAccountBank. Defaults to 1000 EUR. Currency must match the
- MonetaryAccountBank's currency. Limited to 10000 EUR.
- :type daily_limit: object_.Amount
- :param avatar_uuid: The UUID of the Avatar of the MonetaryAccountBank.
- :type avatar_uuid: str
- :param status: The status of the MonetaryAccountBank. Ignored in POST
- requests (always set to ACTIVE) can be CANCELLED or PENDING_REOPEN in
- PUT requests to cancel (close) or reopen the MonetaryAccountBank. When
- updating the status and/or sub_status no other fields can be updated in
- the same request (and vice versa).
- :type status: str
- :param sub_status: The sub-status of the MonetaryAccountBank providing
- extra information regarding the status. Should be ignored for POST
- requests. In case of PUT requests with status CANCELLED it can only be
- REDEMPTION_VOLUNTARY, while with status PENDING_REOPEN it can only be
- NONE. When updating the status and/or sub_status no other fields can be
- updated in the same request (and vice versa).
- :type sub_status: str
- :param reason: The reason for voluntarily cancelling (closing) the
- MonetaryAccountBank, can only be OTHER. Should only be specified if
- updating the status to CANCELLED.
- :type reason: str
- :param reason_description: The optional free-form reason for voluntarily
- cancelling (closing) the MonetaryAccountBank. Can be any user provided
- message. Should only be specified if updating the status to CANCELLED.
- :type reason_description: str
- :param display_name: The legal name of the user / company using this
- monetary account.
- :type display_name: str
- :param setting: The settings of the MonetaryAccountBank.
- :type setting: object_.MonetaryAccountSetting
+ :type monetary_account_id: int
+ :type event_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -18018,23 +18133,16 @@ def create(cls, currency, description=None, daily_limit=None, avatar_uuid=None,
custom_headers = {}
request_map = {
- cls.FIELD_CURRENCY: currency,
- cls.FIELD_DESCRIPTION: description,
- cls.FIELD_DAILY_LIMIT: daily_limit,
- cls.FIELD_AVATAR_UUID: avatar_uuid,
- cls.FIELD_STATUS: status,
- cls.FIELD_SUB_STATUS: sub_status,
- cls.FIELD_REASON: reason,
- cls.FIELD_REASON_DESCRIPTION: reason_description,
- cls.FIELD_DISPLAY_NAME: display_name,
- cls.FIELD_SETTING: setting
+
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
api_client = ApiClient(cls._get_api_context())
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ event_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -18042,73 +18150,200 @@ def create(cls, currency, description=None, daily_limit=None, avatar_uuid=None,
)
@classmethod
- def get(cls, monetary_account_bank_id, custom_headers=None):
+ def get(cls, event_id, export_statement_payment_id, monetary_account_id=None, custom_headers=None):
"""
- Get a specific MonetaryAccountBank.
-
:type api_context: ApiContext
:type user_id: int
- :type monetary_account_bank_id: int
+ :type monetary_account_id: int
+ :type event_id: int
+ :type export_statement_payment_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseMonetaryAccountBank
+ :rtype: BunqResponseExportStatementPayment
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), monetary_account_bank_id)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id), event_id,
+ export_statement_payment_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseMonetaryAccountBank.cast_from_bunq_response(
+ return BunqResponseExportStatementPayment.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
- @classmethod
- def update(cls, monetary_account_bank_id, description=None, daily_limit=None, avatar_uuid=None, status=None,
- sub_status=None, reason=None, reason_description=None, display_name=None, setting=None,
- custom_headers=None):
+ @property
+ def id_(self):
"""
- Update a specific existing MonetaryAccountBank.
+ :rtype: int
+ """
+
+ return self._id_
+
+ @property
+ def created(self):
+ """
+ :rtype: str
+ """
+
+ return self._created
+
+ @property
+ def updated(self):
+ """
+ :rtype: str
+ """
+
+ return self._updated
+
+ @property
+ def status(self):
+ """
+ :rtype: str
+ """
+
+ return self._status
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._id_ is not None:
+ return False
+
+ if self._created is not None:
+ return False
+
+ if self._updated is not None:
+ return False
+
+ if self._status is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+ :rtype: ExportStatementPayment
+ """
+
+ return converter.json_to_class(ExportStatementPayment, json_str)
+
+
+class ExportStatement(BunqModel):
+ """
+ Used to create new and read existing statement exports. Statement exports
+ can be created in either CSV, MT940 or PDF file format.
+
+ :param _statement_format: The format of statement.
+ :type _statement_format: str
+ :param _date_start: The date from when this statement shows transactions.
+ :type _date_start: str
+ :param _date_end: The date until which statement shows transactions.
+ :type _date_end: str
+ :param _regional_format: The regional format of a CSV statement.
+ :type _regional_format: str
+ :param _include_attachment: Only for PDF exports. Includes attachments to
+ mutations in the export, such as scanned receipts.
+ :type _include_attachment: bool
+ :param _id_: The id of the customer statement model.
+ :type _id_: int
+ :param _created: The timestamp of the statement model's creation.
+ :type _created: str
+ :param _updated: The timestamp of the statement model's last update.
+ :type _updated: str
+ :param _status: The status of the export.
+ :type _status: str
+ :param _statement_number: MT940 Statement number. Unique per monetary
+ account.
+ :type _statement_number: int
+ :param _alias_monetary_account: The monetary account for which this
+ statement was created.
+ :type _alias_monetary_account: object_.MonetaryAccountReference
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/customer-statement"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/customer-statement/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/customer-statement"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/customer-statement/{}"
+
+ # Field constants.
+ FIELD_STATEMENT_FORMAT = "statement_format"
+ FIELD_DATE_START = "date_start"
+ FIELD_DATE_END = "date_end"
+ FIELD_REGIONAL_FORMAT = "regional_format"
+ FIELD_INCLUDE_ATTACHMENT = "include_attachment"
+
+ # Object type.
+ _OBJECT_TYPE_GET = "CustomerStatement"
+
+ _id_ = None
+ _created = None
+ _updated = None
+ _date_start = None
+ _date_end = None
+ _status = None
+ _statement_number = None
+ _statement_format = None
+ _regional_format = None
+ _alias_monetary_account = None
+ _statement_format_field_for_request = None
+ _date_start_field_for_request = None
+ _date_end_field_for_request = None
+ _regional_format_field_for_request = None
+ _include_attachment_field_for_request = None
+
+ def __init__(self, statement_format, date_start, date_end, regional_format=None, include_attachment=None):
+ """
+ :param statement_format: The format type of statement. Allowed values:
+ MT940, CSV, PDF.
+ :type statement_format: str
+ :param date_start: The start date for making statements.
+ :type date_start: str
+ :param date_end: The end date for making statements.
+ :type date_end: str
+ :param regional_format: Required for CSV exports. The regional format of the
+ statement, can be UK_US (comma-separated) or EUROPEAN (semicolon-separated).
+ :type regional_format: str
+ :param include_attachment: Only for PDF exports. Includes attachments to
+ mutations in the export, such as scanned receipts.
+ :type include_attachment: bool
+ """
+
+ self._statement_format_field_for_request = statement_format
+ self._date_start_field_for_request = date_start
+ self._date_end_field_for_request = date_end
+ self._regional_format_field_for_request = regional_format
+ self._include_attachment_field_for_request = include_attachment
+
+ @classmethod
+ def create(cls, statement_format, date_start, date_end, monetary_account_id=None, regional_format=None,
+ include_attachment=None, custom_headers=None):
+ """
:type user_id: int
- :type monetary_account_bank_id: int
- :param description: The description of the MonetaryAccountBank. Defaults
- to 'bunq account'.
- :type description: str
- :param daily_limit: The daily spending limit Amount of the
- MonetaryAccountBank. Defaults to 1000 EUR. Currency must match the
- MonetaryAccountBank's currency. Limited to 10000 EUR.
- :type daily_limit: object_.Amount
- :param avatar_uuid: The UUID of the Avatar of the MonetaryAccountBank.
- :type avatar_uuid: str
- :param status: The status of the MonetaryAccountBank. Ignored in POST
- requests (always set to ACTIVE) can be CANCELLED or PENDING_REOPEN in
- PUT requests to cancel (close) or reopen the MonetaryAccountBank. When
- updating the status and/or sub_status no other fields can be updated in
- the same request (and vice versa).
- :type status: str
- :param sub_status: The sub-status of the MonetaryAccountBank providing
- extra information regarding the status. Should be ignored for POST
- requests. In case of PUT requests with status CANCELLED it can only be
- REDEMPTION_VOLUNTARY, while with status PENDING_REOPEN it can only be
- NONE. When updating the status and/or sub_status no other fields can be
- updated in the same request (and vice versa).
- :type sub_status: str
- :param reason: The reason for voluntarily cancelling (closing) the
- MonetaryAccountBank, can only be OTHER. Should only be specified if
- updating the status to CANCELLED.
- :type reason: str
- :param reason_description: The optional free-form reason for voluntarily
- cancelling (closing) the MonetaryAccountBank. Can be any user provided
- message. Should only be specified if updating the status to CANCELLED.
- :type reason_description: str
- :param display_name: The legal name of the user / company using this
- monetary account.
- :type display_name: str
- :param setting: The settings of the MonetaryAccountBank.
- :type setting: object_.MonetaryAccountSetting
+ :type monetary_account_id: int
+ :param statement_format: The format type of statement. Allowed values:
+ MT940, CSV, PDF.
+ :type statement_format: str
+ :param date_start: The start date for making statements.
+ :type date_start: str
+ :param date_end: The end date for making statements.
+ :type date_end: str
+ :param regional_format: Required for CSV exports. The regional format of
+ the statement, can be UK_US (comma-separated) or EUROPEAN
+ (semicolon-separated).
+ :type regional_format: str
+ :param include_attachment: Only for PDF exports. Includes attachments to
+ mutations in the export, such as scanned receipts.
+ :type include_attachment: bool
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -18117,40 +18352,60 @@ def update(cls, monetary_account_bank_id, description=None, daily_limit=None, av
if custom_headers is None:
custom_headers = {}
- api_client = ApiClient(cls._get_api_context())
-
request_map = {
- cls.FIELD_DESCRIPTION: description,
- cls.FIELD_DAILY_LIMIT: daily_limit,
- cls.FIELD_AVATAR_UUID: avatar_uuid,
- cls.FIELD_STATUS: status,
- cls.FIELD_SUB_STATUS: sub_status,
- cls.FIELD_REASON: reason,
- cls.FIELD_REASON_DESCRIPTION: reason_description,
- cls.FIELD_DISPLAY_NAME: display_name,
- cls.FIELD_SETTING: setting
+ cls.FIELD_STATEMENT_FORMAT: statement_format,
+ cls.FIELD_DATE_START: date_start,
+ cls.FIELD_DATE_END: date_end,
+ cls.FIELD_REGIONAL_FORMAT: regional_format,
+ cls.FIELD_INCLUDE_ATTACHMENT: include_attachment
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
+ api_client = ApiClient(cls._get_api_context())
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(), monetary_account_bank_id)
- response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id))
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
cls._process_for_id(response_raw)
)
@classmethod
- def list(cls, params=None, custom_headers=None):
+ def get(cls, export_statement_id, monetary_account_id=None, custom_headers=None):
"""
- Gets a listing of all MonetaryAccountBanks of a given user.
+ :type api_context: ApiContext
+ :type user_id: int
+ :type monetary_account_id: int
+ :type export_statement_id: int
+ :type custom_headers: dict[str, str]|None
+ :rtype: BunqResponseExportStatement
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ export_statement_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponseExportStatement.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @classmethod
+ def list(cls, monetary_account_id=None, params=None, custom_headers=None):
+ """
:type user_id: int
+ :type monetary_account_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseMonetaryAccountBankList
+ :rtype: BunqResponseExportStatementList
"""
if params is None:
@@ -18160,13 +18415,38 @@ def list(cls, params=None, custom_headers=None):
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id))
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseMonetaryAccountBankList.cast_from_bunq_response(
+ return BunqResponseExportStatementList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
+ @classmethod
+ def delete(cls, export_statement_id, monetary_account_id=None, custom_headers=None):
+ """
+ :type user_id: int
+ :type monetary_account_id: int
+ :type export_statement_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseNone
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ export_statement_id)
+ response_raw = api_client.delete(endpoint_url, custom_headers)
+
+ return BunqResponseNone.cast_from_bunq_response(
+ BunqResponse(None, response_raw.headers)
+ )
+
@property
def id_(self):
"""
@@ -18192,148 +18472,238 @@ def updated(self):
return self._updated
@property
- def avatar(self):
+ def date_start(self):
"""
- :rtype: object_.Avatar
+ :rtype: str
"""
- return self._avatar
+ return self._date_start
@property
- def currency(self):
+ def date_end(self):
"""
:rtype: str
"""
- return self._currency
+ return self._date_end
@property
- def description(self):
+ def status(self):
"""
:rtype: str
"""
- return self._description
+ return self._status
@property
- def daily_limit(self):
+ def statement_number(self):
"""
- :rtype: object_.Amount
+ :rtype: int
"""
- return self._daily_limit
+ return self._statement_number
@property
- def overdraft_limit(self):
+ def statement_format(self):
"""
- :rtype: object_.Amount
+ :rtype: str
"""
- return self._overdraft_limit
+ return self._statement_format
@property
- def balance(self):
+ def regional_format(self):
"""
- :rtype: object_.Amount
+ :rtype: str
"""
- return self._balance
+ return self._regional_format
@property
- def alias(self):
+ def alias_monetary_account(self):
"""
- :rtype: list[object_.Pointer]
+ :rtype: object_.MonetaryAccountReference
"""
- return self._alias
+ return self._alias_monetary_account
- @property
- def public_uuid(self):
+ def is_all_field_none(self):
"""
- :rtype: str
+ :rtype: bool
"""
- return self._public_uuid
+ if self._id_ is not None:
+ return False
- @property
- def status(self):
+ if self._created is not None:
+ return False
+
+ if self._updated is not None:
+ return False
+
+ if self._date_start is not None:
+ return False
+
+ if self._date_end is not None:
+ return False
+
+ if self._status is not None:
+ return False
+
+ if self._statement_number is not None:
+ return False
+
+ if self._statement_format is not None:
+ return False
+
+ if self._regional_format is not None:
+ return False
+
+ if self._alias_monetary_account is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
"""
- :rtype: str
+ :type json_str: str
+
+ :rtype: ExportStatement
"""
- return self._status
+ return converter.json_to_class(ExportStatement, json_str)
- @property
- def sub_status(self):
+
+class InsightEvent(BunqModel):
+ """
+ Used to get events based on time and insight category.
+
+ :param _id_: The id of the event.
+ :type _id_: int
+ :param _created: The timestamp of the event's creation.
+ :type _created: str
+ :param _updated: The timestamp of the event's last update.
+ :type _updated: str
+ :param _action: The performed action. Can be: CREATE or UPDATE.
+ :type _action: str
+ :param _user_id: The id of the user the event applied to (if it was a user
+ event).
+ :type _user_id: str
+ :param _monetary_account_id: The id of the monetary account the event
+ applied to (if it was a monetary account event).
+ :type _monetary_account_id: str
+ :param _object_: The details of the external object the event was created
+ for.
+ :type _object_: object_.EventObject
+ :param _status: The event status. Can be: FINALIZED or AWAITING_REPLY. An
+ example of FINALIZED event is a payment received event, while an
+ AWAITING_REPLY event is a request received event.
+ :type _status: str
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_LISTING = "user/{}/insights-search"
+
+ # Object type.
+ _OBJECT_TYPE_GET = "Event"
+
+ _id_ = None
+ _created = None
+ _updated = None
+ _action = None
+ _user_id = None
+ _monetary_account_id = None
+ _object_ = None
+ _status = None
+
+ @classmethod
+ def list(cls, params=None, custom_headers=None):
"""
- :rtype: str
+ :type user_id: int
+ :type params: dict[str, str]|None
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInsightEventList
"""
- return self._sub_status
+ if params is None:
+ params = {}
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
+
+ return BunqResponseInsightEventList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ )
@property
- def reason(self):
+ def id_(self):
"""
- :rtype: str
+ :rtype: int
"""
- return self._reason
+ return self._id_
@property
- def reason_description(self):
+ def created(self):
"""
:rtype: str
"""
- return self._reason_description
+ return self._created
@property
- def user_id(self):
+ def updated(self):
"""
- :rtype: int
+ :rtype: str
"""
- return self._user_id
+ return self._updated
@property
- def monetary_account_profile(self):
+ def action(self):
"""
- :rtype: MonetaryAccountProfile
+ :rtype: str
"""
- return self._monetary_account_profile
+ return self._action
@property
- def display_name(self):
+ def user_id(self):
"""
:rtype: str
"""
- return self._display_name
+ return self._user_id
@property
- def setting(self):
+ def monetary_account_id(self):
"""
- :rtype: object_.MonetaryAccountSetting
+ :rtype: str
"""
- return self._setting
+ return self._monetary_account_id
@property
- def auto_save_id(self):
+ def object_(self):
"""
- :rtype: int
+ :rtype: object_.EventObject
"""
- return self._auto_save_id
+ return self._object_
@property
- def all_auto_save_id(self):
+ def status(self):
"""
- :rtype: list[object_.BunqId]
+ :rtype: str
"""
- return self._all_auto_save_id
+ return self._status
def is_all_field_none(self):
"""
@@ -18349,58 +18719,131 @@ def is_all_field_none(self):
if self._updated is not None:
return False
- if self._avatar is not None:
+ if self._action is not None:
return False
- if self._currency is not None:
+ if self._user_id is not None:
return False
- if self._description is not None:
+ if self._monetary_account_id is not None:
return False
- if self._daily_limit is not None:
+ if self._object_ is not None:
return False
- if self._overdraft_limit is not None:
+ if self._status is not None:
return False
- if self._balance is not None:
- return False
+ return True
- if self._alias is not None:
- return False
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: InsightEvent
+ """
- if self._public_uuid is not None:
- return False
+ return converter.json_to_class(InsightEvent, json_str)
- if self._status is not None:
- return False
- if self._sub_status is not None:
- return False
+class Insight(BunqModel):
+ """
+ Used to get insights about transactions between given time range.
+
+ :param _category: The category.
+ :type _category: str
+ :param _category_translated: The translated category.
+ :type _category_translated: str
+ :param _amount_total: The total amount of the transactions in the category.
+ :type _amount_total: object_.Amount
+ :param _number_of_transactions: The number of the transactions in the
+ category.
+ :type _number_of_transactions: float
+ """
- if self._reason is not None:
- return False
+ # Endpoint constants.
+ _ENDPOINT_URL_LISTING = "user/{}/insights"
- if self._reason_description is not None:
- return False
+ # Object type.
+ _OBJECT_TYPE_GET = "InsightCategory"
- if self._user_id is not None:
- return False
+ _category = None
+ _category_translated = None
+ _amount_total = None
+ _number_of_transactions = None
- if self._monetary_account_profile is not None:
- return False
+ @classmethod
+ def list(cls, params=None, custom_headers=None):
+ """
+ :type user_id: int
+ :type params: dict[str, str]|None
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInsightList
+ """
- if self._display_name is not None:
+ if params is None:
+ params = {}
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
+
+ return BunqResponseInsightList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @property
+ def category(self):
+ """
+ :rtype: str
+ """
+
+ return self._category
+
+ @property
+ def category_translated(self):
+ """
+ :rtype: str
+ """
+
+ return self._category_translated
+
+ @property
+ def amount_total(self):
+ """
+ :rtype: object_.Amount
+ """
+
+ return self._amount_total
+
+ @property
+ def number_of_transactions(self):
+ """
+ :rtype: float
+ """
+
+ return self._number_of_transactions
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._category is not None:
return False
- if self._setting is not None:
+ if self._category_translated is not None:
return False
- if self._auto_save_id is not None:
+ if self._amount_total is not None:
return False
- if self._all_auto_save_id is not None:
+ if self._number_of_transactions is not None:
return False
return True
@@ -18410,72 +18853,69 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: MonetaryAccountBank
+ :rtype: Insight
"""
- return converter.json_to_class(MonetaryAccountBank, json_str)
+ return converter.json_to_class(Insight, json_str)
-class MonetaryAccountProfile(BunqModel):
+class InstallationServerPublicKey(BunqModel):
"""
- Used to update and read up monetary account profiles, to keep the balance
- between specific thresholds.
+ Using /installation/_/server-public-key you can request the ServerPublicKey
+ again. This is done by referring to the id of the Installation.
- :param _profile_fill: The profile settings for triggering the fill of a
- monetary account.
- :type _profile_fill: object_.MonetaryAccountProfileFill
- :param _profile_drain: The profile settings for moving excesses to a savings
- account
- :type _profile_drain: object_.MonetaryAccountProfileDrain
+ :param _server_public_key: The server's public key for this Installation.
+ :type _server_public_key: str
"""
- # Field constants.
- FIELD_PROFILE_FILL = "profile_fill"
- FIELD_PROFILE_DRAIN = "profile_drain"
+ # Endpoint constants.
+ _ENDPOINT_URL_LISTING = "installation/{}/server-public-key"
- _profile_fill = None
- _profile_drain = None
- _profile_fill_field_for_request = None
- _profile_drain_field_for_request = None
+ # Object type.
+ _OBJECT_TYPE_GET = "ServerPublicKey"
- def __init__(self, profile_fill=None, profile_drain=None):
+ _server_public_key = None
+
+ @classmethod
+ def list(cls, installation_id, params=None, custom_headers=None):
"""
- :param profile_fill: The profile settings for triggering the fill of a
- monetary account.
- :type profile_fill: object_.MonetaryAccountProfileFill
- :param profile_drain: The profile settings for moving excesses to a savings
- account
- :type profile_drain: object_.MonetaryAccountProfileDrain
+ Show the ServerPublicKey for this Installation.
+
+ :type installation_id: int
+ :type params: dict[str, str]|None
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInstallationServerPublicKeyList
"""
- self._profile_fill_field_for_request = profile_fill
- self._profile_drain_field_for_request = profile_drain
+ if params is None:
+ params = {}
- @property
- def profile_fill(self):
- """
- :rtype: object_.MonetaryAccountProfileFill
- """
+ if custom_headers is None:
+ custom_headers = {}
- return self._profile_fill
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(installation_id)
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
+
+ return BunqResponseInstallationServerPublicKeyList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ )
@property
- def profile_drain(self):
+ def server_public_key(self):
"""
- :rtype: object_.MonetaryAccountProfileDrain
+ :rtype: str
"""
- return self._profile_drain
+ return self._server_public_key
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._profile_fill is not None:
- return False
-
- if self._profile_drain is not None:
+ if self._server_public_key is not None:
return False
return True
@@ -18485,97 +18925,100 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: MonetaryAccountProfile
+ :rtype: InstallationServerPublicKey
"""
- return converter.json_to_class(MonetaryAccountProfile, json_str)
+ return converter.json_to_class(InstallationServerPublicKey, json_str)
-class MonetaryAccountJoint(BunqModel):
+class MonetaryAccountBank(BunqModel):
"""
- The endpoint for joint monetary accounts.
+ With MonetaryAccountBank you can create a new bank account, retrieve
+ information regarding your existing MonetaryAccountBanks and update specific
+ fields of an existing MonetaryAccountBank. Examples of fields that can be
+ updated are the description, the daily limit and the avatar of the
+ account.
Notification filters can be set on a monetary account
+ level to receive callbacks. For more information check the dedicated callbacks page.
- :param _currency: The currency of the MonetaryAccountJoint as an ISO 4217
+ :param _currency: The currency of the MonetaryAccountBank as an ISO 4217
formatted currency code.
:type _currency: str
- :param _description: The description of the MonetaryAccountJoint. Defaults
- to 'bunq account'.
+ :param _description: The description of the MonetaryAccountBank. Defaults to
+ 'bunq account'.
:type _description: str
:param _daily_limit: The daily spending limit Amount of the
- MonetaryAccountJoint. Defaults to 1000 EUR. Currency must match the
- MonetaryAccountJoint's currency. Limited to 10000 EUR.
+ MonetaryAccountBank. Defaults to 1000 EUR. Currency must match the
+ MonetaryAccountBank's currency. Limited to 10000 EUR.
:type _daily_limit: object_.Amount
- :param _overdraft_limit: The maximum Amount the MonetaryAccountJoint can be
- 'in the red'.
- :type _overdraft_limit: object_.Amount
- :param _alias: The Aliases for the MonetaryAccountJoint.
- :type _alias: list[object_.Pointer]
- :param _avatar_uuid: The UUID of the Avatar of the MonetaryAccountJoint.
+ :param _avatar_uuid: The UUID of the Avatar of the MonetaryAccountBank.
:type _avatar_uuid: str
- :param _status: The status of the MonetaryAccountJoint. Can be: ACTIVE,
+ :param _status: The status of the MonetaryAccountBank. Can be: ACTIVE,
BLOCKED, CANCELLED or PENDING_REOPEN
:type _status: str
- :param _sub_status: The sub-status of the MonetaryAccountJoint providing
+ :param _sub_status: The sub-status of the MonetaryAccountBank providing
extra information regarding the status. Will be NONE for ACTIVE or
PENDING_REOPEN, COMPLETELY or ONLY_ACCEPTING_INCOMING for BLOCKED and
REDEMPTION_INVOLUNTARY, REDEMPTION_VOLUNTARY or PERMANENT for CANCELLED.
:type _sub_status: str
:param _reason: The reason for voluntarily cancelling (closing) the
- MonetaryAccountJoint, can only be OTHER.
+ MonetaryAccountBank, can only be OTHER.
:type _reason: str
:param _reason_description: The optional free-form reason for voluntarily
- cancelling (closing) the MonetaryAccountJoint. Can be any user provided
+ cancelling (closing) the MonetaryAccountBank. Can be any user provided
message.
:type _reason_description: str
- :param _all_co_owner: The users the account will be joint with.
- :type _all_co_owner: list[object_.CoOwner]
- :param _setting: The settings of the MonetaryAccountJoint.
+ :param _display_name: The legal name of the user / company using this
+ monetary account.
+ :type _display_name: str
+ :param _setting: The settings of the MonetaryAccountBank.
:type _setting: object_.MonetaryAccountSetting
- :param _id_: The id of the MonetaryAccountJoint.
+ :param _id_: The id of the MonetaryAccountBank.
:type _id_: int
- :param _created: The timestamp of the MonetaryAccountJoint's creation.
+ :param _created: The timestamp of the MonetaryAccountBank's creation.
:type _created: str
- :param _updated: The timestamp of the MonetaryAccountJoint's last update.
+ :param _updated: The timestamp of the MonetaryAccountBank's last update.
:type _updated: str
- :param _avatar: The Avatar of the MonetaryAccountJoint.
+ :param _avatar: The Avatar of the MonetaryAccountBank.
:type _avatar: object_.Avatar
+ :param _overdraft_limit: The maximum Amount the MonetaryAccountBank can be
+ 'in the red'.
+ :type _overdraft_limit: object_.Amount
:param _balance: The current available balance Amount of the
- MonetaryAccountJoint.
+ MonetaryAccountBank.
:type _balance: object_.Amount
- :param _public_uuid: The MonetaryAccountJoint's public UUID.
+ :param _alias: The Aliases for the MonetaryAccountBank.
+ :type _alias: list[object_.Pointer]
+ :param _public_uuid: The MonetaryAccountBank's public UUID.
:type _public_uuid: str
- :param _user_id: The id of the User who owns the MonetaryAccountJoint.
+ :param _user_id: The id of the User who owns the MonetaryAccountBank.
:type _user_id: int
:param _monetary_account_profile: The profile of the account.
:type _monetary_account_profile: MonetaryAccountProfile
- :param _auto_save_id: The id of the AutoSave.
- :type _auto_save_id: int
:param _all_auto_save_id: The ids of the AutoSave.
:type _all_auto_save_id: list[object_.BunqId]
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account-joint"
- _ENDPOINT_URL_READ = "user/{}/monetary-account-joint/{}"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account-joint/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account-joint"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account-bank"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account-bank/{}"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account-bank/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account-bank"
# Field constants.
FIELD_CURRENCY = "currency"
FIELD_DESCRIPTION = "description"
FIELD_DAILY_LIMIT = "daily_limit"
- FIELD_OVERDRAFT_LIMIT = "overdraft_limit"
- FIELD_ALIAS = "alias"
FIELD_AVATAR_UUID = "avatar_uuid"
FIELD_STATUS = "status"
FIELD_SUB_STATUS = "sub_status"
FIELD_REASON = "reason"
FIELD_REASON_DESCRIPTION = "reason_description"
- FIELD_ALL_CO_OWNER = "all_co_owner"
+ FIELD_DISPLAY_NAME = "display_name"
FIELD_SETTING = "setting"
# Object type.
- _OBJECT_TYPE_GET = "MonetaryAccountJoint"
+ _OBJECT_TYPE_GET = "MonetaryAccountBank"
_id_ = None
_created = None
@@ -18592,119 +19035,102 @@ class MonetaryAccountJoint(BunqModel):
_sub_status = None
_reason = None
_reason_description = None
- _all_co_owner = None
_user_id = None
_monetary_account_profile = None
+ _display_name = None
_setting = None
- _auto_save_id = None
_all_auto_save_id = None
_currency_field_for_request = None
_description_field_for_request = None
_daily_limit_field_for_request = None
- _overdraft_limit_field_for_request = None
- _alias_field_for_request = None
_avatar_uuid_field_for_request = None
_status_field_for_request = None
_sub_status_field_for_request = None
_reason_field_for_request = None
_reason_description_field_for_request = None
- _all_co_owner_field_for_request = None
+ _display_name_field_for_request = None
_setting_field_for_request = None
- def __init__(self, currency, all_co_owner, description=None, daily_limit=None, overdraft_limit=None, alias=None,
- avatar_uuid=None, status=None, sub_status=None, reason=None, reason_description=None, setting=None):
+ def __init__(self, currency, description=None, daily_limit=None, avatar_uuid=None, status=None, sub_status=None,
+ reason=None, reason_description=None, display_name=None, setting=None):
"""
- :param currency: The currency of the MonetaryAccountJoint as an ISO 4217
+ :param currency: The currency of the MonetaryAccountBank as an ISO 4217
formatted currency code.
:type currency: str
- :param all_co_owner: The users the account will be joint with.
- :type all_co_owner: list[object_.CoOwner]
- :param description: The description of the MonetaryAccountJoint. Defaults to
+ :param description: The description of the MonetaryAccountBank. Defaults to
'bunq account'.
:type description: str
:param daily_limit: The daily spending limit Amount of the
- MonetaryAccountJoint. Defaults to 1000 EUR. Currency must match the
- MonetaryAccountJoint's currency. Limited to 10000 EUR.
+ MonetaryAccountBank. Defaults to 1000 EUR. Currency must match the
+ MonetaryAccountBank's currency. Limited to 10000 EUR.
:type daily_limit: object_.Amount
- :param overdraft_limit: The maximum Amount the MonetaryAccountJoint can be
- 'in the red'. Must be 0 EUR or omitted.
- :type overdraft_limit: object_.Amount
- :param alias: The Aliases to add to MonetaryAccountJoint. Must all be
- confirmed first. Can mostly be ignored.
- :type alias: list[object_.Pointer]
- :param avatar_uuid: The UUID of the Avatar of the MonetaryAccountJoint.
+ :param avatar_uuid: The UUID of the Avatar of the MonetaryAccountBank.
:type avatar_uuid: str
- :param status: The status of the MonetaryAccountJoint. Ignored in POST
+ :param status: The status of the MonetaryAccountBank. Ignored in POST
requests (always set to ACTIVE) can be CANCELLED or PENDING_REOPEN in PUT
- requests to cancel (close) or reopen the MonetaryAccountJoint. When updating
+ requests to cancel (close) or reopen the MonetaryAccountBank. When updating
the status and/or sub_status no other fields can be updated in the same
request (and vice versa).
:type status: str
- :param sub_status: The sub-status of the MonetaryAccountJoint providing
- extra information regarding the status. Should be ignored for POST requests.
- In case of PUT requests with status CANCELLED it can only be
+ :param sub_status: The sub-status of the MonetaryAccountBank providing extra
+ information regarding the status. Should be ignored for POST requests. In
+ case of PUT requests with status CANCELLED it can only be
REDEMPTION_VOLUNTARY, while with status PENDING_REOPEN it can only be NONE.
When updating the status and/or sub_status no other fields can be updated in
the same request (and vice versa).
:type sub_status: str
:param reason: The reason for voluntarily cancelling (closing) the
- MonetaryAccountJoint, can only be OTHER. Should only be specified if
- updating the status to CANCELLED.
+ MonetaryAccountBank, can only be OTHER. Should only be specified if updating
+ the status to CANCELLED.
:type reason: str
:param reason_description: The optional free-form reason for voluntarily
- cancelling (closing) the MonetaryAccountJoint. Can be any user provided
+ cancelling (closing) the MonetaryAccountBank. Can be any user provided
message. Should only be specified if updating the status to CANCELLED.
:type reason_description: str
- :param setting: The settings of the MonetaryAccountJoint.
+ :param display_name: The legal name of the user / company using this
+ monetary account.
+ :type display_name: str
+ :param setting: The settings of the MonetaryAccountBank.
:type setting: object_.MonetaryAccountSetting
"""
self._currency_field_for_request = currency
- self._all_co_owner_field_for_request = all_co_owner
self._description_field_for_request = description
self._daily_limit_field_for_request = daily_limit
- self._overdraft_limit_field_for_request = overdraft_limit
- self._alias_field_for_request = alias
self._avatar_uuid_field_for_request = avatar_uuid
self._status_field_for_request = status
self._sub_status_field_for_request = sub_status
self._reason_field_for_request = reason
self._reason_description_field_for_request = reason_description
+ self._display_name_field_for_request = display_name
self._setting_field_for_request = setting
@classmethod
- def create(cls, currency, all_co_owner, description=None, daily_limit=None, overdraft_limit=None, alias=None,
- avatar_uuid=None, status=None, sub_status=None, reason=None, reason_description=None, setting=None,
- custom_headers=None):
+ def create(cls, currency, description=None, daily_limit=None, avatar_uuid=None, status=None, sub_status=None,
+ reason=None, reason_description=None, display_name=None, setting=None, custom_headers=None):
"""
+ Create new MonetaryAccountBank.
+
:type user_id: int
- :param currency: The currency of the MonetaryAccountJoint as an ISO 4217
+ :param currency: The currency of the MonetaryAccountBank as an ISO 4217
formatted currency code.
:type currency: str
- :param all_co_owner: The users the account will be joint with.
- :type all_co_owner: list[object_.CoOwner]
- :param description: The description of the MonetaryAccountJoint.
- Defaults to 'bunq account'.
+ :param description: The description of the MonetaryAccountBank. Defaults
+ to 'bunq account'.
:type description: str
:param daily_limit: The daily spending limit Amount of the
- MonetaryAccountJoint. Defaults to 1000 EUR. Currency must match the
- MonetaryAccountJoint's currency. Limited to 10000 EUR.
+ MonetaryAccountBank. Defaults to 1000 EUR. Currency must match the
+ MonetaryAccountBank's currency. Limited to 10000 EUR.
:type daily_limit: object_.Amount
- :param overdraft_limit: The maximum Amount the MonetaryAccountJoint can
- be 'in the red'. Must be 0 EUR or omitted.
- :type overdraft_limit: object_.Amount
- :param alias: The Aliases to add to MonetaryAccountJoint. Must all be
- confirmed first. Can mostly be ignored.
- :type alias: list[object_.Pointer]
- :param avatar_uuid: The UUID of the Avatar of the MonetaryAccountJoint.
+ :param avatar_uuid: The UUID of the Avatar of the MonetaryAccountBank.
:type avatar_uuid: str
- :param status: The status of the MonetaryAccountJoint. Ignored in POST
+ :param status: The status of the MonetaryAccountBank. Ignored in POST
requests (always set to ACTIVE) can be CANCELLED or PENDING_REOPEN in
- PUT requests to cancel (close) or reopen the MonetaryAccountJoint. When
+ PUT requests to cancel (close) or reopen the MonetaryAccountBank. When
updating the status and/or sub_status no other fields can be updated in
the same request (and vice versa).
:type status: str
- :param sub_status: The sub-status of the MonetaryAccountJoint providing
+ :param sub_status: The sub-status of the MonetaryAccountBank providing
extra information regarding the status. Should be ignored for POST
requests. In case of PUT requests with status CANCELLED it can only be
REDEMPTION_VOLUNTARY, while with status PENDING_REOPEN it can only be
@@ -18712,14 +19138,17 @@ def create(cls, currency, all_co_owner, description=None, daily_limit=None, over
updated in the same request (and vice versa).
:type sub_status: str
:param reason: The reason for voluntarily cancelling (closing) the
- MonetaryAccountJoint, can only be OTHER. Should only be specified if
+ MonetaryAccountBank, can only be OTHER. Should only be specified if
updating the status to CANCELLED.
:type reason: str
:param reason_description: The optional free-form reason for voluntarily
- cancelling (closing) the MonetaryAccountJoint. Can be any user provided
+ cancelling (closing) the MonetaryAccountBank. Can be any user provided
message. Should only be specified if updating the status to CANCELLED.
:type reason_description: str
- :param setting: The settings of the MonetaryAccountJoint.
+ :param display_name: The legal name of the user / company using this
+ monetary account.
+ :type display_name: str
+ :param setting: The settings of the MonetaryAccountBank.
:type setting: object_.MonetaryAccountSetting
:type custom_headers: dict[str, str]|None
@@ -18733,14 +19162,12 @@ def create(cls, currency, all_co_owner, description=None, daily_limit=None, over
cls.FIELD_CURRENCY: currency,
cls.FIELD_DESCRIPTION: description,
cls.FIELD_DAILY_LIMIT: daily_limit,
- cls.FIELD_OVERDRAFT_LIMIT: overdraft_limit,
- cls.FIELD_ALIAS: alias,
cls.FIELD_AVATAR_UUID: avatar_uuid,
cls.FIELD_STATUS: status,
cls.FIELD_SUB_STATUS: sub_status,
cls.FIELD_REASON: reason,
cls.FIELD_REASON_DESCRIPTION: reason_description,
- cls.FIELD_ALL_CO_OWNER: all_co_owner,
+ cls.FIELD_DISPLAY_NAME: display_name,
cls.FIELD_SETTING: setting
}
request_map_string = converter.class_to_json(request_map)
@@ -18756,49 +19183,54 @@ def create(cls, currency, all_co_owner, description=None, daily_limit=None, over
)
@classmethod
- def get(cls, monetary_account_joint_id, custom_headers=None):
+ def get(cls, monetary_account_bank_id, custom_headers=None):
"""
+ Get a specific MonetaryAccountBank.
+
:type api_context: ApiContext
:type user_id: int
- :type monetary_account_joint_id: int
+ :type monetary_account_bank_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseMonetaryAccountJoint
+ :rtype: BunqResponseMonetaryAccountBank
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), monetary_account_joint_id)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), monetary_account_bank_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseMonetaryAccountJoint.cast_from_bunq_response(
+ return BunqResponseMonetaryAccountBank.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def update(cls, monetary_account_joint_id, description=None, daily_limit=None, avatar_uuid=None, status=None,
- sub_status=None, reason=None, reason_description=None, setting=None, custom_headers=None):
+ def update(cls, monetary_account_bank_id, description=None, daily_limit=None, avatar_uuid=None, status=None,
+ sub_status=None, reason=None, reason_description=None, display_name=None, setting=None,
+ custom_headers=None):
"""
+ Update a specific existing MonetaryAccountBank.
+
:type user_id: int
- :type monetary_account_joint_id: int
- :param description: The description of the MonetaryAccountJoint.
- Defaults to 'bunq account'.
+ :type monetary_account_bank_id: int
+ :param description: The description of the MonetaryAccountBank. Defaults
+ to 'bunq account'.
:type description: str
:param daily_limit: The daily spending limit Amount of the
- MonetaryAccountJoint. Defaults to 1000 EUR. Currency must match the
- MonetaryAccountJoint's currency. Limited to 10000 EUR.
+ MonetaryAccountBank. Defaults to 1000 EUR. Currency must match the
+ MonetaryAccountBank's currency. Limited to 10000 EUR.
:type daily_limit: object_.Amount
- :param avatar_uuid: The UUID of the Avatar of the MonetaryAccountJoint.
+ :param avatar_uuid: The UUID of the Avatar of the MonetaryAccountBank.
:type avatar_uuid: str
- :param status: The status of the MonetaryAccountJoint. Ignored in POST
+ :param status: The status of the MonetaryAccountBank. Ignored in POST
requests (always set to ACTIVE) can be CANCELLED or PENDING_REOPEN in
- PUT requests to cancel (close) or reopen the MonetaryAccountJoint. When
+ PUT requests to cancel (close) or reopen the MonetaryAccountBank. When
updating the status and/or sub_status no other fields can be updated in
the same request (and vice versa).
:type status: str
- :param sub_status: The sub-status of the MonetaryAccountJoint providing
+ :param sub_status: The sub-status of the MonetaryAccountBank providing
extra information regarding the status. Should be ignored for POST
requests. In case of PUT requests with status CANCELLED it can only be
REDEMPTION_VOLUNTARY, while with status PENDING_REOPEN it can only be
@@ -18806,14 +19238,17 @@ def update(cls, monetary_account_joint_id, description=None, daily_limit=None, a
updated in the same request (and vice versa).
:type sub_status: str
:param reason: The reason for voluntarily cancelling (closing) the
- MonetaryAccountJoint, can only be OTHER. Should only be specified if
+ MonetaryAccountBank, can only be OTHER. Should only be specified if
updating the status to CANCELLED.
:type reason: str
:param reason_description: The optional free-form reason for voluntarily
- cancelling (closing) the MonetaryAccountJoint. Can be any user provided
+ cancelling (closing) the MonetaryAccountBank. Can be any user provided
message. Should only be specified if updating the status to CANCELLED.
:type reason_description: str
- :param setting: The settings of the MonetaryAccountJoint.
+ :param display_name: The legal name of the user / company using this
+ monetary account.
+ :type display_name: str
+ :param setting: The settings of the MonetaryAccountBank.
:type setting: object_.MonetaryAccountSetting
:type custom_headers: dict[str, str]|None
@@ -18833,13 +19268,14 @@ def update(cls, monetary_account_joint_id, description=None, daily_limit=None, a
cls.FIELD_SUB_STATUS: sub_status,
cls.FIELD_REASON: reason,
cls.FIELD_REASON_DESCRIPTION: reason_description,
+ cls.FIELD_DISPLAY_NAME: display_name,
cls.FIELD_SETTING: setting
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(), monetary_account_joint_id)
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(), monetary_account_bank_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -18849,11 +19285,13 @@ def update(cls, monetary_account_joint_id, description=None, daily_limit=None, a
@classmethod
def list(cls, params=None, custom_headers=None):
"""
+ Gets a listing of all MonetaryAccountBanks of a given user.
+
:type user_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseMonetaryAccountJointList
+ :rtype: BunqResponseMonetaryAccountBankList
"""
if params is None:
@@ -18866,7 +19304,7 @@ def list(cls, params=None, custom_headers=None):
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseMonetaryAccountJointList.cast_from_bunq_response(
+ return BunqResponseMonetaryAccountBankList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -18990,14 +19428,6 @@ def reason_description(self):
return self._reason_description
- @property
- def all_co_owner(self):
- """
- :rtype: list[object_.CoOwner]
- """
-
- return self._all_co_owner
-
@property
def user_id(self):
"""
@@ -19015,20 +19445,20 @@ def monetary_account_profile(self):
return self._monetary_account_profile
@property
- def setting(self):
+ def display_name(self):
"""
- :rtype: object_.MonetaryAccountSetting
+ :rtype: str
"""
- return self._setting
+ return self._display_name
@property
- def auto_save_id(self):
+ def setting(self):
"""
- :rtype: int
+ :rtype: object_.MonetaryAccountSetting
"""
- return self._auto_save_id
+ return self._setting
@property
def all_auto_save_id(self):
@@ -19088,19 +19518,16 @@ def is_all_field_none(self):
if self._reason_description is not None:
return False
- if self._all_co_owner is not None:
- return False
-
if self._user_id is not None:
return False
if self._monetary_account_profile is not None:
return False
- if self._setting is not None:
+ if self._display_name is not None:
return False
- if self._auto_save_id is not None:
+ if self._setting is not None:
return False
if self._all_auto_save_id is not None:
@@ -19113,90 +19540,160 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: MonetaryAccountJoint
+ :rtype: MonetaryAccountBank
"""
- return converter.json_to_class(MonetaryAccountJoint, json_str)
+ return converter.json_to_class(MonetaryAccountBank, json_str)
-class MonetaryAccountSavings(BunqModel):
+class MonetaryAccountProfile(BunqModel):
"""
- With MonetaryAccountSavings you can create a new savings account.
+ Used to update and read up monetary account profiles, to keep the balance
+ between specific thresholds.
- :param _currency: The currency of the MonetaryAccountSavings as an ISO 4217
+ :param _profile_fill: The profile settings for triggering the fill of a
+ monetary account.
+ :type _profile_fill: object_.MonetaryAccountProfileFill
+ :param _profile_drain: The profile settings for moving excesses to a savings
+ account
+ :type _profile_drain: object_.MonetaryAccountProfileDrain
+ """
+
+ # Field constants.
+ FIELD_PROFILE_FILL = "profile_fill"
+ FIELD_PROFILE_DRAIN = "profile_drain"
+
+ _profile_fill = None
+ _profile_drain = None
+ _profile_fill_field_for_request = None
+ _profile_drain_field_for_request = None
+
+ def __init__(self, profile_fill=None, profile_drain=None):
+ """
+ :param profile_fill: The profile settings for triggering the fill of a
+ monetary account.
+ :type profile_fill: object_.MonetaryAccountProfileFill
+ :param profile_drain: The profile settings for moving excesses to a savings
+ account
+ :type profile_drain: object_.MonetaryAccountProfileDrain
+ """
+
+ self._profile_fill_field_for_request = profile_fill
+ self._profile_drain_field_for_request = profile_drain
+
+ @property
+ def profile_fill(self):
+ """
+ :rtype: object_.MonetaryAccountProfileFill
+ """
+
+ return self._profile_fill
+
+ @property
+ def profile_drain(self):
+ """
+ :rtype: object_.MonetaryAccountProfileDrain
+ """
+
+ return self._profile_drain
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._profile_fill is not None:
+ return False
+
+ if self._profile_drain is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: MonetaryAccountProfile
+ """
+
+ return converter.json_to_class(MonetaryAccountProfile, json_str)
+
+
+class MonetaryAccountJoint(BunqModel):
+ """
+ The endpoint for joint monetary accounts.
+
+ :param _currency: The currency of the MonetaryAccountJoint as an ISO 4217
formatted currency code.
:type _currency: str
- :param _description: The description of the MonetaryAccountSavings. Defaults
+ :param _description: The description of the MonetaryAccountJoint. Defaults
to 'bunq account'.
:type _description: str
:param _daily_limit: The daily spending limit Amount of the
- MonetaryAccountSavings. Defaults to 1000 EUR. Currency must match the
- MonetaryAccountSavings's currency. Limited to 10000 EUR.
+ MonetaryAccountJoint. Defaults to 1000 EUR. Currency must match the
+ MonetaryAccountJoint's currency. Limited to 10000 EUR.
:type _daily_limit: object_.Amount
- :param _avatar_uuid: The UUID of the Avatar of the MonetaryAccountSavings.
+ :param _overdraft_limit: The maximum Amount the MonetaryAccountJoint can be
+ 'in the red'.
+ :type _overdraft_limit: object_.Amount
+ :param _alias: The Aliases for the MonetaryAccountJoint.
+ :type _alias: list[object_.Pointer]
+ :param _avatar_uuid: The UUID of the Avatar of the MonetaryAccountJoint.
:type _avatar_uuid: str
- :param _status: The status of the MonetaryAccountSavings. Can be: ACTIVE,
+ :param _status: The status of the MonetaryAccountJoint. Can be: ACTIVE,
BLOCKED, CANCELLED or PENDING_REOPEN
:type _status: str
- :param _sub_status: The sub-status of the MonetaryAccountSavings providing
+ :param _sub_status: The sub-status of the MonetaryAccountJoint providing
extra information regarding the status. Will be NONE for ACTIVE or
PENDING_REOPEN, COMPLETELY or ONLY_ACCEPTING_INCOMING for BLOCKED and
REDEMPTION_INVOLUNTARY, REDEMPTION_VOLUNTARY or PERMANENT for CANCELLED.
:type _sub_status: str
:param _reason: The reason for voluntarily cancelling (closing) the
- MonetaryAccountSavings, can only be OTHER.
+ MonetaryAccountJoint, can only be OTHER.
:type _reason: str
:param _reason_description: The optional free-form reason for voluntarily
- cancelling (closing) the MonetaryAccountSavings. Can be any user provided
+ cancelling (closing) the MonetaryAccountJoint. Can be any user provided
message.
:type _reason_description: str
:param _all_co_owner: The users the account will be joint with.
:type _all_co_owner: list[object_.CoOwner]
- :param _setting: The settings of the MonetaryAccountSavings.
+ :param _setting: The settings of the MonetaryAccountJoint.
:type _setting: object_.MonetaryAccountSetting
- :param _savings_goal: The Savings Goal set for this MonetaryAccountSavings.
- :type _savings_goal: object_.Amount
- :param _id_: The id of the MonetaryAccountSavings.
+ :param _id_: The id of the MonetaryAccountJoint.
:type _id_: int
- :param _created: The timestamp of the MonetaryAccountSavings's creation.
+ :param _created: The timestamp of the MonetaryAccountJoint's creation.
:type _created: str
- :param _updated: The timestamp of the MonetaryAccountSavings's last update.
+ :param _updated: The timestamp of the MonetaryAccountJoint's last update.
:type _updated: str
- :param _avatar: The Avatar of the MonetaryAccountSavings.
+ :param _avatar: The Avatar of the MonetaryAccountJoint.
:type _avatar: object_.Avatar
- :param _overdraft_limit: The maximum Amount the MonetaryAccountSavings can
- be 'in the red'. Must be 0 EUR or omitted.
- :type _overdraft_limit: object_.Amount
:param _balance: The current available balance Amount of the
- MonetaryAccountSavings.
+ MonetaryAccountJoint.
:type _balance: object_.Amount
- :param _alias: The Aliases for the MonetaryAccountSavings.
- :type _alias: list[object_.Pointer]
- :param _public_uuid: The MonetaryAccountSavings's public UUID.
+ :param _public_uuid: The MonetaryAccountJoint's public UUID.
:type _public_uuid: str
- :param _user_id: The id of the User who owns the MonetaryAccountSavings.
+ :param _user_id: The id of the User who owns the MonetaryAccountJoint.
:type _user_id: int
:param _monetary_account_profile: The profile of the account.
:type _monetary_account_profile: MonetaryAccountProfile
- :param _savings_goal_progress: The progress in percentages for the Savings
- Goal set for this MonetaryAccountSavings.
- :type _savings_goal_progress: float
- :param _auto_save_id: The id of the AutoSave.
- :type _auto_save_id: int
:param _all_auto_save_id: The ids of the AutoSave.
:type _all_auto_save_id: list[object_.BunqId]
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account-savings"
- _ENDPOINT_URL_READ = "user/{}/monetary-account-savings/{}"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account-savings/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account-savings"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account-joint"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account-joint/{}"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account-joint/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account-joint"
# Field constants.
FIELD_CURRENCY = "currency"
FIELD_DESCRIPTION = "description"
FIELD_DAILY_LIMIT = "daily_limit"
+ FIELD_OVERDRAFT_LIMIT = "overdraft_limit"
+ FIELD_ALIAS = "alias"
FIELD_AVATAR_UUID = "avatar_uuid"
FIELD_STATUS = "status"
FIELD_SUB_STATUS = "sub_status"
@@ -19204,10 +19701,9 @@ class MonetaryAccountSavings(BunqModel):
FIELD_REASON_DESCRIPTION = "reason_description"
FIELD_ALL_CO_OWNER = "all_co_owner"
FIELD_SETTING = "setting"
- FIELD_SAVINGS_GOAL = "savings_goal"
# Object type.
- _OBJECT_TYPE_GET = "MonetaryAccountSavings"
+ _OBJECT_TYPE_GET = "MonetaryAccountJoint"
_id_ = None
_created = None
@@ -19228,13 +19724,12 @@ class MonetaryAccountSavings(BunqModel):
_user_id = None
_monetary_account_profile = None
_setting = None
- _savings_goal = None
- _savings_goal_progress = None
- _auto_save_id = None
_all_auto_save_id = None
_currency_field_for_request = None
_description_field_for_request = None
_daily_limit_field_for_request = None
+ _overdraft_limit_field_for_request = None
+ _alias_field_for_request = None
_avatar_uuid_field_for_request = None
_status_field_for_request = None
_sub_status_field_for_request = None
@@ -19242,30 +19737,37 @@ class MonetaryAccountSavings(BunqModel):
_reason_description_field_for_request = None
_all_co_owner_field_for_request = None
_setting_field_for_request = None
- _savings_goal_field_for_request = None
- def __init__(self, currency, description=None, daily_limit=None, avatar_uuid=None, status=None, sub_status=None,
- reason=None, reason_description=None, all_co_owner=None, setting=None, savings_goal=None):
+ def __init__(self, currency, all_co_owner, description=None, daily_limit=None, overdraft_limit=None, alias=None,
+ avatar_uuid=None, status=None, sub_status=None, reason=None, reason_description=None, setting=None):
"""
- :param currency: The currency of the MonetaryAccountSavings as an ISO 4217
+ :param currency: The currency of the MonetaryAccountJoint as an ISO 4217
formatted currency code.
:type currency: str
- :param description: The description of the MonetaryAccountSavings. Defaults
- to 'bunq account'.
+ :param all_co_owner: The users the account will be joint with.
+ :type all_co_owner: list[object_.CoOwner]
+ :param description: The description of the MonetaryAccountJoint. Defaults to
+ 'bunq account'.
:type description: str
:param daily_limit: The daily spending limit Amount of the
- MonetaryAccountSavings. Defaults to 1000 EUR. Currency must match the
- MonetaryAccountSavings's currency. Limited to 10000 EUR.
+ MonetaryAccountJoint. Defaults to 1000 EUR. Currency must match the
+ MonetaryAccountJoint's currency. Limited to 10000 EUR.
:type daily_limit: object_.Amount
- :param avatar_uuid: The UUID of the Avatar of the MonetaryAccountSavings.
+ :param overdraft_limit: The maximum Amount the MonetaryAccountJoint can be
+ 'in the red'. Must be 0 EUR or omitted.
+ :type overdraft_limit: object_.Amount
+ :param alias: The Aliases to add to MonetaryAccountJoint. Must all be
+ confirmed first. Can mostly be ignored.
+ :type alias: list[object_.Pointer]
+ :param avatar_uuid: The UUID of the Avatar of the MonetaryAccountJoint.
:type avatar_uuid: str
- :param status: The status of the MonetaryAccountSavings. Ignored in POST
+ :param status: The status of the MonetaryAccountJoint. Ignored in POST
requests (always set to ACTIVE) can be CANCELLED or PENDING_REOPEN in PUT
- requests to cancel (close) or reopen the MonetaryAccountSavings. When
- updating the status and/or sub_status no other fields can be updated in the
- same request (and vice versa).
+ requests to cancel (close) or reopen the MonetaryAccountJoint. When updating
+ the status and/or sub_status no other fields can be updated in the same
+ request (and vice versa).
:type status: str
- :param sub_status: The sub-status of the MonetaryAccountSavings providing
+ :param sub_status: The sub-status of the MonetaryAccountJoint providing
extra information regarding the status. Should be ignored for POST requests.
In case of PUT requests with status CANCELLED it can only be
REDEMPTION_VOLUNTARY, while with status PENDING_REOPEN it can only be NONE.
@@ -19273,83 +19775,79 @@ def __init__(self, currency, description=None, daily_limit=None, avatar_uuid=Non
the same request (and vice versa).
:type sub_status: str
:param reason: The reason for voluntarily cancelling (closing) the
- MonetaryAccountSavings, can only be OTHER. Should only be specified if
+ MonetaryAccountJoint, can only be OTHER. Should only be specified if
updating the status to CANCELLED.
:type reason: str
:param reason_description: The optional free-form reason for voluntarily
- cancelling (closing) the MonetaryAccountSavings. Can be any user provided
+ cancelling (closing) the MonetaryAccountJoint. Can be any user provided
message. Should only be specified if updating the status to CANCELLED.
:type reason_description: str
- :param all_co_owner: The users the account will be joint with.
- :type all_co_owner: list[object_.CoOwner]
- :param setting: The settings of the MonetaryAccountSavings.
+ :param setting: The settings of the MonetaryAccountJoint.
:type setting: object_.MonetaryAccountSetting
- :param savings_goal: The Savings Goal set for this MonetaryAccountSavings.
- :type savings_goal: object_.Amount
"""
self._currency_field_for_request = currency
+ self._all_co_owner_field_for_request = all_co_owner
self._description_field_for_request = description
self._daily_limit_field_for_request = daily_limit
+ self._overdraft_limit_field_for_request = overdraft_limit
+ self._alias_field_for_request = alias
self._avatar_uuid_field_for_request = avatar_uuid
self._status_field_for_request = status
self._sub_status_field_for_request = sub_status
self._reason_field_for_request = reason
self._reason_description_field_for_request = reason_description
- self._all_co_owner_field_for_request = all_co_owner
self._setting_field_for_request = setting
- self._savings_goal_field_for_request = savings_goal
@classmethod
- def create(cls, currency, description=None, daily_limit=None, avatar_uuid=None, status=None, sub_status=None,
- reason=None, reason_description=None, all_co_owner=None, setting=None, savings_goal=None,
+ def create(cls, currency, all_co_owner, description=None, daily_limit=None, overdraft_limit=None, alias=None,
+ avatar_uuid=None, status=None, sub_status=None, reason=None, reason_description=None, setting=None,
custom_headers=None):
"""
- Create new MonetaryAccountSavings.
-
:type user_id: int
- :param currency: The currency of the MonetaryAccountSavings as an ISO
- 4217 formatted currency code.
+ :param currency: The currency of the MonetaryAccountJoint as an ISO 4217
+ formatted currency code.
:type currency: str
- :param description: The description of the MonetaryAccountSavings.
+ :param all_co_owner: The users the account will be joint with.
+ :type all_co_owner: list[object_.CoOwner]
+ :param description: The description of the MonetaryAccountJoint.
Defaults to 'bunq account'.
:type description: str
:param daily_limit: The daily spending limit Amount of the
- MonetaryAccountSavings. Defaults to 1000 EUR. Currency must match the
- MonetaryAccountSavings's currency. Limited to 10000 EUR.
+ MonetaryAccountJoint. Defaults to 1000 EUR. Currency must match the
+ MonetaryAccountJoint's currency. Limited to 10000 EUR.
:type daily_limit: object_.Amount
- :param avatar_uuid: The UUID of the Avatar of the
- MonetaryAccountSavings.
+ :param overdraft_limit: The maximum Amount the MonetaryAccountJoint can
+ be 'in the red'. Must be 0 EUR or omitted.
+ :type overdraft_limit: object_.Amount
+ :param alias: The Aliases to add to MonetaryAccountJoint. Must all be
+ confirmed first. Can mostly be ignored.
+ :type alias: list[object_.Pointer]
+ :param avatar_uuid: The UUID of the Avatar of the MonetaryAccountJoint.
:type avatar_uuid: str
- :param status: The status of the MonetaryAccountSavings. Ignored in POST
+ :param status: The status of the MonetaryAccountJoint. Ignored in POST
requests (always set to ACTIVE) can be CANCELLED or PENDING_REOPEN in
- PUT requests to cancel (close) or reopen the MonetaryAccountSavings.
- When updating the status and/or sub_status no other fields can be
- updated in the same request (and vice versa).
+ PUT requests to cancel (close) or reopen the MonetaryAccountJoint. When
+ updating the status and/or sub_status no other fields can be updated in
+ the same request (and vice versa).
:type status: str
- :param sub_status: The sub-status of the MonetaryAccountSavings
- providing extra information regarding the status. Should be ignored for
- POST requests. In case of PUT requests with status CANCELLED it can only
- be REDEMPTION_VOLUNTARY, while with status PENDING_REOPEN it can only be
+ :param sub_status: The sub-status of the MonetaryAccountJoint providing
+ extra information regarding the status. Should be ignored for POST
+ requests. In case of PUT requests with status CANCELLED it can only be
+ REDEMPTION_VOLUNTARY, while with status PENDING_REOPEN it can only be
NONE. When updating the status and/or sub_status no other fields can be
updated in the same request (and vice versa).
:type sub_status: str
:param reason: The reason for voluntarily cancelling (closing) the
- MonetaryAccountSavings, can only be OTHER. Should only be specified if
+ MonetaryAccountJoint, can only be OTHER. Should only be specified if
updating the status to CANCELLED.
:type reason: str
:param reason_description: The optional free-form reason for voluntarily
- cancelling (closing) the MonetaryAccountSavings. Can be any user
- provided message. Should only be specified if updating the status to
- CANCELLED.
+ cancelling (closing) the MonetaryAccountJoint. Can be any user provided
+ message. Should only be specified if updating the status to CANCELLED.
:type reason_description: str
- :param all_co_owner: The users the account will be joint with.
- :type all_co_owner: list[object_.CoOwner]
- :param setting: The settings of the MonetaryAccountSavings.
+ :param setting: The settings of the MonetaryAccountJoint.
:type setting: object_.MonetaryAccountSetting
- :param savings_goal: The Savings Goal set for this
- MonetaryAccountSavings.
- :type savings_goal: object_.Amount
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -19362,14 +19860,15 @@ def create(cls, currency, description=None, daily_limit=None, avatar_uuid=None,
cls.FIELD_CURRENCY: currency,
cls.FIELD_DESCRIPTION: description,
cls.FIELD_DAILY_LIMIT: daily_limit,
+ cls.FIELD_OVERDRAFT_LIMIT: overdraft_limit,
+ cls.FIELD_ALIAS: alias,
cls.FIELD_AVATAR_UUID: avatar_uuid,
cls.FIELD_STATUS: status,
cls.FIELD_SUB_STATUS: sub_status,
cls.FIELD_REASON: reason,
cls.FIELD_REASON_DESCRIPTION: reason_description,
cls.FIELD_ALL_CO_OWNER: all_co_owner,
- cls.FIELD_SETTING: setting,
- cls.FIELD_SAVINGS_GOAL: savings_goal
+ cls.FIELD_SETTING: setting
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
@@ -19384,75 +19883,65 @@ def create(cls, currency, description=None, daily_limit=None, avatar_uuid=None,
)
@classmethod
- def get(cls, monetary_account_savings_id, custom_headers=None):
+ def get(cls, monetary_account_joint_id, custom_headers=None):
"""
- Get a specific MonetaryAccountSavings.
-
:type api_context: ApiContext
:type user_id: int
- :type monetary_account_savings_id: int
+ :type monetary_account_joint_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseMonetaryAccountSavings
+ :rtype: BunqResponseMonetaryAccountJoint
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), monetary_account_savings_id)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), monetary_account_joint_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseMonetaryAccountSavings.cast_from_bunq_response(
+ return BunqResponseMonetaryAccountJoint.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def update(cls, monetary_account_savings_id, description=None, daily_limit=None, avatar_uuid=None, status=None,
- sub_status=None, reason=None, reason_description=None, setting=None, savings_goal=None,
- custom_headers=None):
+ def update(cls, monetary_account_joint_id, description=None, daily_limit=None, avatar_uuid=None, status=None,
+ sub_status=None, reason=None, reason_description=None, setting=None, custom_headers=None):
"""
- Update a specific existing MonetaryAccountSavings.
-
:type user_id: int
- :type monetary_account_savings_id: int
- :param description: The description of the MonetaryAccountSavings.
+ :type monetary_account_joint_id: int
+ :param description: The description of the MonetaryAccountJoint.
Defaults to 'bunq account'.
:type description: str
:param daily_limit: The daily spending limit Amount of the
- MonetaryAccountSavings. Defaults to 1000 EUR. Currency must match the
- MonetaryAccountSavings's currency. Limited to 10000 EUR.
+ MonetaryAccountJoint. Defaults to 1000 EUR. Currency must match the
+ MonetaryAccountJoint's currency. Limited to 10000 EUR.
:type daily_limit: object_.Amount
- :param avatar_uuid: The UUID of the Avatar of the
- MonetaryAccountSavings.
+ :param avatar_uuid: The UUID of the Avatar of the MonetaryAccountJoint.
:type avatar_uuid: str
- :param status: The status of the MonetaryAccountSavings. Ignored in POST
+ :param status: The status of the MonetaryAccountJoint. Ignored in POST
requests (always set to ACTIVE) can be CANCELLED or PENDING_REOPEN in
- PUT requests to cancel (close) or reopen the MonetaryAccountSavings.
- When updating the status and/or sub_status no other fields can be
- updated in the same request (and vice versa).
+ PUT requests to cancel (close) or reopen the MonetaryAccountJoint. When
+ updating the status and/or sub_status no other fields can be updated in
+ the same request (and vice versa).
:type status: str
- :param sub_status: The sub-status of the MonetaryAccountSavings
- providing extra information regarding the status. Should be ignored for
- POST requests. In case of PUT requests with status CANCELLED it can only
- be REDEMPTION_VOLUNTARY, while with status PENDING_REOPEN it can only be
+ :param sub_status: The sub-status of the MonetaryAccountJoint providing
+ extra information regarding the status. Should be ignored for POST
+ requests. In case of PUT requests with status CANCELLED it can only be
+ REDEMPTION_VOLUNTARY, while with status PENDING_REOPEN it can only be
NONE. When updating the status and/or sub_status no other fields can be
updated in the same request (and vice versa).
:type sub_status: str
:param reason: The reason for voluntarily cancelling (closing) the
- MonetaryAccountSavings, can only be OTHER. Should only be specified if
+ MonetaryAccountJoint, can only be OTHER. Should only be specified if
updating the status to CANCELLED.
:type reason: str
:param reason_description: The optional free-form reason for voluntarily
- cancelling (closing) the MonetaryAccountSavings. Can be any user
- provided message. Should only be specified if updating the status to
- CANCELLED.
+ cancelling (closing) the MonetaryAccountJoint. Can be any user provided
+ message. Should only be specified if updating the status to CANCELLED.
:type reason_description: str
- :param setting: The settings of the MonetaryAccountSavings.
+ :param setting: The settings of the MonetaryAccountJoint.
:type setting: object_.MonetaryAccountSetting
- :param savings_goal: The Savings Goal set for this
- MonetaryAccountSavings.
- :type savings_goal: object_.Amount
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -19471,14 +19960,13 @@ def update(cls, monetary_account_savings_id, description=None, daily_limit=None,
cls.FIELD_SUB_STATUS: sub_status,
cls.FIELD_REASON: reason,
cls.FIELD_REASON_DESCRIPTION: reason_description,
- cls.FIELD_SETTING: setting,
- cls.FIELD_SAVINGS_GOAL: savings_goal
+ cls.FIELD_SETTING: setting
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(), monetary_account_savings_id)
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(), monetary_account_joint_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -19488,13 +19976,11 @@ def update(cls, monetary_account_savings_id, description=None, daily_limit=None,
@classmethod
def list(cls, params=None, custom_headers=None):
"""
- Gets a listing of all MonetaryAccountSavingss of a given user.
-
:type user_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseMonetaryAccountSavingsList
+ :rtype: BunqResponseMonetaryAccountJointList
"""
if params is None:
@@ -19507,7 +19993,7 @@ def list(cls, params=None, custom_headers=None):
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseMonetaryAccountSavingsList.cast_from_bunq_response(
+ return BunqResponseMonetaryAccountJointList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -19663,30 +20149,6 @@ def setting(self):
return self._setting
- @property
- def savings_goal(self):
- """
- :rtype: object_.Amount
- """
-
- return self._savings_goal
-
- @property
- def savings_goal_progress(self):
- """
- :rtype: float
- """
-
- return self._savings_goal_progress
-
- @property
- def auto_save_id(self):
- """
- :rtype: int
- """
-
- return self._auto_save_id
-
@property
def all_auto_save_id(self):
"""
@@ -19757,15 +20219,6 @@ def is_all_field_none(self):
if self._setting is not None:
return False
- if self._savings_goal is not None:
- return False
-
- if self._savings_goal_progress is not None:
- return False
-
- if self._auto_save_id is not None:
- return False
-
if self._all_auto_save_id is not None:
return False
@@ -19776,254 +20229,84 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: MonetaryAccountSavings
- """
-
- return converter.json_to_class(MonetaryAccountSavings, json_str)
-
-
-class MonetaryAccount(BunqModel, AnchorObjectInterface):
- """
- Used to show the MonetaryAccounts that you can access. Currently the only
- MonetaryAccount type is MonetaryAccountBank. See also:
- monetary-account-bank.
Notification filters can be set on a
- monetary account level to receive callbacks. For more information check the
- dedicated callbacks page.
-
- :param _MonetaryAccountBank:
- :type _MonetaryAccountBank: MonetaryAccountBank
- :param _MonetaryAccountJoint:
- :type _MonetaryAccountJoint: MonetaryAccountJoint
- :param _MonetaryAccountLight:
- :type _MonetaryAccountLight: MonetaryAccountLight
- :param _MonetaryAccountSavings:
- :type _MonetaryAccountSavings: MonetaryAccountSavings
- """
-
- # Error constants.
- _ERROR_NULL_FIELDS = "All fields of an extended model or object are null."
-
- # Endpoint constants.
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account"
-
- # Object type.
- _OBJECT_TYPE_GET = "MonetaryAccount"
-
- _MonetaryAccountBank = None
- _MonetaryAccountJoint = None
- _MonetaryAccountLight = None
- _MonetaryAccountSavings = None
-
- @classmethod
- def get(cls, monetary_account_id, custom_headers=None):
- """
- Get a specific MonetaryAccount.
-
- :type api_context: ApiContext
- :type user_id: int
- :type monetary_account_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseMonetaryAccount
- """
-
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
-
- return BunqResponseMonetaryAccount.cast_from_bunq_response(
- cls._from_json(response_raw)
- )
-
- @classmethod
- def list(cls, params=None, custom_headers=None):
- """
- Get a collection of all your MonetaryAccounts.
-
- :type user_id: int
- :type params: dict[str, str]|None
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseMonetaryAccountList
- """
-
- if params is None:
- params = {}
-
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
- response_raw = api_client.get(endpoint_url, params, custom_headers)
-
- return BunqResponseMonetaryAccountList.cast_from_bunq_response(
- cls._from_json_list(response_raw)
- )
-
- @property
- def MonetaryAccountBank(self):
- """
- :rtype: MonetaryAccountBank
- """
-
- return self._MonetaryAccountBank
-
- @property
- def MonetaryAccountJoint(self):
- """
:rtype: MonetaryAccountJoint
"""
- return self._MonetaryAccountJoint
-
- @property
- def MonetaryAccountLight(self):
- """
- :rtype: MonetaryAccountLight
- """
-
- return self._MonetaryAccountLight
-
- @property
- def MonetaryAccountSavings(self):
- """
- :rtype: MonetaryAccountSavings
- """
-
- return self._MonetaryAccountSavings
-
- def get_referenced_object(self):
- """
- :rtype: BunqModel
- :raise: BunqException
- """
-
- if self._MonetaryAccountBank is not None:
- return self._MonetaryAccountBank
-
- if self._MonetaryAccountJoint is not None:
- return self._MonetaryAccountJoint
-
- if self._MonetaryAccountLight is not None:
- return self._MonetaryAccountLight
-
- if self._MonetaryAccountSavings is not None:
- return self._MonetaryAccountSavings
-
- raise BunqException(self._ERROR_NULL_FIELDS)
-
- def is_all_field_none(self):
- """
- :rtype: bool
- """
-
- if self._MonetaryAccountBank is not None:
- return False
-
- if self._MonetaryAccountJoint is not None:
- return False
-
- if self._MonetaryAccountLight is not None:
- return False
-
- if self._MonetaryAccountSavings is not None:
- return False
-
- return True
-
- @staticmethod
- def from_json(json_str):
- """
- :type json_str: str
-
- :rtype: MonetaryAccount
- """
-
- return converter.json_to_class(MonetaryAccount, json_str)
+ return converter.json_to_class(MonetaryAccountJoint, json_str)
-class MonetaryAccountLight(BunqModel):
+class MonetaryAccountSavings(BunqModel):
"""
- With MonetaryAccountLight is a monetary account for bunq light users.
- Through this endpoint you can retrieve information regarding your existing
- MonetaryAccountLights and update specific fields of an existing
- MonetaryAccountLight. Examples of fields that can be updated are the
- description, the daily limit and the avatar of the account.
+ With MonetaryAccountSavings you can create a new savings account.
- :param _currency: The currency of the MonetaryAccountLight as an ISO 4217
+ :param _currency: The currency of the MonetaryAccountSavings as an ISO 4217
formatted currency code.
:type _currency: str
- :param _description: The description of the MonetaryAccountLight. Defaults
+ :param _description: The description of the MonetaryAccountSavings. Defaults
to 'bunq account'.
:type _description: str
:param _daily_limit: The daily spending limit Amount of the
- MonetaryAccountLight. Defaults to 1000 EUR. Currency must match the
- MonetaryAccountLight's currency. Limited to 10000 EUR.
+ MonetaryAccountSavings. Defaults to 1000 EUR. Currency must match the
+ MonetaryAccountSavings's currency. Limited to 10000 EUR.
:type _daily_limit: object_.Amount
- :param _avatar_uuid: The UUID of the Avatar of the MonetaryAccountLight.
+ :param _avatar_uuid: The UUID of the Avatar of the MonetaryAccountSavings.
:type _avatar_uuid: str
- :param _status: The status of the MonetaryAccountLight. Can be: ACTIVE,
+ :param _status: The status of the MonetaryAccountSavings. Can be: ACTIVE,
BLOCKED, CANCELLED or PENDING_REOPEN
:type _status: str
- :param _sub_status: The sub-status of the MonetaryAccountLight providing
+ :param _sub_status: The sub-status of the MonetaryAccountSavings providing
extra information regarding the status. Will be NONE for ACTIVE or
PENDING_REOPEN, COMPLETELY or ONLY_ACCEPTING_INCOMING for BLOCKED and
REDEMPTION_INVOLUNTARY, REDEMPTION_VOLUNTARY or PERMANENT for CANCELLED.
:type _sub_status: str
:param _reason: The reason for voluntarily cancelling (closing) the
- MonetaryAccountBank, can only be OTHER.
+ MonetaryAccountSavings, can only be OTHER.
:type _reason: str
:param _reason_description: The optional free-form reason for voluntarily
- cancelling (closing) the MonetaryAccountBank. Can be any user provided
+ cancelling (closing) the MonetaryAccountSavings. Can be any user provided
message.
:type _reason_description: str
- :param _setting: The settings of the MonetaryAccountLight.
+ :param _all_co_owner: The users the account will be joint with.
+ :type _all_co_owner: list[object_.CoOwner]
+ :param _setting: The settings of the MonetaryAccountSavings.
:type _setting: object_.MonetaryAccountSetting
- :param _id_: The id of the MonetaryAccountLight.
+ :param _savings_goal: The Savings Goal set for this MonetaryAccountSavings.
+ :type _savings_goal: object_.Amount
+ :param _id_: The id of the MonetaryAccountSavings.
:type _id_: int
- :param _created: The timestamp of the MonetaryAccountLight's creation.
+ :param _created: The timestamp of the MonetaryAccountSavings's creation.
:type _created: str
- :param _updated: The timestamp of the MonetaryAccountLight's last update.
+ :param _updated: The timestamp of the MonetaryAccountSavings's last update.
:type _updated: str
- :param _avatar: The Avatar of the MonetaryAccountLight.
+ :param _avatar: The Avatar of the MonetaryAccountSavings.
:type _avatar: object_.Avatar
+ :param _overdraft_limit: The maximum Amount the MonetaryAccountSavings can
+ be 'in the red'. Must be 0 EUR or omitted.
+ :type _overdraft_limit: object_.Amount
:param _balance: The current available balance Amount of the
- MonetaryAccountLight.
+ MonetaryAccountSavings.
:type _balance: object_.Amount
- :param _balance_real: The current real balance Amount of the
- MonetaryAccountLight.
- :type _balance_real: object_.Amount
- :param _alias: The Aliases for the MonetaryAccountLight.
+ :param _alias: The Aliases for the MonetaryAccountSavings.
:type _alias: list[object_.Pointer]
- :param _public_uuid: The MonetaryAccountLight's public UUID.
+ :param _public_uuid: The MonetaryAccountSavings's public UUID.
:type _public_uuid: str
- :param _user_id: The id of the User who owns the MonetaryAccountLight.
+ :param _user_id: The id of the User who owns the MonetaryAccountSavings.
:type _user_id: int
- :param _balance_maximum: The maximum balance Amount of the
- MonetaryAccountLight.
- :type _balance_maximum: object_.Amount
- :param _budget_month_used: The amount of the monthly budget used.
- :type _budget_month_used: object_.Amount
- :param _budget_month_maximum: The total amount of the monthly budget.
- :type _budget_month_maximum: object_.Amount
- :param _budget_year_used: The amount of the yearly budget used.
- :type _budget_year_used: object_.Amount
- :param _budget_year_maximum: The total amount of the yearly budget.
- :type _budget_year_maximum: object_.Amount
- :param _budget_withdrawal_year_used: The amount of the yearly withdrawal
- budget used.
- :type _budget_withdrawal_year_used: object_.Amount
- :param _budget_withdrawal_year_maximum: The total amount of the yearly
- withdrawal budget.
- :type _budget_withdrawal_year_maximum: object_.Amount
+ :param _monetary_account_profile: The profile of the account.
+ :type _monetary_account_profile: MonetaryAccountProfile
+ :param _savings_goal_progress: The progress in percentages for the Savings
+ Goal set for this MonetaryAccountSavings.
+ :type _savings_goal_progress: float
+ :param _all_auto_save_id: The ids of the AutoSave.
+ :type _all_auto_save_id: list[object_.BunqId]
"""
+ # Endpoint constants.
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account-savings"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account-savings/{}"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account-savings/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account-savings"
+
# Field constants.
FIELD_CURRENCY = "currency"
FIELD_DESCRIPTION = "description"
@@ -20033,7 +20316,12 @@ class MonetaryAccountLight(BunqModel):
FIELD_SUB_STATUS = "sub_status"
FIELD_REASON = "reason"
FIELD_REASON_DESCRIPTION = "reason_description"
+ FIELD_ALL_CO_OWNER = "all_co_owner"
FIELD_SETTING = "setting"
+ FIELD_SAVINGS_GOAL = "savings_goal"
+
+ # Object type.
+ _OBJECT_TYPE_GET = "MonetaryAccountSavings"
_id_ = None
_created = None
@@ -20042,23 +20330,21 @@ class MonetaryAccountLight(BunqModel):
_currency = None
_description = None
_daily_limit = None
+ _overdraft_limit = None
_balance = None
- _balance_real = None
_alias = None
_public_uuid = None
_status = None
_sub_status = None
_reason = None
_reason_description = None
+ _all_co_owner = None
_user_id = None
- _balance_maximum = None
- _budget_month_used = None
- _budget_month_maximum = None
- _budget_year_used = None
- _budget_year_maximum = None
- _budget_withdrawal_year_used = None
- _budget_withdrawal_year_maximum = None
+ _monetary_account_profile = None
_setting = None
+ _savings_goal = None
+ _savings_goal_progress = None
+ _all_auto_save_id = None
_currency_field_for_request = None
_description_field_for_request = None
_daily_limit_field_for_request = None
@@ -20067,45 +20353,52 @@ class MonetaryAccountLight(BunqModel):
_sub_status_field_for_request = None
_reason_field_for_request = None
_reason_description_field_for_request = None
+ _all_co_owner_field_for_request = None
_setting_field_for_request = None
+ _savings_goal_field_for_request = None
def __init__(self, currency, description=None, daily_limit=None, avatar_uuid=None, status=None, sub_status=None,
- reason=None, reason_description=None, setting=None):
+ reason=None, reason_description=None, all_co_owner=None, setting=None, savings_goal=None):
"""
- :param currency: The currency of the MonetaryAccountLight as an ISO 4217
+ :param currency: The currency of the MonetaryAccountSavings as an ISO 4217
formatted currency code.
:type currency: str
- :param description: The description of the MonetaryAccountLight. Defaults to
- 'bunq account'.
+ :param description: The description of the MonetaryAccountSavings. Defaults
+ to 'bunq account'.
:type description: str
:param daily_limit: The daily spending limit Amount of the
- MonetaryAccountLight. Defaults to 1000 EUR. Currency must match the
- MonetaryAccountLight's currency. Limited to 10000 EUR.
+ MonetaryAccountSavings. Defaults to 1000 EUR. Currency must match the
+ MonetaryAccountSavings's currency. Limited to 10000 EUR.
:type daily_limit: object_.Amount
- :param avatar_uuid: The UUID of the Avatar of the MonetaryAccountLight.
+ :param avatar_uuid: The UUID of the Avatar of the MonetaryAccountSavings.
:type avatar_uuid: str
- :param status: The status of the MonetaryAccountLight. Ignored in POST
+ :param status: The status of the MonetaryAccountSavings. Ignored in POST
requests (always set to ACTIVE) can be CANCELLED or PENDING_REOPEN in PUT
- requests to cancel (close) or reopen the MonetaryAccountLight. When updating
- the status and/or sub_status no other fields can be updated in the same
- request (and vice versa).
+ requests to cancel (close) or reopen the MonetaryAccountSavings. When
+ updating the status and/or sub_status no other fields can be updated in the
+ same request (and vice versa).
:type status: str
- :param sub_status: The sub-status of the MonetaryAccountLight providing
- extra information regarding the status. Should be ignored for POST requests
- and can only be REDEMPTION_VOLUNTARY for PUT requests with status CANCELLED.
+ :param sub_status: The sub-status of the MonetaryAccountSavings providing
+ extra information regarding the status. Should be ignored for POST requests.
+ In case of PUT requests with status CANCELLED it can only be
+ REDEMPTION_VOLUNTARY, while with status PENDING_REOPEN it can only be NONE.
When updating the status and/or sub_status no other fields can be updated in
the same request (and vice versa).
:type sub_status: str
:param reason: The reason for voluntarily cancelling (closing) the
- MonetaryAccountBank, can only be OTHER. Should only be specified if updating
- the status to CANCELLED.
+ MonetaryAccountSavings, can only be OTHER. Should only be specified if
+ updating the status to CANCELLED.
:type reason: str
:param reason_description: The optional free-form reason for voluntarily
- cancelling (closing) the MonetaryAccountBank. Can be any user provided
+ cancelling (closing) the MonetaryAccountSavings. Can be any user provided
message. Should only be specified if updating the status to CANCELLED.
:type reason_description: str
- :param setting: The settings of the MonetaryAccountLight.
+ :param all_co_owner: The users the account will be joint with.
+ :type all_co_owner: list[object_.CoOwner]
+ :param setting: The settings of the MonetaryAccountSavings.
:type setting: object_.MonetaryAccountSetting
+ :param savings_goal: The Savings Goal set for this MonetaryAccountSavings.
+ :type savings_goal: object_.Amount
"""
self._currency_field_for_request = currency
@@ -20116,47 +20409,260 @@ def __init__(self, currency, description=None, daily_limit=None, avatar_uuid=Non
self._sub_status_field_for_request = sub_status
self._reason_field_for_request = reason
self._reason_description_field_for_request = reason_description
+ self._all_co_owner_field_for_request = all_co_owner
self._setting_field_for_request = setting
+ self._savings_goal_field_for_request = savings_goal
- @property
- def id_(self):
+ @classmethod
+ def create(cls, currency, description=None, daily_limit=None, avatar_uuid=None, status=None, sub_status=None,
+ reason=None, reason_description=None, all_co_owner=None, setting=None, savings_goal=None,
+ custom_headers=None):
"""
- :rtype: int
+ Create new MonetaryAccountSavings.
+
+ :type user_id: int
+ :param currency: The currency of the MonetaryAccountSavings as an ISO
+ 4217 formatted currency code.
+ :type currency: str
+ :param description: The description of the MonetaryAccountSavings.
+ Defaults to 'bunq account'.
+ :type description: str
+ :param daily_limit: The daily spending limit Amount of the
+ MonetaryAccountSavings. Defaults to 1000 EUR. Currency must match the
+ MonetaryAccountSavings's currency. Limited to 10000 EUR.
+ :type daily_limit: object_.Amount
+ :param avatar_uuid: The UUID of the Avatar of the
+ MonetaryAccountSavings.
+ :type avatar_uuid: str
+ :param status: The status of the MonetaryAccountSavings. Ignored in POST
+ requests (always set to ACTIVE) can be CANCELLED or PENDING_REOPEN in
+ PUT requests to cancel (close) or reopen the MonetaryAccountSavings.
+ When updating the status and/or sub_status no other fields can be
+ updated in the same request (and vice versa).
+ :type status: str
+ :param sub_status: The sub-status of the MonetaryAccountSavings
+ providing extra information regarding the status. Should be ignored for
+ POST requests. In case of PUT requests with status CANCELLED it can only
+ be REDEMPTION_VOLUNTARY, while with status PENDING_REOPEN it can only be
+ NONE. When updating the status and/or sub_status no other fields can be
+ updated in the same request (and vice versa).
+ :type sub_status: str
+ :param reason: The reason for voluntarily cancelling (closing) the
+ MonetaryAccountSavings, can only be OTHER. Should only be specified if
+ updating the status to CANCELLED.
+ :type reason: str
+ :param reason_description: The optional free-form reason for voluntarily
+ cancelling (closing) the MonetaryAccountSavings. Can be any user
+ provided message. Should only be specified if updating the status to
+ CANCELLED.
+ :type reason_description: str
+ :param all_co_owner: The users the account will be joint with.
+ :type all_co_owner: list[object_.CoOwner]
+ :param setting: The settings of the MonetaryAccountSavings.
+ :type setting: object_.MonetaryAccountSetting
+ :param savings_goal: The Savings Goal set for this
+ MonetaryAccountSavings.
+ :type savings_goal: object_.Amount
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
"""
- return self._id_
+ if custom_headers is None:
+ custom_headers = {}
- @property
- def created(self):
- """
- :rtype: str
- """
+ request_map = {
+ cls.FIELD_CURRENCY: currency,
+ cls.FIELD_DESCRIPTION: description,
+ cls.FIELD_DAILY_LIMIT: daily_limit,
+ cls.FIELD_AVATAR_UUID: avatar_uuid,
+ cls.FIELD_STATUS: status,
+ cls.FIELD_SUB_STATUS: sub_status,
+ cls.FIELD_REASON: reason,
+ cls.FIELD_REASON_DESCRIPTION: reason_description,
+ cls.FIELD_ALL_CO_OWNER: all_co_owner,
+ cls.FIELD_SETTING: setting,
+ cls.FIELD_SAVINGS_GOAL: savings_goal
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
- return self._created
+ api_client = ApiClient(cls._get_api_context())
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
- @property
- def updated(self):
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
+
+ @classmethod
+ def get(cls, monetary_account_savings_id, custom_headers=None):
"""
- :rtype: str
+ Get a specific MonetaryAccountSavings.
+
+ :type api_context: ApiContext
+ :type user_id: int
+ :type monetary_account_savings_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseMonetaryAccountSavings
"""
- return self._updated
+ if custom_headers is None:
+ custom_headers = {}
- @property
- def avatar(self):
- """
- :rtype: object_.Avatar
- """
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), monetary_account_savings_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return self._avatar
+ return BunqResponseMonetaryAccountSavings.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
- @property
- def currency(self):
+ @classmethod
+ def update(cls, monetary_account_savings_id, description=None, daily_limit=None, avatar_uuid=None, status=None,
+ sub_status=None, reason=None, reason_description=None, setting=None, savings_goal=None,
+ custom_headers=None):
"""
- :rtype: str
+ Update a specific existing MonetaryAccountSavings.
+
+ :type user_id: int
+ :type monetary_account_savings_id: int
+ :param description: The description of the MonetaryAccountSavings.
+ Defaults to 'bunq account'.
+ :type description: str
+ :param daily_limit: The daily spending limit Amount of the
+ MonetaryAccountSavings. Defaults to 1000 EUR. Currency must match the
+ MonetaryAccountSavings's currency. Limited to 10000 EUR.
+ :type daily_limit: object_.Amount
+ :param avatar_uuid: The UUID of the Avatar of the
+ MonetaryAccountSavings.
+ :type avatar_uuid: str
+ :param status: The status of the MonetaryAccountSavings. Ignored in POST
+ requests (always set to ACTIVE) can be CANCELLED or PENDING_REOPEN in
+ PUT requests to cancel (close) or reopen the MonetaryAccountSavings.
+ When updating the status and/or sub_status no other fields can be
+ updated in the same request (and vice versa).
+ :type status: str
+ :param sub_status: The sub-status of the MonetaryAccountSavings
+ providing extra information regarding the status. Should be ignored for
+ POST requests. In case of PUT requests with status CANCELLED it can only
+ be REDEMPTION_VOLUNTARY, while with status PENDING_REOPEN it can only be
+ NONE. When updating the status and/or sub_status no other fields can be
+ updated in the same request (and vice versa).
+ :type sub_status: str
+ :param reason: The reason for voluntarily cancelling (closing) the
+ MonetaryAccountSavings, can only be OTHER. Should only be specified if
+ updating the status to CANCELLED.
+ :type reason: str
+ :param reason_description: The optional free-form reason for voluntarily
+ cancelling (closing) the MonetaryAccountSavings. Can be any user
+ provided message. Should only be specified if updating the status to
+ CANCELLED.
+ :type reason_description: str
+ :param setting: The settings of the MonetaryAccountSavings.
+ :type setting: object_.MonetaryAccountSetting
+ :param savings_goal: The Savings Goal set for this
+ MonetaryAccountSavings.
+ :type savings_goal: object_.Amount
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
"""
- return self._currency
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+
+ request_map = {
+ cls.FIELD_DESCRIPTION: description,
+ cls.FIELD_DAILY_LIMIT: daily_limit,
+ cls.FIELD_AVATAR_UUID: avatar_uuid,
+ cls.FIELD_STATUS: status,
+ cls.FIELD_SUB_STATUS: sub_status,
+ cls.FIELD_REASON: reason,
+ cls.FIELD_REASON_DESCRIPTION: reason_description,
+ cls.FIELD_SETTING: setting,
+ cls.FIELD_SAVINGS_GOAL: savings_goal
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(), monetary_account_savings_id)
+ response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
+
+ @classmethod
+ def list(cls, params=None, custom_headers=None):
+ """
+ Gets a listing of all MonetaryAccountSavingss of a given user.
+
+ :type user_id: int
+ :type params: dict[str, str]|None
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseMonetaryAccountSavingsList
+ """
+
+ if params is None:
+ params = {}
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
+
+ return BunqResponseMonetaryAccountSavingsList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @property
+ def id_(self):
+ """
+ :rtype: int
+ """
+
+ return self._id_
+
+ @property
+ def created(self):
+ """
+ :rtype: str
+ """
+
+ return self._created
+
+ @property
+ def updated(self):
+ """
+ :rtype: str
+ """
+
+ return self._updated
+
+ @property
+ def avatar(self):
+ """
+ :rtype: object_.Avatar
+ """
+
+ return self._avatar
+
+ @property
+ def currency(self):
+ """
+ :rtype: str
+ """
+
+ return self._currency
@property
def description(self):
@@ -20175,20 +20681,20 @@ def daily_limit(self):
return self._daily_limit
@property
- def balance(self):
+ def overdraft_limit(self):
"""
:rtype: object_.Amount
"""
- return self._balance
+ return self._overdraft_limit
@property
- def balance_real(self):
+ def balance(self):
"""
:rtype: object_.Amount
"""
- return self._balance_real
+ return self._balance
@property
def alias(self):
@@ -20239,76 +20745,60 @@ def reason_description(self):
return self._reason_description
@property
- def user_id(self):
- """
- :rtype: int
- """
-
- return self._user_id
-
- @property
- def balance_maximum(self):
- """
- :rtype: object_.Amount
- """
-
- return self._balance_maximum
-
- @property
- def budget_month_used(self):
+ def all_co_owner(self):
"""
- :rtype: object_.Amount
+ :rtype: list[object_.CoOwner]
"""
- return self._budget_month_used
+ return self._all_co_owner
@property
- def budget_month_maximum(self):
+ def user_id(self):
"""
- :rtype: object_.Amount
+ :rtype: int
"""
- return self._budget_month_maximum
+ return self._user_id
@property
- def budget_year_used(self):
+ def monetary_account_profile(self):
"""
- :rtype: object_.Amount
+ :rtype: MonetaryAccountProfile
"""
- return self._budget_year_used
+ return self._monetary_account_profile
@property
- def budget_year_maximum(self):
+ def setting(self):
"""
- :rtype: object_.Amount
+ :rtype: object_.MonetaryAccountSetting
"""
- return self._budget_year_maximum
+ return self._setting
@property
- def budget_withdrawal_year_used(self):
+ def savings_goal(self):
"""
:rtype: object_.Amount
"""
- return self._budget_withdrawal_year_used
+ return self._savings_goal
@property
- def budget_withdrawal_year_maximum(self):
+ def savings_goal_progress(self):
"""
- :rtype: object_.Amount
+ :rtype: float
"""
- return self._budget_withdrawal_year_maximum
+ return self._savings_goal_progress
@property
- def setting(self):
+ def all_auto_save_id(self):
"""
- :rtype: object_.MonetaryAccountSetting
+ :rtype: list[object_.BunqId]
"""
- return self._setting
+ return self._all_auto_save_id
def is_all_field_none(self):
"""
@@ -20336,10 +20826,10 @@ def is_all_field_none(self):
if self._daily_limit is not None:
return False
- if self._balance is not None:
+ if self._overdraft_limit is not None:
return False
- if self._balance_real is not None:
+ if self._balance is not None:
return False
if self._alias is not None:
@@ -20360,31 +20850,25 @@ def is_all_field_none(self):
if self._reason_description is not None:
return False
- if self._user_id is not None:
- return False
-
- if self._balance_maximum is not None:
- return False
-
- if self._budget_month_used is not None:
+ if self._all_co_owner is not None:
return False
- if self._budget_month_maximum is not None:
+ if self._user_id is not None:
return False
- if self._budget_year_used is not None:
+ if self._monetary_account_profile is not None:
return False
- if self._budget_year_maximum is not None:
+ if self._setting is not None:
return False
- if self._budget_withdrawal_year_used is not None:
+ if self._savings_goal is not None:
return False
- if self._budget_withdrawal_year_maximum is not None:
+ if self._savings_goal_progress is not None:
return False
- if self._setting is not None:
+ if self._all_auto_save_id is not None:
return False
return True
@@ -20394,185 +20878,80 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: MonetaryAccountLight
+ :rtype: MonetaryAccountSavings
"""
- return converter.json_to_class(MonetaryAccountLight, json_str)
+ return converter.json_to_class(MonetaryAccountSavings, json_str)
-class NoteAttachmentBankSwitchServiceNetherlandsIncomingPayment(BunqModel):
+class MonetaryAccount(BunqModel, AnchorObjectInterface):
"""
- Used to manage attachment notes.
+ Used to show the MonetaryAccounts that you can access. Currently the only
+ MonetaryAccount type is MonetaryAccountBank. See also:
+ monetary-account-bank.
Notification filters can be set on a
+ monetary account level to receive callbacks. For more information check the
+ dedicated callbacks page.
- :param _description: Optional description of the attachment.
- :type _description: str
- :param _attachment_id: The reference to the uploaded file to attach to this
- note.
- :type _attachment_id: int
- :param _id_: The id of the note.
- :type _id_: int
- :param _created: The timestamp of the note's creation.
- :type _created: str
- :param _updated: The timestamp of the note's last update.
- :type _updated: str
- :param _label_user_creator: The label of the user who created this note.
- :type _label_user_creator: object_.LabelUser
- :param _attachment: The attachment attached to the note.
- :type _attachment: list[object_.AttachmentMonetaryAccountPayment]
+ :param _MonetaryAccountBank:
+ :type _MonetaryAccountBank: MonetaryAccountBank
+ :param _MonetaryAccountJoint:
+ :type _MonetaryAccountJoint: MonetaryAccountJoint
+ :param _MonetaryAccountLight:
+ :type _MonetaryAccountLight: MonetaryAccountLight
+ :param _MonetaryAccountSavings:
+ :type _MonetaryAccountSavings: MonetaryAccountSavings
"""
- # Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/switch-service-payment/{}/note-attachment"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/switch-service-payment/{}/note-attachment/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/switch-service-payment/{}/note-attachment/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/switch-service-payment/{}/note-attachment"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/switch-service-payment/{}/note-attachment/{}"
+ # Error constants.
+ _ERROR_NULL_FIELDS = "All fields of an extended model or object are null."
- # Field constants.
- FIELD_DESCRIPTION = "description"
- FIELD_ATTACHMENT_ID = "attachment_id"
+ # Endpoint constants.
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account"
# Object type.
- _OBJECT_TYPE_GET = "NoteAttachment"
-
- _id_ = None
- _created = None
- _updated = None
- _label_user_creator = None
- _description = None
- _attachment = None
- _description_field_for_request = None
- _attachment_id_field_for_request = None
-
- def __init__(self, attachment_id, description=None):
- """
- :param attachment_id: The reference to the uploaded file to attach to this
- note.
- :type attachment_id: int
- :param description: Optional description of the attachment.
- :type description: str
- """
-
- self._attachment_id_field_for_request = attachment_id
- self._description_field_for_request = description
-
- @classmethod
- def create(cls, switch_service_payment_id, attachment_id, monetary_account_id=None, description=None,
- custom_headers=None):
- """
- :type user_id: int
- :type monetary_account_id: int
- :type switch_service_payment_id: int
- :param attachment_id: The reference to the uploaded file to attach to
- this note.
- :type attachment_id: int
- :param description: Optional description of the attachment.
- :type description: str
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseInt
- """
-
- if custom_headers is None:
- custom_headers = {}
-
- request_map = {
- cls.FIELD_DESCRIPTION: description,
- cls.FIELD_ATTACHMENT_ID: attachment_id
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
-
- api_client = ApiClient(cls._get_api_context())
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- switch_service_payment_id)
- response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+ _OBJECT_TYPE_GET = "MonetaryAccount"
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
- )
+ _MonetaryAccountBank = None
+ _MonetaryAccountJoint = None
+ _MonetaryAccountLight = None
+ _MonetaryAccountSavings = None
@classmethod
- def update(cls, switch_service_payment_id, note_attachment_bank_switch_service_netherlands_incoming_payment_id,
- monetary_account_id=None, description=None, custom_headers=None):
+ def get(cls, monetary_account_id, custom_headers=None):
"""
- :type user_id: int
- :type monetary_account_id: int
- :type switch_service_payment_id: int
- :type
- note_attachment_bank_switch_service_netherlands_incoming_payment_id: int
- :param description: Optional description of the attachment.
- :type description: str
- :type custom_headers: dict[str, str]|None
+ Get a specific MonetaryAccount.
- :rtype: BunqResponseInt
- """
-
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
-
- request_map = {
- cls.FIELD_DESCRIPTION: description
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
-
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- switch_service_payment_id,
- note_attachment_bank_switch_service_netherlands_incoming_payment_id)
- response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
-
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
- )
-
- @classmethod
- def delete(cls, switch_service_payment_id, note_attachment_bank_switch_service_netherlands_incoming_payment_id,
- monetary_account_id=None, custom_headers=None):
- """
+ :type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type switch_service_payment_id: int
- :type
- note_attachment_bank_switch_service_netherlands_incoming_payment_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNone
+ :rtype: BunqResponseMonetaryAccount
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- switch_service_payment_id,
- note_attachment_bank_switch_service_netherlands_incoming_payment_id)
- response_raw = api_client.delete(endpoint_url, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id))
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNone.cast_from_bunq_response(
- BunqResponse(None, response_raw.headers)
+ return BunqResponseMonetaryAccount.cast_from_bunq_response(
+ cls._from_json(response_raw)
)
@classmethod
- def list(cls, switch_service_payment_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, params=None, custom_headers=None):
"""
- Manage the notes for a given user.
+ Get a collection of all your MonetaryAccounts.
:type user_id: int
- :type monetary_account_id: int
- :type switch_service_payment_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype:
- BunqResponseNoteAttachmentBankSwitchServiceNetherlandsIncomingPaymentList
+ :rtype: BunqResponseMonetaryAccountList
"""
if params is None:
@@ -20582,114 +20961,80 @@ def list(cls, switch_service_payment_id, monetary_account_id=None, params=None,
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- switch_service_payment_id)
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteAttachmentBankSwitchServiceNetherlandsIncomingPaymentList.cast_from_bunq_response(
- cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ return BunqResponseMonetaryAccountList.cast_from_bunq_response(
+ cls._from_json_list(response_raw)
)
- @classmethod
- def get(cls, switch_service_payment_id, note_attachment_bank_switch_service_netherlands_incoming_payment_id,
- monetary_account_id=None, custom_headers=None):
+ @property
+ def MonetaryAccountBank(self):
"""
- :type api_context: ApiContext
- :type user_id: int
- :type monetary_account_id: int
- :type switch_service_payment_id: int
- :type
- note_attachment_bank_switch_service_netherlands_incoming_payment_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype:
- BunqResponseNoteAttachmentBankSwitchServiceNetherlandsIncomingPayment
+ :rtype: MonetaryAccountBank
"""
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- switch_service_payment_id,
- note_attachment_bank_switch_service_netherlands_incoming_payment_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
-
- return BunqResponseNoteAttachmentBankSwitchServiceNetherlandsIncomingPayment.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
- )
+ return self._MonetaryAccountBank
@property
- def id_(self):
+ def MonetaryAccountJoint(self):
"""
- :rtype: int
+ :rtype: MonetaryAccountJoint
"""
- return self._id_
+ return self._MonetaryAccountJoint
@property
- def created(self):
+ def MonetaryAccountLight(self):
"""
- :rtype: str
+ :rtype: MonetaryAccountLight
"""
- return self._created
+ return self._MonetaryAccountLight
@property
- def updated(self):
+ def MonetaryAccountSavings(self):
"""
- :rtype: str
+ :rtype: MonetaryAccountSavings
"""
- return self._updated
+ return self._MonetaryAccountSavings
- @property
- def label_user_creator(self):
+ def get_referenced_object(self):
"""
- :rtype: object_.LabelUser
+ :rtype: BunqModel
+ :raise: BunqException
"""
- return self._label_user_creator
+ if self._MonetaryAccountBank is not None:
+ return self._MonetaryAccountBank
- @property
- def description(self):
- """
- :rtype: str
- """
+ if self._MonetaryAccountJoint is not None:
+ return self._MonetaryAccountJoint
- return self._description
+ if self._MonetaryAccountLight is not None:
+ return self._MonetaryAccountLight
- @property
- def attachment(self):
- """
- :rtype: list[object_.AttachmentMonetaryAccountPayment]
- """
+ if self._MonetaryAccountSavings is not None:
+ return self._MonetaryAccountSavings
- return self._attachment
+ raise BunqException(self._ERROR_NULL_FIELDS)
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._id_ is not None:
- return False
-
- if self._created is not None:
- return False
-
- if self._updated is not None:
+ if self._MonetaryAccountBank is not None:
return False
- if self._label_user_creator is not None:
+ if self._MonetaryAccountJoint is not None:
return False
- if self._description is not None:
+ if self._MonetaryAccountLight is not None:
return False
- if self._attachment is not None:
+ if self._MonetaryAccountSavings is not None:
return False
return True
@@ -20699,251 +21044,361 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteAttachmentBankSwitchServiceNetherlandsIncomingPayment
+ :rtype: MonetaryAccount
"""
- return converter.json_to_class(NoteAttachmentBankSwitchServiceNetherlandsIncomingPayment, json_str)
+ return converter.json_to_class(MonetaryAccount, json_str)
-class NoteTextBankSwitchServiceNetherlandsIncomingPayment(BunqModel):
+class MonetaryAccountLight(BunqModel):
"""
- Used to manage text notes.
+ With MonetaryAccountLight is a monetary account for bunq light users.
+ Through this endpoint you can retrieve information regarding your existing
+ MonetaryAccountLights and update specific fields of an existing
+ MonetaryAccountLight. Examples of fields that can be updated are the
+ description, the daily limit and the avatar of the account.
- :param _content: The content of the note.
- :type _content: str
- :param _id_: The id of the note.
+ :param _currency: The currency of the MonetaryAccountLight as an ISO 4217
+ formatted currency code.
+ :type _currency: str
+ :param _description: The description of the MonetaryAccountLight. Defaults
+ to 'bunq account'.
+ :type _description: str
+ :param _daily_limit: The daily spending limit Amount of the
+ MonetaryAccountLight. Defaults to 1000 EUR. Currency must match the
+ MonetaryAccountLight's currency. Limited to 10000 EUR.
+ :type _daily_limit: object_.Amount
+ :param _avatar_uuid: The UUID of the Avatar of the MonetaryAccountLight.
+ :type _avatar_uuid: str
+ :param _status: The status of the MonetaryAccountLight. Can be: ACTIVE,
+ BLOCKED, CANCELLED or PENDING_REOPEN
+ :type _status: str
+ :param _sub_status: The sub-status of the MonetaryAccountLight providing
+ extra information regarding the status. Will be NONE for ACTIVE or
+ PENDING_REOPEN, COMPLETELY or ONLY_ACCEPTING_INCOMING for BLOCKED and
+ REDEMPTION_INVOLUNTARY, REDEMPTION_VOLUNTARY or PERMANENT for CANCELLED.
+ :type _sub_status: str
+ :param _reason: The reason for voluntarily cancelling (closing) the
+ MonetaryAccountBank, can only be OTHER.
+ :type _reason: str
+ :param _reason_description: The optional free-form reason for voluntarily
+ cancelling (closing) the MonetaryAccountBank. Can be any user provided
+ message.
+ :type _reason_description: str
+ :param _setting: The settings of the MonetaryAccountLight.
+ :type _setting: object_.MonetaryAccountSetting
+ :param _id_: The id of the MonetaryAccountLight.
:type _id_: int
- :param _created: The timestamp of the note's creation.
+ :param _created: The timestamp of the MonetaryAccountLight's creation.
:type _created: str
- :param _updated: The timestamp of the note's last update.
+ :param _updated: The timestamp of the MonetaryAccountLight's last update.
:type _updated: str
- :param _label_user_creator: The label of the user who created this note.
- :type _label_user_creator: object_.LabelUser
- """
-
- # Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/switch-service-payment/{}/note-text"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/switch-service-payment/{}/note-text/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/switch-service-payment/{}/note-text/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/switch-service-payment/{}/note-text"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/switch-service-payment/{}/note-text/{}"
+ :param _avatar: The Avatar of the MonetaryAccountLight.
+ :type _avatar: object_.Avatar
+ :param _balance: The current available balance Amount of the
+ MonetaryAccountLight.
+ :type _balance: object_.Amount
+ :param _alias: The Aliases for the MonetaryAccountLight.
+ :type _alias: list[object_.Pointer]
+ :param _public_uuid: The MonetaryAccountLight's public UUID.
+ :type _public_uuid: str
+ :param _user_id: The id of the User who owns the MonetaryAccountLight.
+ :type _user_id: int
+ :param _balance_maximum: The maximum balance Amount of the
+ MonetaryAccountLight.
+ :type _balance_maximum: object_.Amount
+ :param _budget_month_used: The amount of the monthly budget used.
+ :type _budget_month_used: object_.Amount
+ :param _budget_month_maximum: The total amount of the monthly budget.
+ :type _budget_month_maximum: object_.Amount
+ :param _budget_year_used: The amount of the yearly budget used.
+ :type _budget_year_used: object_.Amount
+ :param _budget_year_maximum: The total amount of the yearly budget.
+ :type _budget_year_maximum: object_.Amount
+ :param _budget_withdrawal_year_used: The amount of the yearly withdrawal
+ budget used.
+ :type _budget_withdrawal_year_used: object_.Amount
+ :param _budget_withdrawal_year_maximum: The total amount of the yearly
+ withdrawal budget.
+ :type _budget_withdrawal_year_maximum: object_.Amount
+ """
# Field constants.
- FIELD_CONTENT = "content"
-
- # Object type.
- _OBJECT_TYPE_GET = "NoteText"
+ FIELD_CURRENCY = "currency"
+ FIELD_DESCRIPTION = "description"
+ FIELD_DAILY_LIMIT = "daily_limit"
+ FIELD_AVATAR_UUID = "avatar_uuid"
+ FIELD_STATUS = "status"
+ FIELD_SUB_STATUS = "sub_status"
+ FIELD_REASON = "reason"
+ FIELD_REASON_DESCRIPTION = "reason_description"
+ FIELD_SETTING = "setting"
_id_ = None
_created = None
_updated = None
- _label_user_creator = None
- _content = None
- _content_field_for_request = None
+ _avatar = None
+ _currency = None
+ _description = None
+ _daily_limit = None
+ _balance = None
+ _alias = None
+ _public_uuid = None
+ _status = None
+ _sub_status = None
+ _reason = None
+ _reason_description = None
+ _user_id = None
+ _balance_maximum = None
+ _budget_month_used = None
+ _budget_month_maximum = None
+ _budget_year_used = None
+ _budget_year_maximum = None
+ _budget_withdrawal_year_used = None
+ _budget_withdrawal_year_maximum = None
+ _setting = None
+ _currency_field_for_request = None
+ _description_field_for_request = None
+ _daily_limit_field_for_request = None
+ _avatar_uuid_field_for_request = None
+ _status_field_for_request = None
+ _sub_status_field_for_request = None
+ _reason_field_for_request = None
+ _reason_description_field_for_request = None
+ _setting_field_for_request = None
- def __init__(self, content=None):
+ def __init__(self, currency, description=None, daily_limit=None, avatar_uuid=None, status=None, sub_status=None,
+ reason=None, reason_description=None, setting=None):
"""
- :param content: The content of the note.
- :type content: str
+ :param currency: The currency of the MonetaryAccountLight as an ISO 4217
+ formatted currency code.
+ :type currency: str
+ :param description: The description of the MonetaryAccountLight. Defaults to
+ 'bunq account'.
+ :type description: str
+ :param daily_limit: The daily spending limit Amount of the
+ MonetaryAccountLight. Defaults to 1000 EUR. Currency must match the
+ MonetaryAccountLight's currency. Limited to 10000 EUR.
+ :type daily_limit: object_.Amount
+ :param avatar_uuid: The UUID of the Avatar of the MonetaryAccountLight.
+ :type avatar_uuid: str
+ :param status: The status of the MonetaryAccountLight. Ignored in POST
+ requests (always set to ACTIVE) can be CANCELLED or PENDING_REOPEN in PUT
+ requests to cancel (close) or reopen the MonetaryAccountLight. When updating
+ the status and/or sub_status no other fields can be updated in the same
+ request (and vice versa).
+ :type status: str
+ :param sub_status: The sub-status of the MonetaryAccountLight providing
+ extra information regarding the status. Should be ignored for POST requests
+ and can only be REDEMPTION_VOLUNTARY for PUT requests with status CANCELLED.
+ When updating the status and/or sub_status no other fields can be updated in
+ the same request (and vice versa).
+ :type sub_status: str
+ :param reason: The reason for voluntarily cancelling (closing) the
+ MonetaryAccountBank, can only be OTHER. Should only be specified if updating
+ the status to CANCELLED.
+ :type reason: str
+ :param reason_description: The optional free-form reason for voluntarily
+ cancelling (closing) the MonetaryAccountBank. Can be any user provided
+ message. Should only be specified if updating the status to CANCELLED.
+ :type reason_description: str
+ :param setting: The settings of the MonetaryAccountLight.
+ :type setting: object_.MonetaryAccountSetting
"""
- self._content_field_for_request = content
+ self._currency_field_for_request = currency
+ self._description_field_for_request = description
+ self._daily_limit_field_for_request = daily_limit
+ self._avatar_uuid_field_for_request = avatar_uuid
+ self._status_field_for_request = status
+ self._sub_status_field_for_request = sub_status
+ self._reason_field_for_request = reason
+ self._reason_description_field_for_request = reason_description
+ self._setting_field_for_request = setting
- @classmethod
- def create(cls, switch_service_payment_id, monetary_account_id=None, content=None, custom_headers=None):
+ @property
+ def id_(self):
"""
- :type user_id: int
- :type monetary_account_id: int
- :type switch_service_payment_id: int
- :param content: The content of the note.
- :type content: str
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseInt
+ :rtype: int
"""
- if custom_headers is None:
- custom_headers = {}
+ return self._id_
- request_map = {
- cls.FIELD_CONTENT: content
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
+ @property
+ def created(self):
+ """
+ :rtype: str
+ """
- api_client = ApiClient(cls._get_api_context())
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- switch_service_payment_id)
- response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+ return self._created
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
- )
+ @property
+ def updated(self):
+ """
+ :rtype: str
+ """
- @classmethod
- def update(cls, switch_service_payment_id, note_text_bank_switch_service_netherlands_incoming_payment_id,
- monetary_account_id=None, content=None, custom_headers=None):
+ return self._updated
+
+ @property
+ def avatar(self):
"""
- :type user_id: int
- :type monetary_account_id: int
- :type switch_service_payment_id: int
- :type note_text_bank_switch_service_netherlands_incoming_payment_id: int
- :param content: The content of the note.
- :type content: str
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseInt
+ :rtype: object_.Avatar
"""
- if custom_headers is None:
- custom_headers = {}
+ return self._avatar
- api_client = ApiClient(cls._get_api_context())
+ @property
+ def currency(self):
+ """
+ :rtype: str
+ """
- request_map = {
- cls.FIELD_CONTENT: content
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
+ return self._currency
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- switch_service_payment_id,
- note_text_bank_switch_service_netherlands_incoming_payment_id)
- response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+ @property
+ def description(self):
+ """
+ :rtype: str
+ """
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
- )
+ return self._description
- @classmethod
- def delete(cls, switch_service_payment_id, note_text_bank_switch_service_netherlands_incoming_payment_id,
- monetary_account_id=None, custom_headers=None):
+ @property
+ def daily_limit(self):
"""
- :type user_id: int
- :type monetary_account_id: int
- :type switch_service_payment_id: int
- :type note_text_bank_switch_service_netherlands_incoming_payment_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseNone
+ :rtype: object_.Amount
"""
- if custom_headers is None:
- custom_headers = {}
+ return self._daily_limit
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- switch_service_payment_id,
- note_text_bank_switch_service_netherlands_incoming_payment_id)
- response_raw = api_client.delete(endpoint_url, custom_headers)
+ @property
+ def balance(self):
+ """
+ :rtype: object_.Amount
+ """
- return BunqResponseNone.cast_from_bunq_response(
- BunqResponse(None, response_raw.headers)
- )
+ return self._balance
- @classmethod
- def list(cls, switch_service_payment_id, monetary_account_id=None, params=None, custom_headers=None):
+ @property
+ def alias(self):
"""
- Manage the notes for a given user.
-
- :type user_id: int
- :type monetary_account_id: int
- :type switch_service_payment_id: int
- :type params: dict[str, str]|None
- :type custom_headers: dict[str, str]|None
-
- :rtype:
- BunqResponseNoteTextBankSwitchServiceNetherlandsIncomingPaymentList
+ :rtype: list[object_.Pointer]
"""
- if params is None:
- params = {}
+ return self._alias
- if custom_headers is None:
- custom_headers = {}
+ @property
+ def public_uuid(self):
+ """
+ :rtype: str
+ """
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- switch_service_payment_id)
- response_raw = api_client.get(endpoint_url, params, custom_headers)
+ return self._public_uuid
- return BunqResponseNoteTextBankSwitchServiceNetherlandsIncomingPaymentList.cast_from_bunq_response(
- cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
- )
+ @property
+ def status(self):
+ """
+ :rtype: str
+ """
- @classmethod
- def get(cls, switch_service_payment_id, note_text_bank_switch_service_netherlands_incoming_payment_id,
- monetary_account_id=None, custom_headers=None):
+ return self._status
+
+ @property
+ def sub_status(self):
"""
- :type api_context: ApiContext
- :type user_id: int
- :type monetary_account_id: int
- :type switch_service_payment_id: int
- :type note_text_bank_switch_service_netherlands_incoming_payment_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseNoteTextBankSwitchServiceNetherlandsIncomingPayment
+ :rtype: str
"""
- if custom_headers is None:
- custom_headers = {}
+ return self._sub_status
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- switch_service_payment_id,
- note_text_bank_switch_service_netherlands_incoming_payment_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
+ @property
+ def reason(self):
+ """
+ :rtype: str
+ """
- return BunqResponseNoteTextBankSwitchServiceNetherlandsIncomingPayment.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
- )
+ return self._reason
@property
- def id_(self):
+ def reason_description(self):
+ """
+ :rtype: str
+ """
+
+ return self._reason_description
+
+ @property
+ def user_id(self):
"""
:rtype: int
"""
- return self._id_
+ return self._user_id
@property
- def created(self):
+ def balance_maximum(self):
"""
- :rtype: str
+ :rtype: object_.Amount
"""
- return self._created
+ return self._balance_maximum
@property
- def updated(self):
+ def budget_month_used(self):
"""
- :rtype: str
+ :rtype: object_.Amount
"""
- return self._updated
+ return self._budget_month_used
@property
- def label_user_creator(self):
+ def budget_month_maximum(self):
"""
- :rtype: object_.LabelUser
+ :rtype: object_.Amount
"""
- return self._label_user_creator
+ return self._budget_month_maximum
@property
- def content(self):
+ def budget_year_used(self):
"""
- :rtype: str
+ :rtype: object_.Amount
"""
- return self._content
+ return self._budget_year_used
+
+ @property
+ def budget_year_maximum(self):
+ """
+ :rtype: object_.Amount
+ """
+
+ return self._budget_year_maximum
+
+ @property
+ def budget_withdrawal_year_used(self):
+ """
+ :rtype: object_.Amount
+ """
+
+ return self._budget_withdrawal_year_used
+
+ @property
+ def budget_withdrawal_year_maximum(self):
+ """
+ :rtype: object_.Amount
+ """
+
+ return self._budget_withdrawal_year_maximum
+
+ @property
+ def setting(self):
+ """
+ :rtype: object_.MonetaryAccountSetting
+ """
+
+ return self._setting
def is_all_field_none(self):
"""
@@ -20959,10 +21414,64 @@ def is_all_field_none(self):
if self._updated is not None:
return False
- if self._label_user_creator is not None:
+ if self._avatar is not None:
return False
- if self._content is not None:
+ if self._currency is not None:
+ return False
+
+ if self._description is not None:
+ return False
+
+ if self._daily_limit is not None:
+ return False
+
+ if self._balance is not None:
+ return False
+
+ if self._alias is not None:
+ return False
+
+ if self._public_uuid is not None:
+ return False
+
+ if self._status is not None:
+ return False
+
+ if self._sub_status is not None:
+ return False
+
+ if self._reason is not None:
+ return False
+
+ if self._reason_description is not None:
+ return False
+
+ if self._user_id is not None:
+ return False
+
+ if self._balance_maximum is not None:
+ return False
+
+ if self._budget_month_used is not None:
+ return False
+
+ if self._budget_month_maximum is not None:
+ return False
+
+ if self._budget_year_used is not None:
+ return False
+
+ if self._budget_year_maximum is not None:
+ return False
+
+ if self._budget_withdrawal_year_used is not None:
+ return False
+
+ if self._budget_withdrawal_year_maximum is not None:
+ return False
+
+ if self._setting is not None:
return False
return True
@@ -20972,13 +21481,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteTextBankSwitchServiceNetherlandsIncomingPayment
+ :rtype: MonetaryAccountLight
"""
- return converter.json_to_class(NoteTextBankSwitchServiceNetherlandsIncomingPayment, json_str)
+ return converter.json_to_class(MonetaryAccountLight, json_str)
-class NoteAttachmentBunqMeFundraiserResult(BunqModel):
+class NoteAttachmentBankSwitchServiceNetherlandsIncomingPayment(BunqModel):
"""
Used to manage attachment notes.
@@ -21000,11 +21509,11 @@ class NoteAttachmentBunqMeFundraiserResult(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/bunqme-fundraiser-result/{}/note-attachment"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/bunqme-fundraiser-result/{}/note-attachment/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/bunqme-fundraiser-result/{}/note-attachment/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/bunqme-fundraiser-result/{}/note-attachment"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/bunqme-fundraiser-result/{}/note-attachment/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/switch-service-payment/{}/note-attachment"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/switch-service-payment/{}/note-attachment/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/switch-service-payment/{}/note-attachment/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/switch-service-payment/{}/note-attachment"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/switch-service-payment/{}/note-attachment/{}"
# Field constants.
FIELD_DESCRIPTION = "description"
@@ -21035,12 +21544,12 @@ def __init__(self, attachment_id, description=None):
self._description_field_for_request = description
@classmethod
- def create(cls, bunqme_fundraiser_result_id, attachment_id, monetary_account_id=None, description=None,
+ def create(cls, switch_service_payment_id, attachment_id, monetary_account_id=None, description=None,
custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type bunqme_fundraiser_result_id: int
+ :type switch_service_payment_id: int
:param attachment_id: The reference to the uploaded file to attach to
this note.
:type attachment_id: int
@@ -21065,7 +21574,7 @@ def create(cls, bunqme_fundraiser_result_id, attachment_id, monetary_account_id=
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- bunqme_fundraiser_result_id)
+ switch_service_payment_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -21073,13 +21582,14 @@ def create(cls, bunqme_fundraiser_result_id, attachment_id, monetary_account_id=
)
@classmethod
- def update(cls, bunqme_fundraiser_result_id, note_attachment_bunq_me_fundraiser_result_id, monetary_account_id=None,
- description=None, custom_headers=None):
+ def update(cls, switch_service_payment_id, note_attachment_bank_switch_service_netherlands_incoming_payment_id,
+ monetary_account_id=None, description=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type bunqme_fundraiser_result_id: int
- :type note_attachment_bunq_me_fundraiser_result_id: int
+ :type switch_service_payment_id: int
+ :type
+ note_attachment_bank_switch_service_netherlands_incoming_payment_id: int
:param description: Optional description of the attachment.
:type description: str
:type custom_headers: dict[str, str]|None
@@ -21101,8 +21611,8 @@ def update(cls, bunqme_fundraiser_result_id, note_attachment_bunq_me_fundraiser_
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- bunqme_fundraiser_result_id,
- note_attachment_bunq_me_fundraiser_result_id)
+ switch_service_payment_id,
+ note_attachment_bank_switch_service_netherlands_incoming_payment_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -21110,13 +21620,14 @@ def update(cls, bunqme_fundraiser_result_id, note_attachment_bunq_me_fundraiser_
)
@classmethod
- def delete(cls, bunqme_fundraiser_result_id, note_attachment_bunq_me_fundraiser_result_id, monetary_account_id=None,
- custom_headers=None):
+ def delete(cls, switch_service_payment_id, note_attachment_bank_switch_service_netherlands_incoming_payment_id,
+ monetary_account_id=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type bunqme_fundraiser_result_id: int
- :type note_attachment_bunq_me_fundraiser_result_id: int
+ :type switch_service_payment_id: int
+ :type
+ note_attachment_bank_switch_service_netherlands_incoming_payment_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -21128,8 +21639,8 @@ def delete(cls, bunqme_fundraiser_result_id, note_attachment_bunq_me_fundraiser_
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- bunqme_fundraiser_result_id,
- note_attachment_bunq_me_fundraiser_result_id)
+ switch_service_payment_id,
+ note_attachment_bank_switch_service_netherlands_incoming_payment_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -21137,17 +21648,18 @@ def delete(cls, bunqme_fundraiser_result_id, note_attachment_bunq_me_fundraiser_
)
@classmethod
- def list(cls, bunqme_fundraiser_result_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, switch_service_payment_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type bunqme_fundraiser_result_id: int
+ :type switch_service_payment_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentBunqMeFundraiserResultList
+ :rtype:
+ BunqResponseNoteAttachmentBankSwitchServiceNetherlandsIncomingPaymentList
"""
if params is None:
@@ -21159,26 +21671,28 @@ def list(cls, bunqme_fundraiser_result_id, monetary_account_id=None, params=None
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- bunqme_fundraiser_result_id)
+ switch_service_payment_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteAttachmentBunqMeFundraiserResultList.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentBankSwitchServiceNetherlandsIncomingPaymentList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, bunqme_fundraiser_result_id, note_attachment_bunq_me_fundraiser_result_id, monetary_account_id=None,
- custom_headers=None):
+ def get(cls, switch_service_payment_id, note_attachment_bank_switch_service_netherlands_incoming_payment_id,
+ monetary_account_id=None, custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type bunqme_fundraiser_result_id: int
- :type note_attachment_bunq_me_fundraiser_result_id: int
+ :type switch_service_payment_id: int
+ :type
+ note_attachment_bank_switch_service_netherlands_incoming_payment_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentBunqMeFundraiserResult
- """
+ :rtype:
+ BunqResponseNoteAttachmentBankSwitchServiceNetherlandsIncomingPayment
+ """
if custom_headers is None:
custom_headers = {}
@@ -21186,11 +21700,11 @@ def get(cls, bunqme_fundraiser_result_id, note_attachment_bunq_me_fundraiser_res
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- bunqme_fundraiser_result_id,
- note_attachment_bunq_me_fundraiser_result_id)
+ switch_service_payment_id,
+ note_attachment_bank_switch_service_netherlands_incoming_payment_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteAttachmentBunqMeFundraiserResult.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentBankSwitchServiceNetherlandsIncomingPayment.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -21272,13 +21786,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteAttachmentBunqMeFundraiserResult
+ :rtype: NoteAttachmentBankSwitchServiceNetherlandsIncomingPayment
"""
- return converter.json_to_class(NoteAttachmentBunqMeFundraiserResult, json_str)
+ return converter.json_to_class(NoteAttachmentBankSwitchServiceNetherlandsIncomingPayment, json_str)
-class NoteTextBunqMeFundraiserResult(BunqModel):
+class NoteTextBankSwitchServiceNetherlandsIncomingPayment(BunqModel):
"""
Used to manage text notes.
@@ -21295,11 +21809,11 @@ class NoteTextBunqMeFundraiserResult(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/bunqme-fundraiser-result/{}/note-text"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/bunqme-fundraiser-result/{}/note-text/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/bunqme-fundraiser-result/{}/note-text/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/bunqme-fundraiser-result/{}/note-text"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/bunqme-fundraiser-result/{}/note-text/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/switch-service-payment/{}/note-text"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/switch-service-payment/{}/note-text/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/switch-service-payment/{}/note-text/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/switch-service-payment/{}/note-text"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/switch-service-payment/{}/note-text/{}"
# Field constants.
FIELD_CONTENT = "content"
@@ -21323,11 +21837,11 @@ def __init__(self, content=None):
self._content_field_for_request = content
@classmethod
- def create(cls, bunqme_fundraiser_result_id, monetary_account_id=None, content=None, custom_headers=None):
+ def create(cls, switch_service_payment_id, monetary_account_id=None, content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type bunqme_fundraiser_result_id: int
+ :type switch_service_payment_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -21348,7 +21862,7 @@ def create(cls, bunqme_fundraiser_result_id, monetary_account_id=None, content=N
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- bunqme_fundraiser_result_id)
+ switch_service_payment_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -21356,13 +21870,13 @@ def create(cls, bunqme_fundraiser_result_id, monetary_account_id=None, content=N
)
@classmethod
- def update(cls, bunqme_fundraiser_result_id, note_text_bunq_me_fundraiser_result_id, monetary_account_id=None,
- content=None, custom_headers=None):
+ def update(cls, switch_service_payment_id, note_text_bank_switch_service_netherlands_incoming_payment_id,
+ monetary_account_id=None, content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type bunqme_fundraiser_result_id: int
- :type note_text_bunq_me_fundraiser_result_id: int
+ :type switch_service_payment_id: int
+ :type note_text_bank_switch_service_netherlands_incoming_payment_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -21384,8 +21898,8 @@ def update(cls, bunqme_fundraiser_result_id, note_text_bunq_me_fundraiser_result
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- bunqme_fundraiser_result_id,
- note_text_bunq_me_fundraiser_result_id)
+ switch_service_payment_id,
+ note_text_bank_switch_service_netherlands_incoming_payment_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -21393,13 +21907,13 @@ def update(cls, bunqme_fundraiser_result_id, note_text_bunq_me_fundraiser_result
)
@classmethod
- def delete(cls, bunqme_fundraiser_result_id, note_text_bunq_me_fundraiser_result_id, monetary_account_id=None,
- custom_headers=None):
+ def delete(cls, switch_service_payment_id, note_text_bank_switch_service_netherlands_incoming_payment_id,
+ monetary_account_id=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type bunqme_fundraiser_result_id: int
- :type note_text_bunq_me_fundraiser_result_id: int
+ :type switch_service_payment_id: int
+ :type note_text_bank_switch_service_netherlands_incoming_payment_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -21411,8 +21925,8 @@ def delete(cls, bunqme_fundraiser_result_id, note_text_bunq_me_fundraiser_result
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- bunqme_fundraiser_result_id,
- note_text_bunq_me_fundraiser_result_id)
+ switch_service_payment_id,
+ note_text_bank_switch_service_netherlands_incoming_payment_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -21420,17 +21934,18 @@ def delete(cls, bunqme_fundraiser_result_id, note_text_bunq_me_fundraiser_result
)
@classmethod
- def list(cls, bunqme_fundraiser_result_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, switch_service_payment_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type bunqme_fundraiser_result_id: int
+ :type switch_service_payment_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextBunqMeFundraiserResultList
+ :rtype:
+ BunqResponseNoteTextBankSwitchServiceNetherlandsIncomingPaymentList
"""
if params is None:
@@ -21442,25 +21957,25 @@ def list(cls, bunqme_fundraiser_result_id, monetary_account_id=None, params=None
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- bunqme_fundraiser_result_id)
+ switch_service_payment_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteTextBunqMeFundraiserResultList.cast_from_bunq_response(
+ return BunqResponseNoteTextBankSwitchServiceNetherlandsIncomingPaymentList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, bunqme_fundraiser_result_id, note_text_bunq_me_fundraiser_result_id, monetary_account_id=None,
- custom_headers=None):
+ def get(cls, switch_service_payment_id, note_text_bank_switch_service_netherlands_incoming_payment_id,
+ monetary_account_id=None, custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type bunqme_fundraiser_result_id: int
- :type note_text_bunq_me_fundraiser_result_id: int
+ :type switch_service_payment_id: int
+ :type note_text_bank_switch_service_netherlands_incoming_payment_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextBunqMeFundraiserResult
+ :rtype: BunqResponseNoteTextBankSwitchServiceNetherlandsIncomingPayment
"""
if custom_headers is None:
@@ -21469,11 +21984,11 @@ def get(cls, bunqme_fundraiser_result_id, note_text_bunq_me_fundraiser_result_id
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- bunqme_fundraiser_result_id,
- note_text_bunq_me_fundraiser_result_id)
+ switch_service_payment_id,
+ note_text_bank_switch_service_netherlands_incoming_payment_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteTextBunqMeFundraiserResult.cast_from_bunq_response(
+ return BunqResponseNoteTextBankSwitchServiceNetherlandsIncomingPayment.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -21544,13 +22059,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteTextBunqMeFundraiserResult
+ :rtype: NoteTextBankSwitchServiceNetherlandsIncomingPayment
"""
- return converter.json_to_class(NoteTextBunqMeFundraiserResult, json_str)
+ return converter.json_to_class(NoteTextBankSwitchServiceNetherlandsIncomingPayment, json_str)
-class NoteAttachmentDraftPayment(BunqModel):
+class NoteAttachmentBunqMeFundraiserResult(BunqModel):
"""
Used to manage attachment notes.
@@ -21572,11 +22087,11 @@ class NoteAttachmentDraftPayment(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/draft-payment/{}/note-attachment"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/draft-payment/{}/note-attachment/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/draft-payment/{}/note-attachment/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/draft-payment/{}/note-attachment"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/draft-payment/{}/note-attachment/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/bunqme-fundraiser-result/{}/note-attachment"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/bunqme-fundraiser-result/{}/note-attachment/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/bunqme-fundraiser-result/{}/note-attachment/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/bunqme-fundraiser-result/{}/note-attachment"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/bunqme-fundraiser-result/{}/note-attachment/{}"
# Field constants.
FIELD_DESCRIPTION = "description"
@@ -21607,11 +22122,12 @@ def __init__(self, attachment_id, description=None):
self._description_field_for_request = description
@classmethod
- def create(cls, draft_payment_id, attachment_id, monetary_account_id=None, description=None, custom_headers=None):
+ def create(cls, bunqme_fundraiser_result_id, attachment_id, monetary_account_id=None, description=None,
+ custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type draft_payment_id: int
+ :type bunqme_fundraiser_result_id: int
:param attachment_id: The reference to the uploaded file to attach to
this note.
:type attachment_id: int
@@ -21636,7 +22152,7 @@ def create(cls, draft_payment_id, attachment_id, monetary_account_id=None, descr
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- draft_payment_id)
+ bunqme_fundraiser_result_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -21644,13 +22160,13 @@ def create(cls, draft_payment_id, attachment_id, monetary_account_id=None, descr
)
@classmethod
- def update(cls, draft_payment_id, note_attachment_draft_payment_id, monetary_account_id=None, description=None,
- custom_headers=None):
+ def update(cls, bunqme_fundraiser_result_id, note_attachment_bunq_me_fundraiser_result_id, monetary_account_id=None,
+ description=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type draft_payment_id: int
- :type note_attachment_draft_payment_id: int
+ :type bunqme_fundraiser_result_id: int
+ :type note_attachment_bunq_me_fundraiser_result_id: int
:param description: Optional description of the attachment.
:type description: str
:type custom_headers: dict[str, str]|None
@@ -21672,7 +22188,8 @@ def update(cls, draft_payment_id, note_attachment_draft_payment_id, monetary_acc
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- draft_payment_id, note_attachment_draft_payment_id)
+ bunqme_fundraiser_result_id,
+ note_attachment_bunq_me_fundraiser_result_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -21680,12 +22197,13 @@ def update(cls, draft_payment_id, note_attachment_draft_payment_id, monetary_acc
)
@classmethod
- def delete(cls, draft_payment_id, note_attachment_draft_payment_id, monetary_account_id=None, custom_headers=None):
+ def delete(cls, bunqme_fundraiser_result_id, note_attachment_bunq_me_fundraiser_result_id, monetary_account_id=None,
+ custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type draft_payment_id: int
- :type note_attachment_draft_payment_id: int
+ :type bunqme_fundraiser_result_id: int
+ :type note_attachment_bunq_me_fundraiser_result_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -21697,7 +22215,8 @@ def delete(cls, draft_payment_id, note_attachment_draft_payment_id, monetary_acc
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- draft_payment_id, note_attachment_draft_payment_id)
+ bunqme_fundraiser_result_id,
+ note_attachment_bunq_me_fundraiser_result_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -21705,17 +22224,17 @@ def delete(cls, draft_payment_id, note_attachment_draft_payment_id, monetary_acc
)
@classmethod
- def list(cls, draft_payment_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, bunqme_fundraiser_result_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type draft_payment_id: int
+ :type bunqme_fundraiser_result_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentDraftPaymentList
+ :rtype: BunqResponseNoteAttachmentBunqMeFundraiserResultList
"""
if params is None:
@@ -21727,24 +22246,25 @@ def list(cls, draft_payment_id, monetary_account_id=None, params=None, custom_he
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- draft_payment_id)
+ bunqme_fundraiser_result_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteAttachmentDraftPaymentList.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentBunqMeFundraiserResultList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, draft_payment_id, note_attachment_draft_payment_id, monetary_account_id=None, custom_headers=None):
+ def get(cls, bunqme_fundraiser_result_id, note_attachment_bunq_me_fundraiser_result_id, monetary_account_id=None,
+ custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type draft_payment_id: int
- :type note_attachment_draft_payment_id: int
+ :type bunqme_fundraiser_result_id: int
+ :type note_attachment_bunq_me_fundraiser_result_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentDraftPayment
+ :rtype: BunqResponseNoteAttachmentBunqMeFundraiserResult
"""
if custom_headers is None:
@@ -21753,10 +22273,11 @@ def get(cls, draft_payment_id, note_attachment_draft_payment_id, monetary_accoun
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- draft_payment_id, note_attachment_draft_payment_id)
+ bunqme_fundraiser_result_id,
+ note_attachment_bunq_me_fundraiser_result_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteAttachmentDraftPayment.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentBunqMeFundraiserResult.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -21838,13 +22359,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteAttachmentDraftPayment
+ :rtype: NoteAttachmentBunqMeFundraiserResult
"""
- return converter.json_to_class(NoteAttachmentDraftPayment, json_str)
+ return converter.json_to_class(NoteAttachmentBunqMeFundraiserResult, json_str)
-class NoteTextDraftPayment(BunqModel):
+class NoteTextBunqMeFundraiserResult(BunqModel):
"""
Used to manage text notes.
@@ -21861,11 +22382,11 @@ class NoteTextDraftPayment(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/draft-payment/{}/note-text"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/draft-payment/{}/note-text/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/draft-payment/{}/note-text/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/draft-payment/{}/note-text"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/draft-payment/{}/note-text/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/bunqme-fundraiser-result/{}/note-text"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/bunqme-fundraiser-result/{}/note-text/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/bunqme-fundraiser-result/{}/note-text/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/bunqme-fundraiser-result/{}/note-text"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/bunqme-fundraiser-result/{}/note-text/{}"
# Field constants.
FIELD_CONTENT = "content"
@@ -21889,11 +22410,11 @@ def __init__(self, content=None):
self._content_field_for_request = content
@classmethod
- def create(cls, draft_payment_id, monetary_account_id=None, content=None, custom_headers=None):
+ def create(cls, bunqme_fundraiser_result_id, monetary_account_id=None, content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type draft_payment_id: int
+ :type bunqme_fundraiser_result_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -21914,7 +22435,7 @@ def create(cls, draft_payment_id, monetary_account_id=None, content=None, custom
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- draft_payment_id)
+ bunqme_fundraiser_result_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -21922,13 +22443,13 @@ def create(cls, draft_payment_id, monetary_account_id=None, content=None, custom
)
@classmethod
- def update(cls, draft_payment_id, note_text_draft_payment_id, monetary_account_id=None, content=None,
- custom_headers=None):
+ def update(cls, bunqme_fundraiser_result_id, note_text_bunq_me_fundraiser_result_id, monetary_account_id=None,
+ content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type draft_payment_id: int
- :type note_text_draft_payment_id: int
+ :type bunqme_fundraiser_result_id: int
+ :type note_text_bunq_me_fundraiser_result_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -21950,7 +22471,8 @@ def update(cls, draft_payment_id, note_text_draft_payment_id, monetary_account_i
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- draft_payment_id, note_text_draft_payment_id)
+ bunqme_fundraiser_result_id,
+ note_text_bunq_me_fundraiser_result_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -21958,12 +22480,13 @@ def update(cls, draft_payment_id, note_text_draft_payment_id, monetary_account_i
)
@classmethod
- def delete(cls, draft_payment_id, note_text_draft_payment_id, monetary_account_id=None, custom_headers=None):
+ def delete(cls, bunqme_fundraiser_result_id, note_text_bunq_me_fundraiser_result_id, monetary_account_id=None,
+ custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type draft_payment_id: int
- :type note_text_draft_payment_id: int
+ :type bunqme_fundraiser_result_id: int
+ :type note_text_bunq_me_fundraiser_result_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -21975,7 +22498,8 @@ def delete(cls, draft_payment_id, note_text_draft_payment_id, monetary_account_i
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- draft_payment_id, note_text_draft_payment_id)
+ bunqme_fundraiser_result_id,
+ note_text_bunq_me_fundraiser_result_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -21983,17 +22507,17 @@ def delete(cls, draft_payment_id, note_text_draft_payment_id, monetary_account_i
)
@classmethod
- def list(cls, draft_payment_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, bunqme_fundraiser_result_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type draft_payment_id: int
+ :type bunqme_fundraiser_result_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextDraftPaymentList
+ :rtype: BunqResponseNoteTextBunqMeFundraiserResultList
"""
if params is None:
@@ -22005,24 +22529,25 @@ def list(cls, draft_payment_id, monetary_account_id=None, params=None, custom_he
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- draft_payment_id)
+ bunqme_fundraiser_result_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteTextDraftPaymentList.cast_from_bunq_response(
+ return BunqResponseNoteTextBunqMeFundraiserResultList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, draft_payment_id, note_text_draft_payment_id, monetary_account_id=None, custom_headers=None):
+ def get(cls, bunqme_fundraiser_result_id, note_text_bunq_me_fundraiser_result_id, monetary_account_id=None,
+ custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type draft_payment_id: int
- :type note_text_draft_payment_id: int
+ :type bunqme_fundraiser_result_id: int
+ :type note_text_bunq_me_fundraiser_result_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextDraftPayment
+ :rtype: BunqResponseNoteTextBunqMeFundraiserResult
"""
if custom_headers is None:
@@ -22031,10 +22556,11 @@ def get(cls, draft_payment_id, note_text_draft_payment_id, monetary_account_id=N
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- draft_payment_id, note_text_draft_payment_id)
+ bunqme_fundraiser_result_id,
+ note_text_bunq_me_fundraiser_result_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteTextDraftPayment.cast_from_bunq_response(
+ return BunqResponseNoteTextBunqMeFundraiserResult.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -22105,13 +22631,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteTextDraftPayment
+ :rtype: NoteTextBunqMeFundraiserResult
"""
- return converter.json_to_class(NoteTextDraftPayment, json_str)
+ return converter.json_to_class(NoteTextBunqMeFundraiserResult, json_str)
-class NoteAttachmentIdealMerchantTransaction(BunqModel):
+class NoteAttachmentDraftPayment(BunqModel):
"""
Used to manage attachment notes.
@@ -22133,11 +22659,11 @@ class NoteAttachmentIdealMerchantTransaction(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}/note-attachment"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}/note-attachment/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}/note-attachment/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}/note-attachment"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}/note-attachment/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/draft-payment/{}/note-attachment"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/draft-payment/{}/note-attachment/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/draft-payment/{}/note-attachment/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/draft-payment/{}/note-attachment"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/draft-payment/{}/note-attachment/{}"
# Field constants.
FIELD_DESCRIPTION = "description"
@@ -22168,12 +22694,11 @@ def __init__(self, attachment_id, description=None):
self._description_field_for_request = description
@classmethod
- def create(cls, ideal_merchant_transaction_id, attachment_id, monetary_account_id=None, description=None,
- custom_headers=None):
+ def create(cls, draft_payment_id, attachment_id, monetary_account_id=None, description=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type ideal_merchant_transaction_id: int
+ :type draft_payment_id: int
:param attachment_id: The reference to the uploaded file to attach to
this note.
:type attachment_id: int
@@ -22198,7 +22723,7 @@ def create(cls, ideal_merchant_transaction_id, attachment_id, monetary_account_i
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- ideal_merchant_transaction_id)
+ draft_payment_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -22206,13 +22731,13 @@ def create(cls, ideal_merchant_transaction_id, attachment_id, monetary_account_i
)
@classmethod
- def update(cls, ideal_merchant_transaction_id, note_attachment_ideal_merchant_transaction_id,
- monetary_account_id=None, description=None, custom_headers=None):
+ def update(cls, draft_payment_id, note_attachment_draft_payment_id, monetary_account_id=None, description=None,
+ custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type ideal_merchant_transaction_id: int
- :type note_attachment_ideal_merchant_transaction_id: int
+ :type draft_payment_id: int
+ :type note_attachment_draft_payment_id: int
:param description: Optional description of the attachment.
:type description: str
:type custom_headers: dict[str, str]|None
@@ -22234,8 +22759,7 @@ def update(cls, ideal_merchant_transaction_id, note_attachment_ideal_merchant_tr
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- ideal_merchant_transaction_id,
- note_attachment_ideal_merchant_transaction_id)
+ draft_payment_id, note_attachment_draft_payment_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -22243,13 +22767,12 @@ def update(cls, ideal_merchant_transaction_id, note_attachment_ideal_merchant_tr
)
@classmethod
- def delete(cls, ideal_merchant_transaction_id, note_attachment_ideal_merchant_transaction_id,
- monetary_account_id=None, custom_headers=None):
+ def delete(cls, draft_payment_id, note_attachment_draft_payment_id, monetary_account_id=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type ideal_merchant_transaction_id: int
- :type note_attachment_ideal_merchant_transaction_id: int
+ :type draft_payment_id: int
+ :type note_attachment_draft_payment_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -22261,8 +22784,7 @@ def delete(cls, ideal_merchant_transaction_id, note_attachment_ideal_merchant_tr
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- ideal_merchant_transaction_id,
- note_attachment_ideal_merchant_transaction_id)
+ draft_payment_id, note_attachment_draft_payment_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -22270,17 +22792,17 @@ def delete(cls, ideal_merchant_transaction_id, note_attachment_ideal_merchant_tr
)
@classmethod
- def list(cls, ideal_merchant_transaction_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, draft_payment_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type ideal_merchant_transaction_id: int
+ :type draft_payment_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentIdealMerchantTransactionList
+ :rtype: BunqResponseNoteAttachmentDraftPaymentList
"""
if params is None:
@@ -22292,25 +22814,24 @@ def list(cls, ideal_merchant_transaction_id, monetary_account_id=None, params=No
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- ideal_merchant_transaction_id)
+ draft_payment_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteAttachmentIdealMerchantTransactionList.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentDraftPaymentList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, ideal_merchant_transaction_id, note_attachment_ideal_merchant_transaction_id, monetary_account_id=None,
- custom_headers=None):
+ def get(cls, draft_payment_id, note_attachment_draft_payment_id, monetary_account_id=None, custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type ideal_merchant_transaction_id: int
- :type note_attachment_ideal_merchant_transaction_id: int
+ :type draft_payment_id: int
+ :type note_attachment_draft_payment_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentIdealMerchantTransaction
+ :rtype: BunqResponseNoteAttachmentDraftPayment
"""
if custom_headers is None:
@@ -22319,11 +22840,10 @@ def get(cls, ideal_merchant_transaction_id, note_attachment_ideal_merchant_trans
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- ideal_merchant_transaction_id,
- note_attachment_ideal_merchant_transaction_id)
+ draft_payment_id, note_attachment_draft_payment_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteAttachmentIdealMerchantTransaction.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentDraftPayment.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -22405,13 +22925,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteAttachmentIdealMerchantTransaction
+ :rtype: NoteAttachmentDraftPayment
"""
- return converter.json_to_class(NoteAttachmentIdealMerchantTransaction, json_str)
+ return converter.json_to_class(NoteAttachmentDraftPayment, json_str)
-class NoteTextIdealMerchantTransaction(BunqModel):
+class NoteTextDraftPayment(BunqModel):
"""
Used to manage text notes.
@@ -22428,11 +22948,11 @@ class NoteTextIdealMerchantTransaction(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}/note-text"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}/note-text/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}/note-text/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}/note-text"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}/note-text/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/draft-payment/{}/note-text"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/draft-payment/{}/note-text/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/draft-payment/{}/note-text/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/draft-payment/{}/note-text"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/draft-payment/{}/note-text/{}"
# Field constants.
FIELD_CONTENT = "content"
@@ -22456,11 +22976,11 @@ def __init__(self, content=None):
self._content_field_for_request = content
@classmethod
- def create(cls, ideal_merchant_transaction_id, monetary_account_id=None, content=None, custom_headers=None):
+ def create(cls, draft_payment_id, monetary_account_id=None, content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type ideal_merchant_transaction_id: int
+ :type draft_payment_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -22481,7 +23001,7 @@ def create(cls, ideal_merchant_transaction_id, monetary_account_id=None, content
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- ideal_merchant_transaction_id)
+ draft_payment_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -22489,13 +23009,13 @@ def create(cls, ideal_merchant_transaction_id, monetary_account_id=None, content
)
@classmethod
- def update(cls, ideal_merchant_transaction_id, note_text_ideal_merchant_transaction_id, monetary_account_id=None,
- content=None, custom_headers=None):
+ def update(cls, draft_payment_id, note_text_draft_payment_id, monetary_account_id=None, content=None,
+ custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type ideal_merchant_transaction_id: int
- :type note_text_ideal_merchant_transaction_id: int
+ :type draft_payment_id: int
+ :type note_text_draft_payment_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -22517,8 +23037,7 @@ def update(cls, ideal_merchant_transaction_id, note_text_ideal_merchant_transact
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- ideal_merchant_transaction_id,
- note_text_ideal_merchant_transaction_id)
+ draft_payment_id, note_text_draft_payment_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -22526,13 +23045,12 @@ def update(cls, ideal_merchant_transaction_id, note_text_ideal_merchant_transact
)
@classmethod
- def delete(cls, ideal_merchant_transaction_id, note_text_ideal_merchant_transaction_id, monetary_account_id=None,
- custom_headers=None):
+ def delete(cls, draft_payment_id, note_text_draft_payment_id, monetary_account_id=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type ideal_merchant_transaction_id: int
- :type note_text_ideal_merchant_transaction_id: int
+ :type draft_payment_id: int
+ :type note_text_draft_payment_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -22544,8 +23062,7 @@ def delete(cls, ideal_merchant_transaction_id, note_text_ideal_merchant_transact
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- ideal_merchant_transaction_id,
- note_text_ideal_merchant_transaction_id)
+ draft_payment_id, note_text_draft_payment_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -22553,17 +23070,17 @@ def delete(cls, ideal_merchant_transaction_id, note_text_ideal_merchant_transact
)
@classmethod
- def list(cls, ideal_merchant_transaction_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, draft_payment_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type ideal_merchant_transaction_id: int
+ :type draft_payment_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextIdealMerchantTransactionList
+ :rtype: BunqResponseNoteTextDraftPaymentList
"""
if params is None:
@@ -22575,25 +23092,24 @@ def list(cls, ideal_merchant_transaction_id, monetary_account_id=None, params=No
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- ideal_merchant_transaction_id)
+ draft_payment_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteTextIdealMerchantTransactionList.cast_from_bunq_response(
+ return BunqResponseNoteTextDraftPaymentList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, ideal_merchant_transaction_id, note_text_ideal_merchant_transaction_id, monetary_account_id=None,
- custom_headers=None):
+ def get(cls, draft_payment_id, note_text_draft_payment_id, monetary_account_id=None, custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type ideal_merchant_transaction_id: int
- :type note_text_ideal_merchant_transaction_id: int
+ :type draft_payment_id: int
+ :type note_text_draft_payment_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextIdealMerchantTransaction
+ :rtype: BunqResponseNoteTextDraftPayment
"""
if custom_headers is None:
@@ -22602,11 +23118,10 @@ def get(cls, ideal_merchant_transaction_id, note_text_ideal_merchant_transaction
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- ideal_merchant_transaction_id,
- note_text_ideal_merchant_transaction_id)
+ draft_payment_id, note_text_draft_payment_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteTextIdealMerchantTransaction.cast_from_bunq_response(
+ return BunqResponseNoteTextDraftPayment.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -22677,13 +23192,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteTextIdealMerchantTransaction
+ :rtype: NoteTextDraftPayment
"""
- return converter.json_to_class(NoteTextIdealMerchantTransaction, json_str)
+ return converter.json_to_class(NoteTextDraftPayment, json_str)
-class NoteAttachmentMasterCardAction(BunqModel):
+class NoteAttachmentIdealMerchantTransaction(BunqModel):
"""
Used to manage attachment notes.
@@ -22705,11 +23220,11 @@ class NoteAttachmentMasterCardAction(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/mastercard-action/{}/note-attachment"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/mastercard-action/{}/note-attachment/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/mastercard-action/{}/note-attachment/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/mastercard-action/{}/note-attachment"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/mastercard-action/{}/note-attachment/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}/note-attachment"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}/note-attachment/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}/note-attachment/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}/note-attachment"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}/note-attachment/{}"
# Field constants.
FIELD_DESCRIPTION = "description"
@@ -22740,12 +23255,12 @@ def __init__(self, attachment_id, description=None):
self._description_field_for_request = description
@classmethod
- def create(cls, mastercard_action_id, attachment_id, monetary_account_id=None, description=None,
+ def create(cls, ideal_merchant_transaction_id, attachment_id, monetary_account_id=None, description=None,
custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type mastercard_action_id: int
+ :type ideal_merchant_transaction_id: int
:param attachment_id: The reference to the uploaded file to attach to
this note.
:type attachment_id: int
@@ -22770,7 +23285,7 @@ def create(cls, mastercard_action_id, attachment_id, monetary_account_id=None, d
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- mastercard_action_id)
+ ideal_merchant_transaction_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -22778,13 +23293,13 @@ def create(cls, mastercard_action_id, attachment_id, monetary_account_id=None, d
)
@classmethod
- def update(cls, mastercard_action_id, note_attachment_master_card_action_id, monetary_account_id=None,
- description=None, custom_headers=None):
+ def update(cls, ideal_merchant_transaction_id, note_attachment_ideal_merchant_transaction_id,
+ monetary_account_id=None, description=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type mastercard_action_id: int
- :type note_attachment_master_card_action_id: int
+ :type ideal_merchant_transaction_id: int
+ :type note_attachment_ideal_merchant_transaction_id: int
:param description: Optional description of the attachment.
:type description: str
:type custom_headers: dict[str, str]|None
@@ -22806,7 +23321,8 @@ def update(cls, mastercard_action_id, note_attachment_master_card_action_id, mon
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- mastercard_action_id, note_attachment_master_card_action_id)
+ ideal_merchant_transaction_id,
+ note_attachment_ideal_merchant_transaction_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -22814,13 +23330,13 @@ def update(cls, mastercard_action_id, note_attachment_master_card_action_id, mon
)
@classmethod
- def delete(cls, mastercard_action_id, note_attachment_master_card_action_id, monetary_account_id=None,
- custom_headers=None):
+ def delete(cls, ideal_merchant_transaction_id, note_attachment_ideal_merchant_transaction_id,
+ monetary_account_id=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type mastercard_action_id: int
- :type note_attachment_master_card_action_id: int
+ :type ideal_merchant_transaction_id: int
+ :type note_attachment_ideal_merchant_transaction_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -22832,7 +23348,8 @@ def delete(cls, mastercard_action_id, note_attachment_master_card_action_id, mon
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- mastercard_action_id, note_attachment_master_card_action_id)
+ ideal_merchant_transaction_id,
+ note_attachment_ideal_merchant_transaction_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -22840,17 +23357,17 @@ def delete(cls, mastercard_action_id, note_attachment_master_card_action_id, mon
)
@classmethod
- def list(cls, mastercard_action_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, ideal_merchant_transaction_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type mastercard_action_id: int
+ :type ideal_merchant_transaction_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentMasterCardActionList
+ :rtype: BunqResponseNoteAttachmentIdealMerchantTransactionList
"""
if params is None:
@@ -22862,25 +23379,25 @@ def list(cls, mastercard_action_id, monetary_account_id=None, params=None, custo
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- mastercard_action_id)
+ ideal_merchant_transaction_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteAttachmentMasterCardActionList.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentIdealMerchantTransactionList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, mastercard_action_id, note_attachment_master_card_action_id, monetary_account_id=None,
+ def get(cls, ideal_merchant_transaction_id, note_attachment_ideal_merchant_transaction_id, monetary_account_id=None,
custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type mastercard_action_id: int
- :type note_attachment_master_card_action_id: int
+ :type ideal_merchant_transaction_id: int
+ :type note_attachment_ideal_merchant_transaction_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentMasterCardAction
+ :rtype: BunqResponseNoteAttachmentIdealMerchantTransaction
"""
if custom_headers is None:
@@ -22889,10 +23406,11 @@ def get(cls, mastercard_action_id, note_attachment_master_card_action_id, moneta
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- mastercard_action_id, note_attachment_master_card_action_id)
+ ideal_merchant_transaction_id,
+ note_attachment_ideal_merchant_transaction_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteAttachmentMasterCardAction.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentIdealMerchantTransaction.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -22974,13 +23492,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteAttachmentMasterCardAction
+ :rtype: NoteAttachmentIdealMerchantTransaction
"""
- return converter.json_to_class(NoteAttachmentMasterCardAction, json_str)
+ return converter.json_to_class(NoteAttachmentIdealMerchantTransaction, json_str)
-class NoteTextMasterCardAction(BunqModel):
+class NoteTextIdealMerchantTransaction(BunqModel):
"""
Used to manage text notes.
@@ -22997,11 +23515,11 @@ class NoteTextMasterCardAction(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/mastercard-action/{}/note-text"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/mastercard-action/{}/note-text/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/mastercard-action/{}/note-text/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/mastercard-action/{}/note-text"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/mastercard-action/{}/note-text/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}/note-text"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}/note-text/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}/note-text/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}/note-text"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/ideal-merchant-transaction/{}/note-text/{}"
# Field constants.
FIELD_CONTENT = "content"
@@ -23025,11 +23543,11 @@ def __init__(self, content=None):
self._content_field_for_request = content
@classmethod
- def create(cls, mastercard_action_id, monetary_account_id=None, content=None, custom_headers=None):
+ def create(cls, ideal_merchant_transaction_id, monetary_account_id=None, content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type mastercard_action_id: int
+ :type ideal_merchant_transaction_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -23050,7 +23568,7 @@ def create(cls, mastercard_action_id, monetary_account_id=None, content=None, cu
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- mastercard_action_id)
+ ideal_merchant_transaction_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -23058,13 +23576,13 @@ def create(cls, mastercard_action_id, monetary_account_id=None, content=None, cu
)
@classmethod
- def update(cls, mastercard_action_id, note_text_master_card_action_id, monetary_account_id=None, content=None,
- custom_headers=None):
+ def update(cls, ideal_merchant_transaction_id, note_text_ideal_merchant_transaction_id, monetary_account_id=None,
+ content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type mastercard_action_id: int
- :type note_text_master_card_action_id: int
+ :type ideal_merchant_transaction_id: int
+ :type note_text_ideal_merchant_transaction_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -23086,7 +23604,8 @@ def update(cls, mastercard_action_id, note_text_master_card_action_id, monetary_
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- mastercard_action_id, note_text_master_card_action_id)
+ ideal_merchant_transaction_id,
+ note_text_ideal_merchant_transaction_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -23094,13 +23613,13 @@ def update(cls, mastercard_action_id, note_text_master_card_action_id, monetary_
)
@classmethod
- def delete(cls, mastercard_action_id, note_text_master_card_action_id, monetary_account_id=None,
+ def delete(cls, ideal_merchant_transaction_id, note_text_ideal_merchant_transaction_id, monetary_account_id=None,
custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type mastercard_action_id: int
- :type note_text_master_card_action_id: int
+ :type ideal_merchant_transaction_id: int
+ :type note_text_ideal_merchant_transaction_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -23112,7 +23631,8 @@ def delete(cls, mastercard_action_id, note_text_master_card_action_id, monetary_
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- mastercard_action_id, note_text_master_card_action_id)
+ ideal_merchant_transaction_id,
+ note_text_ideal_merchant_transaction_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -23120,17 +23640,17 @@ def delete(cls, mastercard_action_id, note_text_master_card_action_id, monetary_
)
@classmethod
- def list(cls, mastercard_action_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, ideal_merchant_transaction_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type mastercard_action_id: int
+ :type ideal_merchant_transaction_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextMasterCardActionList
+ :rtype: BunqResponseNoteTextIdealMerchantTransactionList
"""
if params is None:
@@ -23142,24 +23662,25 @@ def list(cls, mastercard_action_id, monetary_account_id=None, params=None, custo
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- mastercard_action_id)
+ ideal_merchant_transaction_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteTextMasterCardActionList.cast_from_bunq_response(
+ return BunqResponseNoteTextIdealMerchantTransactionList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, mastercard_action_id, note_text_master_card_action_id, monetary_account_id=None, custom_headers=None):
+ def get(cls, ideal_merchant_transaction_id, note_text_ideal_merchant_transaction_id, monetary_account_id=None,
+ custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type mastercard_action_id: int
- :type note_text_master_card_action_id: int
+ :type ideal_merchant_transaction_id: int
+ :type note_text_ideal_merchant_transaction_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextMasterCardAction
+ :rtype: BunqResponseNoteTextIdealMerchantTransaction
"""
if custom_headers is None:
@@ -23168,10 +23689,11 @@ def get(cls, mastercard_action_id, note_text_master_card_action_id, monetary_acc
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- mastercard_action_id, note_text_master_card_action_id)
+ ideal_merchant_transaction_id,
+ note_text_ideal_merchant_transaction_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteTextMasterCardAction.cast_from_bunq_response(
+ return BunqResponseNoteTextIdealMerchantTransaction.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -23242,13 +23764,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteTextMasterCardAction
+ :rtype: NoteTextIdealMerchantTransaction
"""
- return converter.json_to_class(NoteTextMasterCardAction, json_str)
+ return converter.json_to_class(NoteTextIdealMerchantTransaction, json_str)
-class NoteAttachmentPaymentBatch(BunqModel):
+class NoteAttachmentMasterCardAction(BunqModel):
"""
Used to manage attachment notes.
@@ -23270,11 +23792,11 @@ class NoteAttachmentPaymentBatch(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/payment-batch/{}/note-attachment"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/payment-batch/{}/note-attachment/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/payment-batch/{}/note-attachment/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/payment-batch/{}/note-attachment"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/payment-batch/{}/note-attachment/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/mastercard-action/{}/note-attachment"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/mastercard-action/{}/note-attachment/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/mastercard-action/{}/note-attachment/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/mastercard-action/{}/note-attachment"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/mastercard-action/{}/note-attachment/{}"
# Field constants.
FIELD_DESCRIPTION = "description"
@@ -23305,11 +23827,12 @@ def __init__(self, attachment_id, description=None):
self._description_field_for_request = description
@classmethod
- def create(cls, payment_batch_id, attachment_id, monetary_account_id=None, description=None, custom_headers=None):
+ def create(cls, mastercard_action_id, attachment_id, monetary_account_id=None, description=None,
+ custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type payment_batch_id: int
+ :type mastercard_action_id: int
:param attachment_id: The reference to the uploaded file to attach to
this note.
:type attachment_id: int
@@ -23334,7 +23857,7 @@ def create(cls, payment_batch_id, attachment_id, monetary_account_id=None, descr
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- payment_batch_id)
+ mastercard_action_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -23342,13 +23865,13 @@ def create(cls, payment_batch_id, attachment_id, monetary_account_id=None, descr
)
@classmethod
- def update(cls, payment_batch_id, note_attachment_payment_batch_id, monetary_account_id=None, description=None,
- custom_headers=None):
+ def update(cls, mastercard_action_id, note_attachment_master_card_action_id, monetary_account_id=None,
+ description=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type payment_batch_id: int
- :type note_attachment_payment_batch_id: int
+ :type mastercard_action_id: int
+ :type note_attachment_master_card_action_id: int
:param description: Optional description of the attachment.
:type description: str
:type custom_headers: dict[str, str]|None
@@ -23370,7 +23893,7 @@ def update(cls, payment_batch_id, note_attachment_payment_batch_id, monetary_acc
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- payment_batch_id, note_attachment_payment_batch_id)
+ mastercard_action_id, note_attachment_master_card_action_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -23378,12 +23901,13 @@ def update(cls, payment_batch_id, note_attachment_payment_batch_id, monetary_acc
)
@classmethod
- def delete(cls, payment_batch_id, note_attachment_payment_batch_id, monetary_account_id=None, custom_headers=None):
+ def delete(cls, mastercard_action_id, note_attachment_master_card_action_id, monetary_account_id=None,
+ custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type payment_batch_id: int
- :type note_attachment_payment_batch_id: int
+ :type mastercard_action_id: int
+ :type note_attachment_master_card_action_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -23395,7 +23919,7 @@ def delete(cls, payment_batch_id, note_attachment_payment_batch_id, monetary_acc
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- payment_batch_id, note_attachment_payment_batch_id)
+ mastercard_action_id, note_attachment_master_card_action_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -23403,17 +23927,17 @@ def delete(cls, payment_batch_id, note_attachment_payment_batch_id, monetary_acc
)
@classmethod
- def list(cls, payment_batch_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, mastercard_action_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type payment_batch_id: int
+ :type mastercard_action_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentPaymentBatchList
+ :rtype: BunqResponseNoteAttachmentMasterCardActionList
"""
if params is None:
@@ -23425,24 +23949,25 @@ def list(cls, payment_batch_id, monetary_account_id=None, params=None, custom_he
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- payment_batch_id)
+ mastercard_action_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteAttachmentPaymentBatchList.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentMasterCardActionList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, payment_batch_id, note_attachment_payment_batch_id, monetary_account_id=None, custom_headers=None):
+ def get(cls, mastercard_action_id, note_attachment_master_card_action_id, monetary_account_id=None,
+ custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type payment_batch_id: int
- :type note_attachment_payment_batch_id: int
+ :type mastercard_action_id: int
+ :type note_attachment_master_card_action_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentPaymentBatch
+ :rtype: BunqResponseNoteAttachmentMasterCardAction
"""
if custom_headers is None:
@@ -23451,10 +23976,10 @@ def get(cls, payment_batch_id, note_attachment_payment_batch_id, monetary_accoun
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- payment_batch_id, note_attachment_payment_batch_id)
+ mastercard_action_id, note_attachment_master_card_action_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteAttachmentPaymentBatch.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentMasterCardAction.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -23536,13 +24061,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteAttachmentPaymentBatch
+ :rtype: NoteAttachmentMasterCardAction
"""
- return converter.json_to_class(NoteAttachmentPaymentBatch, json_str)
+ return converter.json_to_class(NoteAttachmentMasterCardAction, json_str)
-class NoteTextPaymentBatch(BunqModel):
+class NoteTextMasterCardAction(BunqModel):
"""
Used to manage text notes.
@@ -23559,11 +24084,11 @@ class NoteTextPaymentBatch(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/payment-batch/{}/note-text"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/payment-batch/{}/note-text/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/payment-batch/{}/note-text/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/payment-batch/{}/note-text"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/payment-batch/{}/note-text/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/mastercard-action/{}/note-text"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/mastercard-action/{}/note-text/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/mastercard-action/{}/note-text/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/mastercard-action/{}/note-text"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/mastercard-action/{}/note-text/{}"
# Field constants.
FIELD_CONTENT = "content"
@@ -23587,11 +24112,11 @@ def __init__(self, content=None):
self._content_field_for_request = content
@classmethod
- def create(cls, payment_batch_id, monetary_account_id=None, content=None, custom_headers=None):
+ def create(cls, mastercard_action_id, monetary_account_id=None, content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type payment_batch_id: int
+ :type mastercard_action_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -23612,7 +24137,7 @@ def create(cls, payment_batch_id, monetary_account_id=None, content=None, custom
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- payment_batch_id)
+ mastercard_action_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -23620,13 +24145,13 @@ def create(cls, payment_batch_id, monetary_account_id=None, content=None, custom
)
@classmethod
- def update(cls, payment_batch_id, note_text_payment_batch_id, monetary_account_id=None, content=None,
+ def update(cls, mastercard_action_id, note_text_master_card_action_id, monetary_account_id=None, content=None,
custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type payment_batch_id: int
- :type note_text_payment_batch_id: int
+ :type mastercard_action_id: int
+ :type note_text_master_card_action_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -23648,7 +24173,7 @@ def update(cls, payment_batch_id, note_text_payment_batch_id, monetary_account_i
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- payment_batch_id, note_text_payment_batch_id)
+ mastercard_action_id, note_text_master_card_action_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -23656,12 +24181,13 @@ def update(cls, payment_batch_id, note_text_payment_batch_id, monetary_account_i
)
@classmethod
- def delete(cls, payment_batch_id, note_text_payment_batch_id, monetary_account_id=None, custom_headers=None):
+ def delete(cls, mastercard_action_id, note_text_master_card_action_id, monetary_account_id=None,
+ custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type payment_batch_id: int
- :type note_text_payment_batch_id: int
+ :type mastercard_action_id: int
+ :type note_text_master_card_action_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -23673,7 +24199,7 @@ def delete(cls, payment_batch_id, note_text_payment_batch_id, monetary_account_i
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- payment_batch_id, note_text_payment_batch_id)
+ mastercard_action_id, note_text_master_card_action_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -23681,17 +24207,17 @@ def delete(cls, payment_batch_id, note_text_payment_batch_id, monetary_account_i
)
@classmethod
- def list(cls, payment_batch_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, mastercard_action_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type payment_batch_id: int
+ :type mastercard_action_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextPaymentBatchList
+ :rtype: BunqResponseNoteTextMasterCardActionList
"""
if params is None:
@@ -23703,24 +24229,24 @@ def list(cls, payment_batch_id, monetary_account_id=None, params=None, custom_he
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- payment_batch_id)
+ mastercard_action_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteTextPaymentBatchList.cast_from_bunq_response(
+ return BunqResponseNoteTextMasterCardActionList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, payment_batch_id, note_text_payment_batch_id, monetary_account_id=None, custom_headers=None):
+ def get(cls, mastercard_action_id, note_text_master_card_action_id, monetary_account_id=None, custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type payment_batch_id: int
- :type note_text_payment_batch_id: int
+ :type mastercard_action_id: int
+ :type note_text_master_card_action_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextPaymentBatch
+ :rtype: BunqResponseNoteTextMasterCardAction
"""
if custom_headers is None:
@@ -23729,10 +24255,10 @@ def get(cls, payment_batch_id, note_text_payment_batch_id, monetary_account_id=N
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- payment_batch_id, note_text_payment_batch_id)
+ mastercard_action_id, note_text_master_card_action_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteTextPaymentBatch.cast_from_bunq_response(
+ return BunqResponseNoteTextMasterCardAction.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -23803,13 +24329,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteTextPaymentBatch
+ :rtype: NoteTextMasterCardAction
"""
- return converter.json_to_class(NoteTextPaymentBatch, json_str)
+ return converter.json_to_class(NoteTextMasterCardAction, json_str)
-class NoteAttachmentPayment(BunqModel):
+class NoteAttachmentPaymentBatch(BunqModel):
"""
Used to manage attachment notes.
@@ -23831,11 +24357,11 @@ class NoteAttachmentPayment(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/payment/{}/note-attachment"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/payment/{}/note-attachment/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/payment/{}/note-attachment/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/payment/{}/note-attachment"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/payment/{}/note-attachment/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/payment-batch/{}/note-attachment"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/payment-batch/{}/note-attachment/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/payment-batch/{}/note-attachment/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/payment-batch/{}/note-attachment"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/payment-batch/{}/note-attachment/{}"
# Field constants.
FIELD_DESCRIPTION = "description"
@@ -23866,11 +24392,11 @@ def __init__(self, attachment_id, description=None):
self._description_field_for_request = description
@classmethod
- def create(cls, payment_id, attachment_id, monetary_account_id=None, description=None, custom_headers=None):
+ def create(cls, payment_batch_id, attachment_id, monetary_account_id=None, description=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type payment_id: int
+ :type payment_batch_id: int
:param attachment_id: The reference to the uploaded file to attach to
this note.
:type attachment_id: int
@@ -23895,7 +24421,7 @@ def create(cls, payment_id, attachment_id, monetary_account_id=None, description
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- payment_id)
+ payment_batch_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -23903,13 +24429,13 @@ def create(cls, payment_id, attachment_id, monetary_account_id=None, description
)
@classmethod
- def update(cls, payment_id, note_attachment_payment_id, monetary_account_id=None, description=None,
+ def update(cls, payment_batch_id, note_attachment_payment_batch_id, monetary_account_id=None, description=None,
custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type payment_id: int
- :type note_attachment_payment_id: int
+ :type payment_batch_id: int
+ :type note_attachment_payment_batch_id: int
:param description: Optional description of the attachment.
:type description: str
:type custom_headers: dict[str, str]|None
@@ -23931,7 +24457,7 @@ def update(cls, payment_id, note_attachment_payment_id, monetary_account_id=None
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- payment_id, note_attachment_payment_id)
+ payment_batch_id, note_attachment_payment_batch_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -23939,12 +24465,12 @@ def update(cls, payment_id, note_attachment_payment_id, monetary_account_id=None
)
@classmethod
- def delete(cls, payment_id, note_attachment_payment_id, monetary_account_id=None, custom_headers=None):
+ def delete(cls, payment_batch_id, note_attachment_payment_batch_id, monetary_account_id=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type payment_id: int
- :type note_attachment_payment_id: int
+ :type payment_batch_id: int
+ :type note_attachment_payment_batch_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -23956,7 +24482,7 @@ def delete(cls, payment_id, note_attachment_payment_id, monetary_account_id=None
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- payment_id, note_attachment_payment_id)
+ payment_batch_id, note_attachment_payment_batch_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -23964,17 +24490,17 @@ def delete(cls, payment_id, note_attachment_payment_id, monetary_account_id=None
)
@classmethod
- def list(cls, payment_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, payment_batch_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type payment_id: int
+ :type payment_batch_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentPaymentList
+ :rtype: BunqResponseNoteAttachmentPaymentBatchList
"""
if params is None:
@@ -23986,24 +24512,24 @@ def list(cls, payment_id, monetary_account_id=None, params=None, custom_headers=
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- payment_id)
+ payment_batch_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteAttachmentPaymentList.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentPaymentBatchList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, payment_id, note_attachment_payment_id, monetary_account_id=None, custom_headers=None):
+ def get(cls, payment_batch_id, note_attachment_payment_batch_id, monetary_account_id=None, custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type payment_id: int
- :type note_attachment_payment_id: int
+ :type payment_batch_id: int
+ :type note_attachment_payment_batch_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentPayment
+ :rtype: BunqResponseNoteAttachmentPaymentBatch
"""
if custom_headers is None:
@@ -24012,10 +24538,10 @@ def get(cls, payment_id, note_attachment_payment_id, monetary_account_id=None, c
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- payment_id, note_attachment_payment_id)
+ payment_batch_id, note_attachment_payment_batch_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteAttachmentPayment.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentPaymentBatch.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -24097,13 +24623,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteAttachmentPayment
+ :rtype: NoteAttachmentPaymentBatch
"""
- return converter.json_to_class(NoteAttachmentPayment, json_str)
+ return converter.json_to_class(NoteAttachmentPaymentBatch, json_str)
-class NoteTextPayment(BunqModel):
+class NoteTextPaymentBatch(BunqModel):
"""
Used to manage text notes.
@@ -24120,11 +24646,11 @@ class NoteTextPayment(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/payment/{}/note-text"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/payment/{}/note-text/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/payment/{}/note-text/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/payment/{}/note-text"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/payment/{}/note-text/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/payment-batch/{}/note-text"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/payment-batch/{}/note-text/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/payment-batch/{}/note-text/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/payment-batch/{}/note-text"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/payment-batch/{}/note-text/{}"
# Field constants.
FIELD_CONTENT = "content"
@@ -24148,11 +24674,11 @@ def __init__(self, content=None):
self._content_field_for_request = content
@classmethod
- def create(cls, payment_id, monetary_account_id=None, content=None, custom_headers=None):
+ def create(cls, payment_batch_id, monetary_account_id=None, content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type payment_id: int
+ :type payment_batch_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -24173,7 +24699,7 @@ def create(cls, payment_id, monetary_account_id=None, content=None, custom_heade
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- payment_id)
+ payment_batch_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -24181,12 +24707,13 @@ def create(cls, payment_id, monetary_account_id=None, content=None, custom_heade
)
@classmethod
- def update(cls, payment_id, note_text_payment_id, monetary_account_id=None, content=None, custom_headers=None):
+ def update(cls, payment_batch_id, note_text_payment_batch_id, monetary_account_id=None, content=None,
+ custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type payment_id: int
- :type note_text_payment_id: int
+ :type payment_batch_id: int
+ :type note_text_payment_batch_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -24208,7 +24735,7 @@ def update(cls, payment_id, note_text_payment_id, monetary_account_id=None, cont
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- payment_id, note_text_payment_id)
+ payment_batch_id, note_text_payment_batch_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -24216,12 +24743,12 @@ def update(cls, payment_id, note_text_payment_id, monetary_account_id=None, cont
)
@classmethod
- def delete(cls, payment_id, note_text_payment_id, monetary_account_id=None, custom_headers=None):
+ def delete(cls, payment_batch_id, note_text_payment_batch_id, monetary_account_id=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type payment_id: int
- :type note_text_payment_id: int
+ :type payment_batch_id: int
+ :type note_text_payment_batch_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -24233,7 +24760,7 @@ def delete(cls, payment_id, note_text_payment_id, monetary_account_id=None, cust
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- payment_id, note_text_payment_id)
+ payment_batch_id, note_text_payment_batch_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -24241,17 +24768,17 @@ def delete(cls, payment_id, note_text_payment_id, monetary_account_id=None, cust
)
@classmethod
- def list(cls, payment_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, payment_batch_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type payment_id: int
+ :type payment_batch_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextPaymentList
+ :rtype: BunqResponseNoteTextPaymentBatchList
"""
if params is None:
@@ -24263,24 +24790,24 @@ def list(cls, payment_id, monetary_account_id=None, params=None, custom_headers=
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- payment_id)
+ payment_batch_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteTextPaymentList.cast_from_bunq_response(
+ return BunqResponseNoteTextPaymentBatchList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, payment_id, note_text_payment_id, monetary_account_id=None, custom_headers=None):
+ def get(cls, payment_batch_id, note_text_payment_batch_id, monetary_account_id=None, custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type payment_id: int
- :type note_text_payment_id: int
+ :type payment_batch_id: int
+ :type note_text_payment_batch_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextPayment
+ :rtype: BunqResponseNoteTextPaymentBatch
"""
if custom_headers is None:
@@ -24289,10 +24816,10 @@ def get(cls, payment_id, note_text_payment_id, monetary_account_id=None, custom_
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- payment_id, note_text_payment_id)
+ payment_batch_id, note_text_payment_batch_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteTextPayment.cast_from_bunq_response(
+ return BunqResponseNoteTextPaymentBatch.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -24363,13 +24890,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteTextPayment
+ :rtype: NoteTextPaymentBatch
"""
- return converter.json_to_class(NoteTextPayment, json_str)
+ return converter.json_to_class(NoteTextPaymentBatch, json_str)
-class NoteAttachmentRequestInquiryBatch(BunqModel):
+class NoteAttachmentPayment(BunqModel):
"""
Used to manage attachment notes.
@@ -24391,11 +24918,11 @@ class NoteAttachmentRequestInquiryBatch(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/request-inquiry-batch/{}/note-attachment"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/request-inquiry-batch/{}/note-attachment/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/request-inquiry-batch/{}/note-attachment/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/request-inquiry-batch/{}/note-attachment"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/request-inquiry-batch/{}/note-attachment/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/payment/{}/note-attachment"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/payment/{}/note-attachment/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/payment/{}/note-attachment/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/payment/{}/note-attachment"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/payment/{}/note-attachment/{}"
# Field constants.
FIELD_DESCRIPTION = "description"
@@ -24426,12 +24953,11 @@ def __init__(self, attachment_id, description=None):
self._description_field_for_request = description
@classmethod
- def create(cls, request_inquiry_batch_id, attachment_id, monetary_account_id=None, description=None,
- custom_headers=None):
+ def create(cls, payment_id, attachment_id, monetary_account_id=None, description=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_batch_id: int
+ :type payment_id: int
:param attachment_id: The reference to the uploaded file to attach to
this note.
:type attachment_id: int
@@ -24456,7 +24982,7 @@ def create(cls, request_inquiry_batch_id, attachment_id, monetary_account_id=Non
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_batch_id)
+ payment_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -24464,13 +24990,13 @@ def create(cls, request_inquiry_batch_id, attachment_id, monetary_account_id=Non
)
@classmethod
- def update(cls, request_inquiry_batch_id, note_attachment_request_inquiry_batch_id, monetary_account_id=None,
- description=None, custom_headers=None):
+ def update(cls, payment_id, note_attachment_payment_id, monetary_account_id=None, description=None,
+ custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_batch_id: int
- :type note_attachment_request_inquiry_batch_id: int
+ :type payment_id: int
+ :type note_attachment_payment_id: int
:param description: Optional description of the attachment.
:type description: str
:type custom_headers: dict[str, str]|None
@@ -24492,8 +25018,7 @@ def update(cls, request_inquiry_batch_id, note_attachment_request_inquiry_batch_
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_batch_id,
- note_attachment_request_inquiry_batch_id)
+ payment_id, note_attachment_payment_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -24501,13 +25026,12 @@ def update(cls, request_inquiry_batch_id, note_attachment_request_inquiry_batch_
)
@classmethod
- def delete(cls, request_inquiry_batch_id, note_attachment_request_inquiry_batch_id, monetary_account_id=None,
- custom_headers=None):
+ def delete(cls, payment_id, note_attachment_payment_id, monetary_account_id=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_batch_id: int
- :type note_attachment_request_inquiry_batch_id: int
+ :type payment_id: int
+ :type note_attachment_payment_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -24519,8 +25043,7 @@ def delete(cls, request_inquiry_batch_id, note_attachment_request_inquiry_batch_
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_batch_id,
- note_attachment_request_inquiry_batch_id)
+ payment_id, note_attachment_payment_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -24528,17 +25051,17 @@ def delete(cls, request_inquiry_batch_id, note_attachment_request_inquiry_batch_
)
@classmethod
- def list(cls, request_inquiry_batch_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, payment_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_batch_id: int
+ :type payment_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentRequestInquiryBatchList
+ :rtype: BunqResponseNoteAttachmentPaymentList
"""
if params is None:
@@ -24550,25 +25073,24 @@ def list(cls, request_inquiry_batch_id, monetary_account_id=None, params=None, c
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_batch_id)
+ payment_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteAttachmentRequestInquiryBatchList.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentPaymentList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, request_inquiry_batch_id, note_attachment_request_inquiry_batch_id, monetary_account_id=None,
- custom_headers=None):
+ def get(cls, payment_id, note_attachment_payment_id, monetary_account_id=None, custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_batch_id: int
- :type note_attachment_request_inquiry_batch_id: int
+ :type payment_id: int
+ :type note_attachment_payment_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentRequestInquiryBatch
+ :rtype: BunqResponseNoteAttachmentPayment
"""
if custom_headers is None:
@@ -24577,10 +25099,10 @@ def get(cls, request_inquiry_batch_id, note_attachment_request_inquiry_batch_id,
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_batch_id, note_attachment_request_inquiry_batch_id)
+ payment_id, note_attachment_payment_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteAttachmentRequestInquiryBatch.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentPayment.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -24662,13 +25184,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteAttachmentRequestInquiryBatch
+ :rtype: NoteAttachmentPayment
"""
- return converter.json_to_class(NoteAttachmentRequestInquiryBatch, json_str)
+ return converter.json_to_class(NoteAttachmentPayment, json_str)
-class NoteTextRequestInquiryBatch(BunqModel):
+class NoteTextPayment(BunqModel):
"""
Used to manage text notes.
@@ -24685,11 +25207,11 @@ class NoteTextRequestInquiryBatch(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/request-inquiry-batch/{}/note-text"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/request-inquiry-batch/{}/note-text/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/request-inquiry-batch/{}/note-text/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/request-inquiry-batch/{}/note-text"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/request-inquiry-batch/{}/note-text/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/payment/{}/note-text"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/payment/{}/note-text/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/payment/{}/note-text/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/payment/{}/note-text"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/payment/{}/note-text/{}"
# Field constants.
FIELD_CONTENT = "content"
@@ -24713,11 +25235,11 @@ def __init__(self, content=None):
self._content_field_for_request = content
@classmethod
- def create(cls, request_inquiry_batch_id, monetary_account_id=None, content=None, custom_headers=None):
+ def create(cls, payment_id, monetary_account_id=None, content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_batch_id: int
+ :type payment_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -24738,7 +25260,7 @@ def create(cls, request_inquiry_batch_id, monetary_account_id=None, content=None
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_batch_id)
+ payment_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -24746,13 +25268,12 @@ def create(cls, request_inquiry_batch_id, monetary_account_id=None, content=None
)
@classmethod
- def update(cls, request_inquiry_batch_id, note_text_request_inquiry_batch_id, monetary_account_id=None,
- content=None, custom_headers=None):
+ def update(cls, payment_id, note_text_payment_id, monetary_account_id=None, content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_batch_id: int
- :type note_text_request_inquiry_batch_id: int
+ :type payment_id: int
+ :type note_text_payment_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -24774,7 +25295,7 @@ def update(cls, request_inquiry_batch_id, note_text_request_inquiry_batch_id, mo
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_batch_id, note_text_request_inquiry_batch_id)
+ payment_id, note_text_payment_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -24782,13 +25303,12 @@ def update(cls, request_inquiry_batch_id, note_text_request_inquiry_batch_id, mo
)
@classmethod
- def delete(cls, request_inquiry_batch_id, note_text_request_inquiry_batch_id, monetary_account_id=None,
- custom_headers=None):
+ def delete(cls, payment_id, note_text_payment_id, monetary_account_id=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_batch_id: int
- :type note_text_request_inquiry_batch_id: int
+ :type payment_id: int
+ :type note_text_payment_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -24800,7 +25320,7 @@ def delete(cls, request_inquiry_batch_id, note_text_request_inquiry_batch_id, mo
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_batch_id, note_text_request_inquiry_batch_id)
+ payment_id, note_text_payment_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -24808,17 +25328,17 @@ def delete(cls, request_inquiry_batch_id, note_text_request_inquiry_batch_id, mo
)
@classmethod
- def list(cls, request_inquiry_batch_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, payment_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_batch_id: int
+ :type payment_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextRequestInquiryBatchList
+ :rtype: BunqResponseNoteTextPaymentList
"""
if params is None:
@@ -24830,25 +25350,24 @@ def list(cls, request_inquiry_batch_id, monetary_account_id=None, params=None, c
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_batch_id)
+ payment_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteTextRequestInquiryBatchList.cast_from_bunq_response(
+ return BunqResponseNoteTextPaymentList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, request_inquiry_batch_id, note_text_request_inquiry_batch_id, monetary_account_id=None,
- custom_headers=None):
+ def get(cls, payment_id, note_text_payment_id, monetary_account_id=None, custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_batch_id: int
- :type note_text_request_inquiry_batch_id: int
+ :type payment_id: int
+ :type note_text_payment_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextRequestInquiryBatch
+ :rtype: BunqResponseNoteTextPayment
"""
if custom_headers is None:
@@ -24857,10 +25376,10 @@ def get(cls, request_inquiry_batch_id, note_text_request_inquiry_batch_id, monet
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_batch_id, note_text_request_inquiry_batch_id)
+ payment_id, note_text_payment_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteTextRequestInquiryBatch.cast_from_bunq_response(
+ return BunqResponseNoteTextPayment.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -24931,13 +25450,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteTextRequestInquiryBatch
+ :rtype: NoteTextPayment
"""
- return converter.json_to_class(NoteTextRequestInquiryBatch, json_str)
+ return converter.json_to_class(NoteTextPayment, json_str)
-class NoteAttachmentRequestInquiry(BunqModel):
+class NoteAttachmentRequestInquiryBatch(BunqModel):
"""
Used to manage attachment notes.
@@ -24959,11 +25478,11 @@ class NoteAttachmentRequestInquiry(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/request-inquiry/{}/note-attachment"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/request-inquiry/{}/note-attachment/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/request-inquiry/{}/note-attachment/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/request-inquiry/{}/note-attachment"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/request-inquiry/{}/note-attachment/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/request-inquiry-batch/{}/note-attachment"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/request-inquiry-batch/{}/note-attachment/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/request-inquiry-batch/{}/note-attachment/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/request-inquiry-batch/{}/note-attachment"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/request-inquiry-batch/{}/note-attachment/{}"
# Field constants.
FIELD_DESCRIPTION = "description"
@@ -24994,11 +25513,12 @@ def __init__(self, attachment_id, description=None):
self._description_field_for_request = description
@classmethod
- def create(cls, request_inquiry_id, attachment_id, monetary_account_id=None, description=None, custom_headers=None):
+ def create(cls, request_inquiry_batch_id, attachment_id, monetary_account_id=None, description=None,
+ custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_id: int
+ :type request_inquiry_batch_id: int
:param attachment_id: The reference to the uploaded file to attach to
this note.
:type attachment_id: int
@@ -25023,7 +25543,7 @@ def create(cls, request_inquiry_id, attachment_id, monetary_account_id=None, des
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_id)
+ request_inquiry_batch_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -25031,13 +25551,13 @@ def create(cls, request_inquiry_id, attachment_id, monetary_account_id=None, des
)
@classmethod
- def update(cls, request_inquiry_id, note_attachment_request_inquiry_id, monetary_account_id=None, description=None,
- custom_headers=None):
+ def update(cls, request_inquiry_batch_id, note_attachment_request_inquiry_batch_id, monetary_account_id=None,
+ description=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_id: int
- :type note_attachment_request_inquiry_id: int
+ :type request_inquiry_batch_id: int
+ :type note_attachment_request_inquiry_batch_id: int
:param description: Optional description of the attachment.
:type description: str
:type custom_headers: dict[str, str]|None
@@ -25059,7 +25579,8 @@ def update(cls, request_inquiry_id, note_attachment_request_inquiry_id, monetary
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_id, note_attachment_request_inquiry_id)
+ request_inquiry_batch_id,
+ note_attachment_request_inquiry_batch_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -25067,13 +25588,13 @@ def update(cls, request_inquiry_id, note_attachment_request_inquiry_id, monetary
)
@classmethod
- def delete(cls, request_inquiry_id, note_attachment_request_inquiry_id, monetary_account_id=None,
+ def delete(cls, request_inquiry_batch_id, note_attachment_request_inquiry_batch_id, monetary_account_id=None,
custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_id: int
- :type note_attachment_request_inquiry_id: int
+ :type request_inquiry_batch_id: int
+ :type note_attachment_request_inquiry_batch_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -25085,7 +25606,8 @@ def delete(cls, request_inquiry_id, note_attachment_request_inquiry_id, monetary
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_id, note_attachment_request_inquiry_id)
+ request_inquiry_batch_id,
+ note_attachment_request_inquiry_batch_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -25093,17 +25615,17 @@ def delete(cls, request_inquiry_id, note_attachment_request_inquiry_id, monetary
)
@classmethod
- def list(cls, request_inquiry_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, request_inquiry_batch_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_id: int
+ :type request_inquiry_batch_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentRequestInquiryList
+ :rtype: BunqResponseNoteAttachmentRequestInquiryBatchList
"""
if params is None:
@@ -25115,24 +25637,25 @@ def list(cls, request_inquiry_id, monetary_account_id=None, params=None, custom_
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_id)
+ request_inquiry_batch_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteAttachmentRequestInquiryList.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentRequestInquiryBatchList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, request_inquiry_id, note_attachment_request_inquiry_id, monetary_account_id=None, custom_headers=None):
+ def get(cls, request_inquiry_batch_id, note_attachment_request_inquiry_batch_id, monetary_account_id=None,
+ custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_id: int
- :type note_attachment_request_inquiry_id: int
+ :type request_inquiry_batch_id: int
+ :type note_attachment_request_inquiry_batch_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentRequestInquiry
+ :rtype: BunqResponseNoteAttachmentRequestInquiryBatch
"""
if custom_headers is None:
@@ -25141,10 +25664,10 @@ def get(cls, request_inquiry_id, note_attachment_request_inquiry_id, monetary_ac
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_id, note_attachment_request_inquiry_id)
+ request_inquiry_batch_id, note_attachment_request_inquiry_batch_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteAttachmentRequestInquiry.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentRequestInquiryBatch.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -25226,13 +25749,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteAttachmentRequestInquiry
+ :rtype: NoteAttachmentRequestInquiryBatch
"""
- return converter.json_to_class(NoteAttachmentRequestInquiry, json_str)
+ return converter.json_to_class(NoteAttachmentRequestInquiryBatch, json_str)
-class NoteTextRequestInquiry(BunqModel):
+class NoteTextRequestInquiryBatch(BunqModel):
"""
Used to manage text notes.
@@ -25249,11 +25772,11 @@ class NoteTextRequestInquiry(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/request-inquiry/{}/note-text"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/request-inquiry/{}/note-text/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/request-inquiry/{}/note-text/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/request-inquiry/{}/note-text"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/request-inquiry/{}/note-text/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/request-inquiry-batch/{}/note-text"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/request-inquiry-batch/{}/note-text/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/request-inquiry-batch/{}/note-text/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/request-inquiry-batch/{}/note-text"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/request-inquiry-batch/{}/note-text/{}"
# Field constants.
FIELD_CONTENT = "content"
@@ -25277,11 +25800,11 @@ def __init__(self, content=None):
self._content_field_for_request = content
@classmethod
- def create(cls, request_inquiry_id, monetary_account_id=None, content=None, custom_headers=None):
+ def create(cls, request_inquiry_batch_id, monetary_account_id=None, content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_id: int
+ :type request_inquiry_batch_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -25302,7 +25825,7 @@ def create(cls, request_inquiry_id, monetary_account_id=None, content=None, cust
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_id)
+ request_inquiry_batch_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -25310,13 +25833,13 @@ def create(cls, request_inquiry_id, monetary_account_id=None, content=None, cust
)
@classmethod
- def update(cls, request_inquiry_id, note_text_request_inquiry_id, monetary_account_id=None, content=None,
- custom_headers=None):
+ def update(cls, request_inquiry_batch_id, note_text_request_inquiry_batch_id, monetary_account_id=None,
+ content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_id: int
- :type note_text_request_inquiry_id: int
+ :type request_inquiry_batch_id: int
+ :type note_text_request_inquiry_batch_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -25338,7 +25861,7 @@ def update(cls, request_inquiry_id, note_text_request_inquiry_id, monetary_accou
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_id, note_text_request_inquiry_id)
+ request_inquiry_batch_id, note_text_request_inquiry_batch_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -25346,12 +25869,13 @@ def update(cls, request_inquiry_id, note_text_request_inquiry_id, monetary_accou
)
@classmethod
- def delete(cls, request_inquiry_id, note_text_request_inquiry_id, monetary_account_id=None, custom_headers=None):
+ def delete(cls, request_inquiry_batch_id, note_text_request_inquiry_batch_id, monetary_account_id=None,
+ custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_id: int
- :type note_text_request_inquiry_id: int
+ :type request_inquiry_batch_id: int
+ :type note_text_request_inquiry_batch_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -25363,7 +25887,7 @@ def delete(cls, request_inquiry_id, note_text_request_inquiry_id, monetary_accou
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_id, note_text_request_inquiry_id)
+ request_inquiry_batch_id, note_text_request_inquiry_batch_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -25371,17 +25895,17 @@ def delete(cls, request_inquiry_id, note_text_request_inquiry_id, monetary_accou
)
@classmethod
- def list(cls, request_inquiry_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, request_inquiry_batch_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_id: int
+ :type request_inquiry_batch_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextRequestInquiryList
+ :rtype: BunqResponseNoteTextRequestInquiryBatchList
"""
if params is None:
@@ -25393,24 +25917,25 @@ def list(cls, request_inquiry_id, monetary_account_id=None, params=None, custom_
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_id)
+ request_inquiry_batch_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteTextRequestInquiryList.cast_from_bunq_response(
+ return BunqResponseNoteTextRequestInquiryBatchList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, request_inquiry_id, note_text_request_inquiry_id, monetary_account_id=None, custom_headers=None):
+ def get(cls, request_inquiry_batch_id, note_text_request_inquiry_batch_id, monetary_account_id=None,
+ custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type request_inquiry_id: int
- :type note_text_request_inquiry_id: int
+ :type request_inquiry_batch_id: int
+ :type note_text_request_inquiry_batch_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextRequestInquiry
+ :rtype: BunqResponseNoteTextRequestInquiryBatch
"""
if custom_headers is None:
@@ -25419,10 +25944,10 @@ def get(cls, request_inquiry_id, note_text_request_inquiry_id, monetary_account_
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_inquiry_id, note_text_request_inquiry_id)
+ request_inquiry_batch_id, note_text_request_inquiry_batch_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteTextRequestInquiry.cast_from_bunq_response(
+ return BunqResponseNoteTextRequestInquiryBatch.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -25493,13 +26018,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteTextRequestInquiry
+ :rtype: NoteTextRequestInquiryBatch
"""
- return converter.json_to_class(NoteTextRequestInquiry, json_str)
+ return converter.json_to_class(NoteTextRequestInquiryBatch, json_str)
-class NoteAttachmentRequestResponse(BunqModel):
+class NoteAttachmentRequestInquiry(BunqModel):
"""
Used to manage attachment notes.
@@ -25521,11 +26046,11 @@ class NoteAttachmentRequestResponse(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/request-response/{}/note-attachment"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/request-response/{}/note-attachment/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/request-response/{}/note-attachment/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/request-response/{}/note-attachment"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/request-response/{}/note-attachment/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/request-inquiry/{}/note-attachment"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/request-inquiry/{}/note-attachment/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/request-inquiry/{}/note-attachment/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/request-inquiry/{}/note-attachment"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/request-inquiry/{}/note-attachment/{}"
# Field constants.
FIELD_DESCRIPTION = "description"
@@ -25556,12 +26081,11 @@ def __init__(self, attachment_id, description=None):
self._description_field_for_request = description
@classmethod
- def create(cls, request_response_id, attachment_id, monetary_account_id=None, description=None,
- custom_headers=None):
+ def create(cls, request_inquiry_id, attachment_id, monetary_account_id=None, description=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type request_response_id: int
+ :type request_inquiry_id: int
:param attachment_id: The reference to the uploaded file to attach to
this note.
:type attachment_id: int
@@ -25586,7 +26110,7 @@ def create(cls, request_response_id, attachment_id, monetary_account_id=None, de
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_response_id)
+ request_inquiry_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -25594,13 +26118,13 @@ def create(cls, request_response_id, attachment_id, monetary_account_id=None, de
)
@classmethod
- def update(cls, request_response_id, note_attachment_request_response_id, monetary_account_id=None,
- description=None, custom_headers=None):
+ def update(cls, request_inquiry_id, note_attachment_request_inquiry_id, monetary_account_id=None, description=None,
+ custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type request_response_id: int
- :type note_attachment_request_response_id: int
+ :type request_inquiry_id: int
+ :type note_attachment_request_inquiry_id: int
:param description: Optional description of the attachment.
:type description: str
:type custom_headers: dict[str, str]|None
@@ -25622,7 +26146,7 @@ def update(cls, request_response_id, note_attachment_request_response_id, moneta
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_response_id, note_attachment_request_response_id)
+ request_inquiry_id, note_attachment_request_inquiry_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -25630,13 +26154,13 @@ def update(cls, request_response_id, note_attachment_request_response_id, moneta
)
@classmethod
- def delete(cls, request_response_id, note_attachment_request_response_id, monetary_account_id=None,
+ def delete(cls, request_inquiry_id, note_attachment_request_inquiry_id, monetary_account_id=None,
custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type request_response_id: int
- :type note_attachment_request_response_id: int
+ :type request_inquiry_id: int
+ :type note_attachment_request_inquiry_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -25648,7 +26172,7 @@ def delete(cls, request_response_id, note_attachment_request_response_id, moneta
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_response_id, note_attachment_request_response_id)
+ request_inquiry_id, note_attachment_request_inquiry_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -25656,17 +26180,17 @@ def delete(cls, request_response_id, note_attachment_request_response_id, moneta
)
@classmethod
- def list(cls, request_response_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, request_inquiry_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type request_response_id: int
+ :type request_inquiry_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentRequestResponseList
+ :rtype: BunqResponseNoteAttachmentRequestInquiryList
"""
if params is None:
@@ -25678,25 +26202,24 @@ def list(cls, request_response_id, monetary_account_id=None, params=None, custom
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_response_id)
+ request_inquiry_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteAttachmentRequestResponseList.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentRequestInquiryList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, request_response_id, note_attachment_request_response_id, monetary_account_id=None,
- custom_headers=None):
+ def get(cls, request_inquiry_id, note_attachment_request_inquiry_id, monetary_account_id=None, custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type request_response_id: int
- :type note_attachment_request_response_id: int
+ :type request_inquiry_id: int
+ :type note_attachment_request_inquiry_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentRequestResponse
+ :rtype: BunqResponseNoteAttachmentRequestInquiry
"""
if custom_headers is None:
@@ -25705,10 +26228,10 @@ def get(cls, request_response_id, note_attachment_request_response_id, monetary_
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_response_id, note_attachment_request_response_id)
+ request_inquiry_id, note_attachment_request_inquiry_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteAttachmentRequestResponse.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentRequestInquiry.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -25790,13 +26313,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteAttachmentRequestResponse
+ :rtype: NoteAttachmentRequestInquiry
"""
- return converter.json_to_class(NoteAttachmentRequestResponse, json_str)
+ return converter.json_to_class(NoteAttachmentRequestInquiry, json_str)
-class NoteTextRequestResponse(BunqModel):
+class NoteTextRequestInquiry(BunqModel):
"""
Used to manage text notes.
@@ -25813,11 +26336,11 @@ class NoteTextRequestResponse(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/request-response/{}/note-text"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/request-response/{}/note-text/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/request-response/{}/note-text/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/request-response/{}/note-text"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/request-response/{}/note-text/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/request-inquiry/{}/note-text"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/request-inquiry/{}/note-text/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/request-inquiry/{}/note-text/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/request-inquiry/{}/note-text"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/request-inquiry/{}/note-text/{}"
# Field constants.
FIELD_CONTENT = "content"
@@ -25841,11 +26364,11 @@ def __init__(self, content=None):
self._content_field_for_request = content
@classmethod
- def create(cls, request_response_id, monetary_account_id=None, content=None, custom_headers=None):
+ def create(cls, request_inquiry_id, monetary_account_id=None, content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type request_response_id: int
+ :type request_inquiry_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -25866,7 +26389,7 @@ def create(cls, request_response_id, monetary_account_id=None, content=None, cus
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_response_id)
+ request_inquiry_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -25874,13 +26397,13 @@ def create(cls, request_response_id, monetary_account_id=None, content=None, cus
)
@classmethod
- def update(cls, request_response_id, note_text_request_response_id, monetary_account_id=None, content=None,
+ def update(cls, request_inquiry_id, note_text_request_inquiry_id, monetary_account_id=None, content=None,
custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type request_response_id: int
- :type note_text_request_response_id: int
+ :type request_inquiry_id: int
+ :type note_text_request_inquiry_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -25902,7 +26425,7 @@ def update(cls, request_response_id, note_text_request_response_id, monetary_acc
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_response_id, note_text_request_response_id)
+ request_inquiry_id, note_text_request_inquiry_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -25910,12 +26433,12 @@ def update(cls, request_response_id, note_text_request_response_id, monetary_acc
)
@classmethod
- def delete(cls, request_response_id, note_text_request_response_id, monetary_account_id=None, custom_headers=None):
+ def delete(cls, request_inquiry_id, note_text_request_inquiry_id, monetary_account_id=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type request_response_id: int
- :type note_text_request_response_id: int
+ :type request_inquiry_id: int
+ :type note_text_request_inquiry_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -25927,7 +26450,7 @@ def delete(cls, request_response_id, note_text_request_response_id, monetary_acc
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_response_id, note_text_request_response_id)
+ request_inquiry_id, note_text_request_inquiry_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -25935,17 +26458,17 @@ def delete(cls, request_response_id, note_text_request_response_id, monetary_acc
)
@classmethod
- def list(cls, request_response_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, request_inquiry_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type request_response_id: int
+ :type request_inquiry_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextRequestResponseList
+ :rtype: BunqResponseNoteTextRequestInquiryList
"""
if params is None:
@@ -25957,24 +26480,24 @@ def list(cls, request_response_id, monetary_account_id=None, params=None, custom
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_response_id)
+ request_inquiry_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteTextRequestResponseList.cast_from_bunq_response(
+ return BunqResponseNoteTextRequestInquiryList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, request_response_id, note_text_request_response_id, monetary_account_id=None, custom_headers=None):
+ def get(cls, request_inquiry_id, note_text_request_inquiry_id, monetary_account_id=None, custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type request_response_id: int
- :type note_text_request_response_id: int
+ :type request_inquiry_id: int
+ :type note_text_request_inquiry_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextRequestResponse
+ :rtype: BunqResponseNoteTextRequestInquiry
"""
if custom_headers is None:
@@ -25983,10 +26506,10 @@ def get(cls, request_response_id, note_text_request_response_id, monetary_accoun
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- request_response_id, note_text_request_response_id)
+ request_inquiry_id, note_text_request_inquiry_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteTextRequestResponse.cast_from_bunq_response(
+ return BunqResponseNoteTextRequestInquiry.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -26057,13 +26580,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteTextRequestResponse
+ :rtype: NoteTextRequestInquiry
"""
- return converter.json_to_class(NoteTextRequestResponse, json_str)
+ return converter.json_to_class(NoteTextRequestInquiry, json_str)
-class NoteAttachmentScheduleInstance(BunqModel):
+class NoteAttachmentRequestResponse(BunqModel):
"""
Used to manage attachment notes.
@@ -26085,11 +26608,11 @@ class NoteAttachmentScheduleInstance(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}/note-attachment"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}/note-attachment/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}/note-attachment/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}/note-attachment"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}/note-attachment/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/request-response/{}/note-attachment"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/request-response/{}/note-attachment/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/request-response/{}/note-attachment/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/request-response/{}/note-attachment"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/request-response/{}/note-attachment/{}"
# Field constants.
FIELD_DESCRIPTION = "description"
@@ -26120,13 +26643,12 @@ def __init__(self, attachment_id, description=None):
self._description_field_for_request = description
@classmethod
- def create(cls, schedule_id, schedule_instance_id, attachment_id, monetary_account_id=None, description=None,
+ def create(cls, request_response_id, attachment_id, monetary_account_id=None, description=None,
custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type schedule_id: int
- :type schedule_instance_id: int
+ :type request_response_id: int
:param attachment_id: The reference to the uploaded file to attach to
this note.
:type attachment_id: int
@@ -26151,7 +26673,7 @@ def create(cls, schedule_id, schedule_instance_id, attachment_id, monetary_accou
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_id, schedule_instance_id)
+ request_response_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -26159,14 +26681,13 @@ def create(cls, schedule_id, schedule_instance_id, attachment_id, monetary_accou
)
@classmethod
- def update(cls, schedule_id, schedule_instance_id, note_attachment_schedule_instance_id, monetary_account_id=None,
+ def update(cls, request_response_id, note_attachment_request_response_id, monetary_account_id=None,
description=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type schedule_id: int
- :type schedule_instance_id: int
- :type note_attachment_schedule_instance_id: int
+ :type request_response_id: int
+ :type note_attachment_request_response_id: int
:param description: Optional description of the attachment.
:type description: str
:type custom_headers: dict[str, str]|None
@@ -26188,8 +26709,7 @@ def update(cls, schedule_id, schedule_instance_id, note_attachment_schedule_inst
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_id, schedule_instance_id,
- note_attachment_schedule_instance_id)
+ request_response_id, note_attachment_request_response_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -26197,14 +26717,13 @@ def update(cls, schedule_id, schedule_instance_id, note_attachment_schedule_inst
)
@classmethod
- def delete(cls, schedule_id, schedule_instance_id, note_attachment_schedule_instance_id, monetary_account_id=None,
+ def delete(cls, request_response_id, note_attachment_request_response_id, monetary_account_id=None,
custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type schedule_id: int
- :type schedule_instance_id: int
- :type note_attachment_schedule_instance_id: int
+ :type request_response_id: int
+ :type note_attachment_request_response_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -26216,8 +26735,7 @@ def delete(cls, schedule_id, schedule_instance_id, note_attachment_schedule_inst
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_id, schedule_instance_id,
- note_attachment_schedule_instance_id)
+ request_response_id, note_attachment_request_response_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -26225,18 +26743,17 @@ def delete(cls, schedule_id, schedule_instance_id, note_attachment_schedule_inst
)
@classmethod
- def list(cls, schedule_id, schedule_instance_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, request_response_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type schedule_id: int
- :type schedule_instance_id: int
+ :type request_response_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentScheduleInstanceList
+ :rtype: BunqResponseNoteAttachmentRequestResponseList
"""
if params is None:
@@ -26248,26 +26765,25 @@ def list(cls, schedule_id, schedule_instance_id, monetary_account_id=None, param
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_id, schedule_instance_id)
+ request_response_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteAttachmentScheduleInstanceList.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentRequestResponseList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, schedule_id, schedule_instance_id, note_attachment_schedule_instance_id, monetary_account_id=None,
+ def get(cls, request_response_id, note_attachment_request_response_id, monetary_account_id=None,
custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type schedule_id: int
- :type schedule_instance_id: int
- :type note_attachment_schedule_instance_id: int
+ :type request_response_id: int
+ :type note_attachment_request_response_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentScheduleInstance
+ :rtype: BunqResponseNoteAttachmentRequestResponse
"""
if custom_headers is None:
@@ -26276,11 +26792,10 @@ def get(cls, schedule_id, schedule_instance_id, note_attachment_schedule_instanc
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_id, schedule_instance_id,
- note_attachment_schedule_instance_id)
+ request_response_id, note_attachment_request_response_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteAttachmentScheduleInstance.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentRequestResponse.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -26362,13 +26877,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteAttachmentScheduleInstance
+ :rtype: NoteAttachmentRequestResponse
"""
- return converter.json_to_class(NoteAttachmentScheduleInstance, json_str)
+ return converter.json_to_class(NoteAttachmentRequestResponse, json_str)
-class NoteTextScheduleInstance(BunqModel):
+class NoteTextRequestResponse(BunqModel):
"""
Used to manage text notes.
@@ -26385,11 +26900,11 @@ class NoteTextScheduleInstance(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}/note-text"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}/note-text/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}/note-text/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}/note-text"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}/note-text/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/request-response/{}/note-text"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/request-response/{}/note-text/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/request-response/{}/note-text/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/request-response/{}/note-text"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/request-response/{}/note-text/{}"
# Field constants.
FIELD_CONTENT = "content"
@@ -26413,12 +26928,11 @@ def __init__(self, content=None):
self._content_field_for_request = content
@classmethod
- def create(cls, schedule_id, schedule_instance_id, monetary_account_id=None, content=None, custom_headers=None):
+ def create(cls, request_response_id, monetary_account_id=None, content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type schedule_id: int
- :type schedule_instance_id: int
+ :type request_response_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -26439,7 +26953,7 @@ def create(cls, schedule_id, schedule_instance_id, monetary_account_id=None, con
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_id, schedule_instance_id)
+ request_response_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -26447,14 +26961,13 @@ def create(cls, schedule_id, schedule_instance_id, monetary_account_id=None, con
)
@classmethod
- def update(cls, schedule_id, schedule_instance_id, note_text_schedule_instance_id, monetary_account_id=None,
- content=None, custom_headers=None):
+ def update(cls, request_response_id, note_text_request_response_id, monetary_account_id=None, content=None,
+ custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type schedule_id: int
- :type schedule_instance_id: int
- :type note_text_schedule_instance_id: int
+ :type request_response_id: int
+ :type note_text_request_response_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -26476,8 +26989,7 @@ def update(cls, schedule_id, schedule_instance_id, note_text_schedule_instance_i
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_id, schedule_instance_id,
- note_text_schedule_instance_id)
+ request_response_id, note_text_request_response_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -26485,14 +26997,12 @@ def update(cls, schedule_id, schedule_instance_id, note_text_schedule_instance_i
)
@classmethod
- def delete(cls, schedule_id, schedule_instance_id, note_text_schedule_instance_id, monetary_account_id=None,
- custom_headers=None):
+ def delete(cls, request_response_id, note_text_request_response_id, monetary_account_id=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type schedule_id: int
- :type schedule_instance_id: int
- :type note_text_schedule_instance_id: int
+ :type request_response_id: int
+ :type note_text_request_response_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -26504,8 +27014,7 @@ def delete(cls, schedule_id, schedule_instance_id, note_text_schedule_instance_i
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_id, schedule_instance_id,
- note_text_schedule_instance_id)
+ request_response_id, note_text_request_response_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -26513,18 +27022,17 @@ def delete(cls, schedule_id, schedule_instance_id, note_text_schedule_instance_i
)
@classmethod
- def list(cls, schedule_id, schedule_instance_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, request_response_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type schedule_id: int
- :type schedule_instance_id: int
+ :type request_response_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextScheduleInstanceList
+ :rtype: BunqResponseNoteTextRequestResponseList
"""
if params is None:
@@ -26536,26 +27044,24 @@ def list(cls, schedule_id, schedule_instance_id, monetary_account_id=None, param
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_id, schedule_instance_id)
+ request_response_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteTextScheduleInstanceList.cast_from_bunq_response(
+ return BunqResponseNoteTextRequestResponseList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, schedule_id, schedule_instance_id, note_text_schedule_instance_id, monetary_account_id=None,
- custom_headers=None):
+ def get(cls, request_response_id, note_text_request_response_id, monetary_account_id=None, custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type schedule_id: int
- :type schedule_instance_id: int
- :type note_text_schedule_instance_id: int
+ :type request_response_id: int
+ :type note_text_request_response_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextScheduleInstance
+ :rtype: BunqResponseNoteTextRequestResponse
"""
if custom_headers is None:
@@ -26564,10 +27070,10 @@ def get(cls, schedule_id, schedule_instance_id, note_text_schedule_instance_id,
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_id, schedule_instance_id, note_text_schedule_instance_id)
+ request_response_id, note_text_request_response_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteTextScheduleInstance.cast_from_bunq_response(
+ return BunqResponseNoteTextRequestResponse.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -26638,13 +27144,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteTextScheduleInstance
+ :rtype: NoteTextRequestResponse
"""
- return converter.json_to_class(NoteTextScheduleInstance, json_str)
+ return converter.json_to_class(NoteTextRequestResponse, json_str)
-class NoteAttachmentSchedulePaymentBatch(BunqModel):
+class NoteAttachmentScheduleInstance(BunqModel):
"""
Used to manage attachment notes.
@@ -26666,11 +27172,11 @@ class NoteAttachmentSchedulePaymentBatch(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/schedule-payment-batch/{}/note-attachment"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/schedule-payment-batch/{}/note-attachment/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/schedule-payment-batch/{}/note-attachment/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/schedule-payment-batch/{}/note-attachment"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/schedule-payment-batch/{}/note-attachment/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}/note-attachment"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}/note-attachment/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}/note-attachment/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}/note-attachment"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}/note-attachment/{}"
# Field constants.
FIELD_DESCRIPTION = "description"
@@ -26701,12 +27207,13 @@ def __init__(self, attachment_id, description=None):
self._description_field_for_request = description
@classmethod
- def create(cls, schedule_payment_batch_id, attachment_id, monetary_account_id=None, description=None,
+ def create(cls, schedule_id, schedule_instance_id, attachment_id, monetary_account_id=None, description=None,
custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type schedule_payment_batch_id: int
+ :type schedule_id: int
+ :type schedule_instance_id: int
:param attachment_id: The reference to the uploaded file to attach to
this note.
:type attachment_id: int
@@ -26731,7 +27238,7 @@ def create(cls, schedule_payment_batch_id, attachment_id, monetary_account_id=No
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_batch_id)
+ schedule_id, schedule_instance_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -26739,13 +27246,14 @@ def create(cls, schedule_payment_batch_id, attachment_id, monetary_account_id=No
)
@classmethod
- def update(cls, schedule_payment_batch_id, note_attachment_schedule_payment_batch_id, monetary_account_id=None,
+ def update(cls, schedule_id, schedule_instance_id, note_attachment_schedule_instance_id, monetary_account_id=None,
description=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type schedule_payment_batch_id: int
- :type note_attachment_schedule_payment_batch_id: int
+ :type schedule_id: int
+ :type schedule_instance_id: int
+ :type note_attachment_schedule_instance_id: int
:param description: Optional description of the attachment.
:type description: str
:type custom_headers: dict[str, str]|None
@@ -26767,8 +27275,8 @@ def update(cls, schedule_payment_batch_id, note_attachment_schedule_payment_batc
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_batch_id,
- note_attachment_schedule_payment_batch_id)
+ schedule_id, schedule_instance_id,
+ note_attachment_schedule_instance_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -26776,13 +27284,14 @@ def update(cls, schedule_payment_batch_id, note_attachment_schedule_payment_batc
)
@classmethod
- def delete(cls, schedule_payment_batch_id, note_attachment_schedule_payment_batch_id, monetary_account_id=None,
+ def delete(cls, schedule_id, schedule_instance_id, note_attachment_schedule_instance_id, monetary_account_id=None,
custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type schedule_payment_batch_id: int
- :type note_attachment_schedule_payment_batch_id: int
+ :type schedule_id: int
+ :type schedule_instance_id: int
+ :type note_attachment_schedule_instance_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -26794,8 +27303,8 @@ def delete(cls, schedule_payment_batch_id, note_attachment_schedule_payment_batc
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_batch_id,
- note_attachment_schedule_payment_batch_id)
+ schedule_id, schedule_instance_id,
+ note_attachment_schedule_instance_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -26803,17 +27312,18 @@ def delete(cls, schedule_payment_batch_id, note_attachment_schedule_payment_batc
)
@classmethod
- def list(cls, schedule_payment_batch_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, schedule_id, schedule_instance_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type schedule_payment_batch_id: int
+ :type schedule_id: int
+ :type schedule_instance_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentSchedulePaymentBatchList
+ :rtype: BunqResponseNoteAttachmentScheduleInstanceList
"""
if params is None:
@@ -26825,25 +27335,26 @@ def list(cls, schedule_payment_batch_id, monetary_account_id=None, params=None,
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_batch_id)
+ schedule_id, schedule_instance_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteAttachmentSchedulePaymentBatchList.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentScheduleInstanceList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, schedule_payment_batch_id, note_attachment_schedule_payment_batch_id, monetary_account_id=None,
+ def get(cls, schedule_id, schedule_instance_id, note_attachment_schedule_instance_id, monetary_account_id=None,
custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type schedule_payment_batch_id: int
- :type note_attachment_schedule_payment_batch_id: int
+ :type schedule_id: int
+ :type schedule_instance_id: int
+ :type note_attachment_schedule_instance_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentSchedulePaymentBatch
+ :rtype: BunqResponseNoteAttachmentScheduleInstance
"""
if custom_headers is None:
@@ -26852,11 +27363,11 @@ def get(cls, schedule_payment_batch_id, note_attachment_schedule_payment_batch_i
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_batch_id,
- note_attachment_schedule_payment_batch_id)
+ schedule_id, schedule_instance_id,
+ note_attachment_schedule_instance_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteAttachmentSchedulePaymentBatch.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentScheduleInstance.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -26938,13 +27449,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteAttachmentSchedulePaymentBatch
+ :rtype: NoteAttachmentScheduleInstance
"""
- return converter.json_to_class(NoteAttachmentSchedulePaymentBatch, json_str)
+ return converter.json_to_class(NoteAttachmentScheduleInstance, json_str)
-class NoteTextSchedulePaymentBatch(BunqModel):
+class NoteTextScheduleInstance(BunqModel):
"""
Used to manage text notes.
@@ -26961,11 +27472,11 @@ class NoteTextSchedulePaymentBatch(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/schedule-payment-batch/{}/note-text"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/schedule-payment-batch/{}/note-text/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/schedule-payment-batch/{}/note-text/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/schedule-payment-batch/{}/note-text"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/schedule-payment-batch/{}/note-text/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}/note-text"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}/note-text/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}/note-text/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}/note-text"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/schedule/{}/schedule-instance/{}/note-text/{}"
# Field constants.
FIELD_CONTENT = "content"
@@ -26989,11 +27500,12 @@ def __init__(self, content=None):
self._content_field_for_request = content
@classmethod
- def create(cls, schedule_payment_batch_id, monetary_account_id=None, content=None, custom_headers=None):
+ def create(cls, schedule_id, schedule_instance_id, monetary_account_id=None, content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type schedule_payment_batch_id: int
+ :type schedule_id: int
+ :type schedule_instance_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -27014,7 +27526,7 @@ def create(cls, schedule_payment_batch_id, monetary_account_id=None, content=Non
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_batch_id)
+ schedule_id, schedule_instance_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -27022,13 +27534,14 @@ def create(cls, schedule_payment_batch_id, monetary_account_id=None, content=Non
)
@classmethod
- def update(cls, schedule_payment_batch_id, note_text_schedule_payment_batch_id, monetary_account_id=None,
+ def update(cls, schedule_id, schedule_instance_id, note_text_schedule_instance_id, monetary_account_id=None,
content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type schedule_payment_batch_id: int
- :type note_text_schedule_payment_batch_id: int
+ :type schedule_id: int
+ :type schedule_instance_id: int
+ :type note_text_schedule_instance_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -27050,7 +27563,8 @@ def update(cls, schedule_payment_batch_id, note_text_schedule_payment_batch_id,
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_batch_id, note_text_schedule_payment_batch_id)
+ schedule_id, schedule_instance_id,
+ note_text_schedule_instance_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -27058,13 +27572,14 @@ def update(cls, schedule_payment_batch_id, note_text_schedule_payment_batch_id,
)
@classmethod
- def delete(cls, schedule_payment_batch_id, note_text_schedule_payment_batch_id, monetary_account_id=None,
+ def delete(cls, schedule_id, schedule_instance_id, note_text_schedule_instance_id, monetary_account_id=None,
custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type schedule_payment_batch_id: int
- :type note_text_schedule_payment_batch_id: int
+ :type schedule_id: int
+ :type schedule_instance_id: int
+ :type note_text_schedule_instance_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -27076,7 +27591,8 @@ def delete(cls, schedule_payment_batch_id, note_text_schedule_payment_batch_id,
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_batch_id, note_text_schedule_payment_batch_id)
+ schedule_id, schedule_instance_id,
+ note_text_schedule_instance_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -27084,17 +27600,18 @@ def delete(cls, schedule_payment_batch_id, note_text_schedule_payment_batch_id,
)
@classmethod
- def list(cls, schedule_payment_batch_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, schedule_id, schedule_instance_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type schedule_payment_batch_id: int
+ :type schedule_id: int
+ :type schedule_instance_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextSchedulePaymentBatchList
+ :rtype: BunqResponseNoteTextScheduleInstanceList
"""
if params is None:
@@ -27106,25 +27623,26 @@ def list(cls, schedule_payment_batch_id, monetary_account_id=None, params=None,
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_batch_id)
+ schedule_id, schedule_instance_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteTextSchedulePaymentBatchList.cast_from_bunq_response(
+ return BunqResponseNoteTextScheduleInstanceList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, schedule_payment_batch_id, note_text_schedule_payment_batch_id, monetary_account_id=None,
+ def get(cls, schedule_id, schedule_instance_id, note_text_schedule_instance_id, monetary_account_id=None,
custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type schedule_payment_batch_id: int
- :type note_text_schedule_payment_batch_id: int
+ :type schedule_id: int
+ :type schedule_instance_id: int
+ :type note_text_schedule_instance_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextSchedulePaymentBatch
+ :rtype: BunqResponseNoteTextScheduleInstance
"""
if custom_headers is None:
@@ -27133,10 +27651,10 @@ def get(cls, schedule_payment_batch_id, note_text_schedule_payment_batch_id, mon
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_batch_id, note_text_schedule_payment_batch_id)
+ schedule_id, schedule_instance_id, note_text_schedule_instance_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteTextSchedulePaymentBatch.cast_from_bunq_response(
+ return BunqResponseNoteTextScheduleInstance.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -27207,13 +27725,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteTextSchedulePaymentBatch
+ :rtype: NoteTextScheduleInstance
"""
- return converter.json_to_class(NoteTextSchedulePaymentBatch, json_str)
+ return converter.json_to_class(NoteTextScheduleInstance, json_str)
-class NoteAttachmentSchedulePayment(BunqModel):
+class NoteAttachmentSchedulePaymentBatch(BunqModel):
"""
Used to manage attachment notes.
@@ -27235,11 +27753,11 @@ class NoteAttachmentSchedulePayment(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/schedule-payment/{}/note-attachment"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/schedule-payment/{}/note-attachment/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/schedule-payment/{}/note-attachment/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/schedule-payment/{}/note-attachment"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/schedule-payment/{}/note-attachment/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/schedule-payment-batch/{}/note-attachment"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/schedule-payment-batch/{}/note-attachment/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/schedule-payment-batch/{}/note-attachment/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/schedule-payment-batch/{}/note-attachment"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/schedule-payment-batch/{}/note-attachment/{}"
# Field constants.
FIELD_DESCRIPTION = "description"
@@ -27270,12 +27788,12 @@ def __init__(self, attachment_id, description=None):
self._description_field_for_request = description
@classmethod
- def create(cls, schedule_payment_id, attachment_id, monetary_account_id=None, description=None,
+ def create(cls, schedule_payment_batch_id, attachment_id, monetary_account_id=None, description=None,
custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type schedule_payment_id: int
+ :type schedule_payment_batch_id: int
:param attachment_id: The reference to the uploaded file to attach to
this note.
:type attachment_id: int
@@ -27300,7 +27818,7 @@ def create(cls, schedule_payment_id, attachment_id, monetary_account_id=None, de
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_id)
+ schedule_payment_batch_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -27308,13 +27826,13 @@ def create(cls, schedule_payment_id, attachment_id, monetary_account_id=None, de
)
@classmethod
- def update(cls, schedule_payment_id, note_attachment_schedule_payment_id, monetary_account_id=None,
+ def update(cls, schedule_payment_batch_id, note_attachment_schedule_payment_batch_id, monetary_account_id=None,
description=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type schedule_payment_id: int
- :type note_attachment_schedule_payment_id: int
+ :type schedule_payment_batch_id: int
+ :type note_attachment_schedule_payment_batch_id: int
:param description: Optional description of the attachment.
:type description: str
:type custom_headers: dict[str, str]|None
@@ -27336,7 +27854,8 @@ def update(cls, schedule_payment_id, note_attachment_schedule_payment_id, moneta
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_id, note_attachment_schedule_payment_id)
+ schedule_payment_batch_id,
+ note_attachment_schedule_payment_batch_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -27344,13 +27863,13 @@ def update(cls, schedule_payment_id, note_attachment_schedule_payment_id, moneta
)
@classmethod
- def delete(cls, schedule_payment_id, note_attachment_schedule_payment_id, monetary_account_id=None,
+ def delete(cls, schedule_payment_batch_id, note_attachment_schedule_payment_batch_id, monetary_account_id=None,
custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type schedule_payment_id: int
- :type note_attachment_schedule_payment_id: int
+ :type schedule_payment_batch_id: int
+ :type note_attachment_schedule_payment_batch_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -27362,7 +27881,8 @@ def delete(cls, schedule_payment_id, note_attachment_schedule_payment_id, moneta
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_id, note_attachment_schedule_payment_id)
+ schedule_payment_batch_id,
+ note_attachment_schedule_payment_batch_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -27370,17 +27890,17 @@ def delete(cls, schedule_payment_id, note_attachment_schedule_payment_id, moneta
)
@classmethod
- def list(cls, schedule_payment_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, schedule_payment_batch_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type schedule_payment_id: int
+ :type schedule_payment_batch_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentSchedulePaymentList
+ :rtype: BunqResponseNoteAttachmentSchedulePaymentBatchList
"""
if params is None:
@@ -27392,25 +27912,25 @@ def list(cls, schedule_payment_id, monetary_account_id=None, params=None, custom
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_id)
+ schedule_payment_batch_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteAttachmentSchedulePaymentList.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentSchedulePaymentBatchList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, schedule_payment_id, note_attachment_schedule_payment_id, monetary_account_id=None,
+ def get(cls, schedule_payment_batch_id, note_attachment_schedule_payment_batch_id, monetary_account_id=None,
custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type schedule_payment_id: int
- :type note_attachment_schedule_payment_id: int
+ :type schedule_payment_batch_id: int
+ :type note_attachment_schedule_payment_batch_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentSchedulePayment
+ :rtype: BunqResponseNoteAttachmentSchedulePaymentBatch
"""
if custom_headers is None:
@@ -27419,10 +27939,11 @@ def get(cls, schedule_payment_id, note_attachment_schedule_payment_id, monetary_
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_id, note_attachment_schedule_payment_id)
+ schedule_payment_batch_id,
+ note_attachment_schedule_payment_batch_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteAttachmentSchedulePayment.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentSchedulePaymentBatch.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -27504,13 +28025,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteAttachmentSchedulePayment
+ :rtype: NoteAttachmentSchedulePaymentBatch
"""
- return converter.json_to_class(NoteAttachmentSchedulePayment, json_str)
+ return converter.json_to_class(NoteAttachmentSchedulePaymentBatch, json_str)
-class NoteTextSchedulePayment(BunqModel):
+class NoteTextSchedulePaymentBatch(BunqModel):
"""
Used to manage text notes.
@@ -27527,11 +28048,11 @@ class NoteTextSchedulePayment(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/schedule-payment/{}/note-text"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/schedule-payment/{}/note-text/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/schedule-payment/{}/note-text/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/schedule-payment/{}/note-text"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/schedule-payment/{}/note-text/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/schedule-payment-batch/{}/note-text"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/schedule-payment-batch/{}/note-text/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/schedule-payment-batch/{}/note-text/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/schedule-payment-batch/{}/note-text"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/schedule-payment-batch/{}/note-text/{}"
# Field constants.
FIELD_CONTENT = "content"
@@ -27555,11 +28076,11 @@ def __init__(self, content=None):
self._content_field_for_request = content
@classmethod
- def create(cls, schedule_payment_id, monetary_account_id=None, content=None, custom_headers=None):
+ def create(cls, schedule_payment_batch_id, monetary_account_id=None, content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type schedule_payment_id: int
+ :type schedule_payment_batch_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -27580,7 +28101,7 @@ def create(cls, schedule_payment_id, monetary_account_id=None, content=None, cus
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_id)
+ schedule_payment_batch_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -27588,13 +28109,13 @@ def create(cls, schedule_payment_id, monetary_account_id=None, content=None, cus
)
@classmethod
- def update(cls, schedule_payment_id, note_text_schedule_payment_id, monetary_account_id=None, content=None,
- custom_headers=None):
+ def update(cls, schedule_payment_batch_id, note_text_schedule_payment_batch_id, monetary_account_id=None,
+ content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type schedule_payment_id: int
- :type note_text_schedule_payment_id: int
+ :type schedule_payment_batch_id: int
+ :type note_text_schedule_payment_batch_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -27616,7 +28137,7 @@ def update(cls, schedule_payment_id, note_text_schedule_payment_id, monetary_acc
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_id, note_text_schedule_payment_id)
+ schedule_payment_batch_id, note_text_schedule_payment_batch_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -27624,12 +28145,13 @@ def update(cls, schedule_payment_id, note_text_schedule_payment_id, monetary_acc
)
@classmethod
- def delete(cls, schedule_payment_id, note_text_schedule_payment_id, monetary_account_id=None, custom_headers=None):
+ def delete(cls, schedule_payment_batch_id, note_text_schedule_payment_batch_id, monetary_account_id=None,
+ custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type schedule_payment_id: int
- :type note_text_schedule_payment_id: int
+ :type schedule_payment_batch_id: int
+ :type note_text_schedule_payment_batch_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -27641,7 +28163,7 @@ def delete(cls, schedule_payment_id, note_text_schedule_payment_id, monetary_acc
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_id, note_text_schedule_payment_id)
+ schedule_payment_batch_id, note_text_schedule_payment_batch_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -27649,17 +28171,17 @@ def delete(cls, schedule_payment_id, note_text_schedule_payment_id, monetary_acc
)
@classmethod
- def list(cls, schedule_payment_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, schedule_payment_batch_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type schedule_payment_id: int
+ :type schedule_payment_batch_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextSchedulePaymentList
+ :rtype: BunqResponseNoteTextSchedulePaymentBatchList
"""
if params is None:
@@ -27671,24 +28193,25 @@ def list(cls, schedule_payment_id, monetary_account_id=None, params=None, custom
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_id)
+ schedule_payment_batch_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteTextSchedulePaymentList.cast_from_bunq_response(
+ return BunqResponseNoteTextSchedulePaymentBatchList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, schedule_payment_id, note_text_schedule_payment_id, monetary_account_id=None, custom_headers=None):
+ def get(cls, schedule_payment_batch_id, note_text_schedule_payment_batch_id, monetary_account_id=None,
+ custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type schedule_payment_id: int
- :type note_text_schedule_payment_id: int
+ :type schedule_payment_batch_id: int
+ :type note_text_schedule_payment_batch_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextSchedulePayment
+ :rtype: BunqResponseNoteTextSchedulePaymentBatch
"""
if custom_headers is None:
@@ -27697,10 +28220,10 @@ def get(cls, schedule_payment_id, note_text_schedule_payment_id, monetary_accoun
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- schedule_payment_id, note_text_schedule_payment_id)
+ schedule_payment_batch_id, note_text_schedule_payment_batch_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteTextSchedulePayment.cast_from_bunq_response(
+ return BunqResponseNoteTextSchedulePaymentBatch.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -27771,13 +28294,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteTextSchedulePayment
+ :rtype: NoteTextSchedulePaymentBatch
"""
- return converter.json_to_class(NoteTextSchedulePayment, json_str)
+ return converter.json_to_class(NoteTextSchedulePaymentBatch, json_str)
-class NoteAttachmentSofortMerchantTransaction(BunqModel):
+class NoteAttachmentSchedulePayment(BunqModel):
"""
Used to manage attachment notes.
@@ -27799,11 +28322,11 @@ class NoteAttachmentSofortMerchantTransaction(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}/note-attachment"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}/note-attachment/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}/note-attachment/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}/note-attachment"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}/note-attachment/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/schedule-payment/{}/note-attachment"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/schedule-payment/{}/note-attachment/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/schedule-payment/{}/note-attachment/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/schedule-payment/{}/note-attachment"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/schedule-payment/{}/note-attachment/{}"
# Field constants.
FIELD_DESCRIPTION = "description"
@@ -27834,12 +28357,12 @@ def __init__(self, attachment_id, description=None):
self._description_field_for_request = description
@classmethod
- def create(cls, sofort_merchant_transaction_id, attachment_id, monetary_account_id=None, description=None,
+ def create(cls, schedule_payment_id, attachment_id, monetary_account_id=None, description=None,
custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type sofort_merchant_transaction_id: int
+ :type schedule_payment_id: int
:param attachment_id: The reference to the uploaded file to attach to
this note.
:type attachment_id: int
@@ -27864,7 +28387,7 @@ def create(cls, sofort_merchant_transaction_id, attachment_id, monetary_account_
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- sofort_merchant_transaction_id)
+ schedule_payment_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -27872,13 +28395,13 @@ def create(cls, sofort_merchant_transaction_id, attachment_id, monetary_account_
)
@classmethod
- def update(cls, sofort_merchant_transaction_id, note_attachment_sofort_merchant_transaction_id,
- monetary_account_id=None, description=None, custom_headers=None):
+ def update(cls, schedule_payment_id, note_attachment_schedule_payment_id, monetary_account_id=None,
+ description=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type sofort_merchant_transaction_id: int
- :type note_attachment_sofort_merchant_transaction_id: int
+ :type schedule_payment_id: int
+ :type note_attachment_schedule_payment_id: int
:param description: Optional description of the attachment.
:type description: str
:type custom_headers: dict[str, str]|None
@@ -27900,8 +28423,7 @@ def update(cls, sofort_merchant_transaction_id, note_attachment_sofort_merchant_
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- sofort_merchant_transaction_id,
- note_attachment_sofort_merchant_transaction_id)
+ schedule_payment_id, note_attachment_schedule_payment_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -27909,13 +28431,13 @@ def update(cls, sofort_merchant_transaction_id, note_attachment_sofort_merchant_
)
@classmethod
- def delete(cls, sofort_merchant_transaction_id, note_attachment_sofort_merchant_transaction_id,
- monetary_account_id=None, custom_headers=None):
+ def delete(cls, schedule_payment_id, note_attachment_schedule_payment_id, monetary_account_id=None,
+ custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type sofort_merchant_transaction_id: int
- :type note_attachment_sofort_merchant_transaction_id: int
+ :type schedule_payment_id: int
+ :type note_attachment_schedule_payment_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -27927,8 +28449,7 @@ def delete(cls, sofort_merchant_transaction_id, note_attachment_sofort_merchant_
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- sofort_merchant_transaction_id,
- note_attachment_sofort_merchant_transaction_id)
+ schedule_payment_id, note_attachment_schedule_payment_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -27936,17 +28457,17 @@ def delete(cls, sofort_merchant_transaction_id, note_attachment_sofort_merchant_
)
@classmethod
- def list(cls, sofort_merchant_transaction_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, schedule_payment_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type sofort_merchant_transaction_id: int
+ :type schedule_payment_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentSofortMerchantTransactionList
+ :rtype: BunqResponseNoteAttachmentSchedulePaymentList
"""
if params is None:
@@ -27958,25 +28479,25 @@ def list(cls, sofort_merchant_transaction_id, monetary_account_id=None, params=N
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- sofort_merchant_transaction_id)
+ schedule_payment_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteAttachmentSofortMerchantTransactionList.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentSchedulePaymentList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, sofort_merchant_transaction_id, note_attachment_sofort_merchant_transaction_id,
- monetary_account_id=None, custom_headers=None):
+ def get(cls, schedule_payment_id, note_attachment_schedule_payment_id, monetary_account_id=None,
+ custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type sofort_merchant_transaction_id: int
- :type note_attachment_sofort_merchant_transaction_id: int
+ :type schedule_payment_id: int
+ :type note_attachment_schedule_payment_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentSofortMerchantTransaction
+ :rtype: BunqResponseNoteAttachmentSchedulePayment
"""
if custom_headers is None:
@@ -27985,11 +28506,10 @@ def get(cls, sofort_merchant_transaction_id, note_attachment_sofort_merchant_tra
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- sofort_merchant_transaction_id,
- note_attachment_sofort_merchant_transaction_id)
+ schedule_payment_id, note_attachment_schedule_payment_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteAttachmentSofortMerchantTransaction.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentSchedulePayment.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -28071,13 +28591,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteAttachmentSofortMerchantTransaction
+ :rtype: NoteAttachmentSchedulePayment
"""
- return converter.json_to_class(NoteAttachmentSofortMerchantTransaction, json_str)
+ return converter.json_to_class(NoteAttachmentSchedulePayment, json_str)
-class NoteTextSofortMerchantTransaction(BunqModel):
+class NoteTextSchedulePayment(BunqModel):
"""
Used to manage text notes.
@@ -28094,11 +28614,11 @@ class NoteTextSofortMerchantTransaction(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}/note-text"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}/note-text/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}/note-text/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}/note-text"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}/note-text/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/schedule-payment/{}/note-text"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/schedule-payment/{}/note-text/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/schedule-payment/{}/note-text/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/schedule-payment/{}/note-text"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/schedule-payment/{}/note-text/{}"
# Field constants.
FIELD_CONTENT = "content"
@@ -28122,11 +28642,11 @@ def __init__(self, content=None):
self._content_field_for_request = content
@classmethod
- def create(cls, sofort_merchant_transaction_id, monetary_account_id=None, content=None, custom_headers=None):
+ def create(cls, schedule_payment_id, monetary_account_id=None, content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type sofort_merchant_transaction_id: int
+ :type schedule_payment_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -28147,7 +28667,7 @@ def create(cls, sofort_merchant_transaction_id, monetary_account_id=None, conten
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- sofort_merchant_transaction_id)
+ schedule_payment_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -28155,13 +28675,13 @@ def create(cls, sofort_merchant_transaction_id, monetary_account_id=None, conten
)
@classmethod
- def update(cls, sofort_merchant_transaction_id, note_text_sofort_merchant_transaction_id, monetary_account_id=None,
- content=None, custom_headers=None):
+ def update(cls, schedule_payment_id, note_text_schedule_payment_id, monetary_account_id=None, content=None,
+ custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type sofort_merchant_transaction_id: int
- :type note_text_sofort_merchant_transaction_id: int
+ :type schedule_payment_id: int
+ :type note_text_schedule_payment_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -28183,8 +28703,7 @@ def update(cls, sofort_merchant_transaction_id, note_text_sofort_merchant_transa
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- sofort_merchant_transaction_id,
- note_text_sofort_merchant_transaction_id)
+ schedule_payment_id, note_text_schedule_payment_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -28192,13 +28711,12 @@ def update(cls, sofort_merchant_transaction_id, note_text_sofort_merchant_transa
)
@classmethod
- def delete(cls, sofort_merchant_transaction_id, note_text_sofort_merchant_transaction_id, monetary_account_id=None,
- custom_headers=None):
+ def delete(cls, schedule_payment_id, note_text_schedule_payment_id, monetary_account_id=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type sofort_merchant_transaction_id: int
- :type note_text_sofort_merchant_transaction_id: int
+ :type schedule_payment_id: int
+ :type note_text_schedule_payment_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -28210,8 +28728,7 @@ def delete(cls, sofort_merchant_transaction_id, note_text_sofort_merchant_transa
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- sofort_merchant_transaction_id,
- note_text_sofort_merchant_transaction_id)
+ schedule_payment_id, note_text_schedule_payment_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -28219,17 +28736,17 @@ def delete(cls, sofort_merchant_transaction_id, note_text_sofort_merchant_transa
)
@classmethod
- def list(cls, sofort_merchant_transaction_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, schedule_payment_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type sofort_merchant_transaction_id: int
+ :type schedule_payment_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextSofortMerchantTransactionList
+ :rtype: BunqResponseNoteTextSchedulePaymentList
"""
if params is None:
@@ -28241,25 +28758,24 @@ def list(cls, sofort_merchant_transaction_id, monetary_account_id=None, params=N
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- sofort_merchant_transaction_id)
+ schedule_payment_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteTextSofortMerchantTransactionList.cast_from_bunq_response(
+ return BunqResponseNoteTextSchedulePaymentList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, sofort_merchant_transaction_id, note_text_sofort_merchant_transaction_id, monetary_account_id=None,
- custom_headers=None):
+ def get(cls, schedule_payment_id, note_text_schedule_payment_id, monetary_account_id=None, custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type sofort_merchant_transaction_id: int
- :type note_text_sofort_merchant_transaction_id: int
+ :type schedule_payment_id: int
+ :type note_text_schedule_payment_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextSofortMerchantTransaction
+ :rtype: BunqResponseNoteTextSchedulePayment
"""
if custom_headers is None:
@@ -28268,11 +28784,10 @@ def get(cls, sofort_merchant_transaction_id, note_text_sofort_merchant_transacti
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- sofort_merchant_transaction_id,
- note_text_sofort_merchant_transaction_id)
+ schedule_payment_id, note_text_schedule_payment_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteTextSofortMerchantTransaction.cast_from_bunq_response(
+ return BunqResponseNoteTextSchedulePayment.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -28343,13 +28858,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteTextSofortMerchantTransaction
+ :rtype: NoteTextSchedulePayment
"""
- return converter.json_to_class(NoteTextSofortMerchantTransaction, json_str)
+ return converter.json_to_class(NoteTextSchedulePayment, json_str)
-class NoteAttachmentWhitelistResult(BunqModel):
+class NoteAttachmentSofortMerchantTransaction(BunqModel):
"""
Used to manage attachment notes.
@@ -28371,11 +28886,11 @@ class NoteAttachmentWhitelistResult(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/whitelist/{}/whitelist-result/{}/note-attachment"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/whitelist/{}/whitelist-result/{}/note-attachment/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/whitelist/{}/whitelist-result/{}/note-attachment/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/whitelist/{}/whitelist-result/{}/note-attachment"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/whitelist/{}/whitelist-result/{}/note-attachment/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}/note-attachment"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}/note-attachment/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}/note-attachment/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}/note-attachment"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}/note-attachment/{}"
# Field constants.
FIELD_DESCRIPTION = "description"
@@ -28406,13 +28921,12 @@ def __init__(self, attachment_id, description=None):
self._description_field_for_request = description
@classmethod
- def create(cls, whitelist_id, whitelist_result_id, attachment_id, monetary_account_id=None, description=None,
+ def create(cls, sofort_merchant_transaction_id, attachment_id, monetary_account_id=None, description=None,
custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type whitelist_id: int
- :type whitelist_result_id: int
+ :type sofort_merchant_transaction_id: int
:param attachment_id: The reference to the uploaded file to attach to
this note.
:type attachment_id: int
@@ -28437,7 +28951,7 @@ def create(cls, whitelist_id, whitelist_result_id, attachment_id, monetary_accou
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- whitelist_id, whitelist_result_id)
+ sofort_merchant_transaction_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -28445,14 +28959,13 @@ def create(cls, whitelist_id, whitelist_result_id, attachment_id, monetary_accou
)
@classmethod
- def update(cls, whitelist_id, whitelist_result_id, note_attachment_whitelist_result_id, monetary_account_id=None,
- description=None, custom_headers=None):
+ def update(cls, sofort_merchant_transaction_id, note_attachment_sofort_merchant_transaction_id,
+ monetary_account_id=None, description=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type whitelist_id: int
- :type whitelist_result_id: int
- :type note_attachment_whitelist_result_id: int
+ :type sofort_merchant_transaction_id: int
+ :type note_attachment_sofort_merchant_transaction_id: int
:param description: Optional description of the attachment.
:type description: str
:type custom_headers: dict[str, str]|None
@@ -28474,8 +28987,8 @@ def update(cls, whitelist_id, whitelist_result_id, note_attachment_whitelist_res
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- whitelist_id, whitelist_result_id,
- note_attachment_whitelist_result_id)
+ sofort_merchant_transaction_id,
+ note_attachment_sofort_merchant_transaction_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -28483,14 +28996,13 @@ def update(cls, whitelist_id, whitelist_result_id, note_attachment_whitelist_res
)
@classmethod
- def delete(cls, whitelist_id, whitelist_result_id, note_attachment_whitelist_result_id, monetary_account_id=None,
- custom_headers=None):
+ def delete(cls, sofort_merchant_transaction_id, note_attachment_sofort_merchant_transaction_id,
+ monetary_account_id=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type whitelist_id: int
- :type whitelist_result_id: int
- :type note_attachment_whitelist_result_id: int
+ :type sofort_merchant_transaction_id: int
+ :type note_attachment_sofort_merchant_transaction_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -28502,8 +29014,8 @@ def delete(cls, whitelist_id, whitelist_result_id, note_attachment_whitelist_res
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- whitelist_id, whitelist_result_id,
- note_attachment_whitelist_result_id)
+ sofort_merchant_transaction_id,
+ note_attachment_sofort_merchant_transaction_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -28511,18 +29023,17 @@ def delete(cls, whitelist_id, whitelist_result_id, note_attachment_whitelist_res
)
@classmethod
- def list(cls, whitelist_id, whitelist_result_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, sofort_merchant_transaction_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type whitelist_id: int
- :type whitelist_result_id: int
+ :type sofort_merchant_transaction_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentWhitelistResultList
+ :rtype: BunqResponseNoteAttachmentSofortMerchantTransactionList
"""
if params is None:
@@ -28534,26 +29045,25 @@ def list(cls, whitelist_id, whitelist_result_id, monetary_account_id=None, param
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- whitelist_id, whitelist_result_id)
+ sofort_merchant_transaction_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteAttachmentWhitelistResultList.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentSofortMerchantTransactionList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, whitelist_id, whitelist_result_id, note_attachment_whitelist_result_id, monetary_account_id=None,
- custom_headers=None):
+ def get(cls, sofort_merchant_transaction_id, note_attachment_sofort_merchant_transaction_id,
+ monetary_account_id=None, custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type whitelist_id: int
- :type whitelist_result_id: int
- :type note_attachment_whitelist_result_id: int
+ :type sofort_merchant_transaction_id: int
+ :type note_attachment_sofort_merchant_transaction_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteAttachmentWhitelistResult
+ :rtype: BunqResponseNoteAttachmentSofortMerchantTransaction
"""
if custom_headers is None:
@@ -28562,11 +29072,11 @@ def get(cls, whitelist_id, whitelist_result_id, note_attachment_whitelist_result
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- whitelist_id, whitelist_result_id,
- note_attachment_whitelist_result_id)
+ sofort_merchant_transaction_id,
+ note_attachment_sofort_merchant_transaction_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteAttachmentWhitelistResult.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentSofortMerchantTransaction.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -28648,13 +29158,13 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteAttachmentWhitelistResult
+ :rtype: NoteAttachmentSofortMerchantTransaction
"""
- return converter.json_to_class(NoteAttachmentWhitelistResult, json_str)
+ return converter.json_to_class(NoteAttachmentSofortMerchantTransaction, json_str)
-class NoteTextWhitelistResult(BunqModel):
+class NoteTextSofortMerchantTransaction(BunqModel):
"""
Used to manage text notes.
@@ -28671,11 +29181,11 @@ class NoteTextWhitelistResult(BunqModel):
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/whitelist/{}/whitelist-result/{}/note-text"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/whitelist/{}/whitelist-result/{}/note-text/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/whitelist/{}/whitelist-result/{}/note-text/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/whitelist/{}/whitelist-result/{}/note-text"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/whitelist/{}/whitelist-result/{}/note-text/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}/note-text"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}/note-text/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}/note-text/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}/note-text"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/sofort-merchant-transaction/{}/note-text/{}"
# Field constants.
FIELD_CONTENT = "content"
@@ -28699,12 +29209,11 @@ def __init__(self, content=None):
self._content_field_for_request = content
@classmethod
- def create(cls, whitelist_id, whitelist_result_id, monetary_account_id=None, content=None, custom_headers=None):
+ def create(cls, sofort_merchant_transaction_id, monetary_account_id=None, content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type whitelist_id: int
- :type whitelist_result_id: int
+ :type sofort_merchant_transaction_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -28725,7 +29234,7 @@ def create(cls, whitelist_id, whitelist_result_id, monetary_account_id=None, con
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- whitelist_id, whitelist_result_id)
+ sofort_merchant_transaction_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -28733,14 +29242,13 @@ def create(cls, whitelist_id, whitelist_result_id, monetary_account_id=None, con
)
@classmethod
- def update(cls, whitelist_id, whitelist_result_id, note_text_whitelist_result_id, monetary_account_id=None,
+ def update(cls, sofort_merchant_transaction_id, note_text_sofort_merchant_transaction_id, monetary_account_id=None,
content=None, custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type whitelist_id: int
- :type whitelist_result_id: int
- :type note_text_whitelist_result_id: int
+ :type sofort_merchant_transaction_id: int
+ :type note_text_sofort_merchant_transaction_id: int
:param content: The content of the note.
:type content: str
:type custom_headers: dict[str, str]|None
@@ -28762,7 +29270,8 @@ def update(cls, whitelist_id, whitelist_result_id, note_text_whitelist_result_id
request_bytes = request_map_string.encode()
endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- whitelist_id, whitelist_result_id, note_text_whitelist_result_id)
+ sofort_merchant_transaction_id,
+ note_text_sofort_merchant_transaction_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -28770,14 +29279,13 @@ def update(cls, whitelist_id, whitelist_result_id, note_text_whitelist_result_id
)
@classmethod
- def delete(cls, whitelist_id, whitelist_result_id, note_text_whitelist_result_id, monetary_account_id=None,
+ def delete(cls, sofort_merchant_transaction_id, note_text_sofort_merchant_transaction_id, monetary_account_id=None,
custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :type whitelist_id: int
- :type whitelist_result_id: int
- :type note_text_whitelist_result_id: int
+ :type sofort_merchant_transaction_id: int
+ :type note_text_sofort_merchant_transaction_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -28789,7 +29297,8 @@ def delete(cls, whitelist_id, whitelist_result_id, note_text_whitelist_result_id
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- whitelist_id, whitelist_result_id, note_text_whitelist_result_id)
+ sofort_merchant_transaction_id,
+ note_text_sofort_merchant_transaction_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -28797,18 +29306,17 @@ def delete(cls, whitelist_id, whitelist_result_id, note_text_whitelist_result_id
)
@classmethod
- def list(cls, whitelist_id, whitelist_result_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, sofort_merchant_transaction_id, monetary_account_id=None, params=None, custom_headers=None):
"""
Manage the notes for a given user.
:type user_id: int
:type monetary_account_id: int
- :type whitelist_id: int
- :type whitelist_result_id: int
+ :type sofort_merchant_transaction_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextWhitelistResultList
+ :rtype: BunqResponseNoteTextSofortMerchantTransactionList
"""
if params is None:
@@ -28820,26 +29328,25 @@ def list(cls, whitelist_id, whitelist_result_id, monetary_account_id=None, param
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- whitelist_id, whitelist_result_id)
+ sofort_merchant_transaction_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNoteTextWhitelistResultList.cast_from_bunq_response(
+ return BunqResponseNoteTextSofortMerchantTransactionList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def get(cls, whitelist_id, whitelist_result_id, note_text_whitelist_result_id, monetary_account_id=None,
+ def get(cls, sofort_merchant_transaction_id, note_text_sofort_merchant_transaction_id, monetary_account_id=None,
custom_headers=None):
"""
:type api_context: ApiContext
:type user_id: int
:type monetary_account_id: int
- :type whitelist_id: int
- :type whitelist_result_id: int
- :type note_text_whitelist_result_id: int
+ :type sofort_merchant_transaction_id: int
+ :type note_text_sofort_merchant_transaction_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNoteTextWhitelistResult
+ :rtype: BunqResponseNoteTextSofortMerchantTransaction
"""
if custom_headers is None:
@@ -28848,10 +29355,11 @@ def get(cls, whitelist_id, whitelist_result_id, note_text_whitelist_result_id, m
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- whitelist_id, whitelist_result_id, note_text_whitelist_result_id)
+ sofort_merchant_transaction_id,
+ note_text_sofort_merchant_transaction_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseNoteTextWhitelistResult.cast_from_bunq_response(
+ return BunqResponseNoteTextSofortMerchantTransaction.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -28922,199 +29430,186 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NoteTextWhitelistResult
+ :rtype: NoteTextSofortMerchantTransaction
"""
- return converter.json_to_class(NoteTextWhitelistResult, json_str)
+ return converter.json_to_class(NoteTextSofortMerchantTransaction, json_str)
-class NotificationFilterPushUser(BunqModel):
+class NoteAttachmentWhitelistResult(BunqModel):
"""
- Manage the push notification filters for a user.
+ Used to manage attachment notes.
- :param _notification_filters: The types of notifications that will result in
- a push notification for this user.
- :type _notification_filters: list[object_.NotificationFilterPush]
+ :param _description: Optional description of the attachment.
+ :type _description: str
+ :param _attachment_id: The reference to the uploaded file to attach to this
+ note.
+ :type _attachment_id: int
+ :param _id_: The id of the note.
+ :type _id_: int
+ :param _created: The timestamp of the note's creation.
+ :type _created: str
+ :param _updated: The timestamp of the note's last update.
+ :type _updated: str
+ :param _label_user_creator: The label of the user who created this note.
+ :type _label_user_creator: object_.LabelUser
+ :param _attachment: The attachment attached to the note.
+ :type _attachment: list[object_.AttachmentMonetaryAccountPayment]
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/notification-filter-push"
- _ENDPOINT_URL_LISTING = "user/{}/notification-filter-push"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/whitelist/{}/whitelist-result/{}/note-attachment"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/whitelist/{}/whitelist-result/{}/note-attachment/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/whitelist/{}/whitelist-result/{}/note-attachment/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/whitelist/{}/whitelist-result/{}/note-attachment"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/whitelist/{}/whitelist-result/{}/note-attachment/{}"
# Field constants.
- FIELD_NOTIFICATION_FILTERS = "notification_filters"
+ FIELD_DESCRIPTION = "description"
+ FIELD_ATTACHMENT_ID = "attachment_id"
# Object type.
- _OBJECT_TYPE_POST = "NotificationFilterPush"
- _OBJECT_TYPE_GET = "NotificationFilterPush"
+ _OBJECT_TYPE_GET = "NoteAttachment"
- _notification_filters = None
- _notification_filters_field_for_request = None
+ _id_ = None
+ _created = None
+ _updated = None
+ _label_user_creator = None
+ _description = None
+ _attachment = None
+ _description_field_for_request = None
+ _attachment_id_field_for_request = None
- def __init__(self, notification_filters=None):
+ def __init__(self, attachment_id, description=None):
"""
- :param notification_filters: The types of notifications that will result in
- a push notification for this user.
- :type notification_filters: list[object_.NotificationFilterPush]
+ :param attachment_id: The reference to the uploaded file to attach to this
+ note.
+ :type attachment_id: int
+ :param description: Optional description of the attachment.
+ :type description: str
"""
- self._notification_filters_field_for_request = notification_filters
+ self._attachment_id_field_for_request = attachment_id
+ self._description_field_for_request = description
@classmethod
- def create(cls, notification_filters=None, custom_headers=None):
+ def create(cls, whitelist_id, whitelist_result_id, attachment_id, monetary_account_id=None, description=None,
+ custom_headers=None):
"""
:type user_id: int
- :param notification_filters: The types of notifications that will result
- in a push notification for this user.
- :type notification_filters: list[object_.NotificationFilterPush]
+ :type monetary_account_id: int
+ :type whitelist_id: int
+ :type whitelist_result_id: int
+ :param attachment_id: The reference to the uploaded file to attach to
+ this note.
+ :type attachment_id: int
+ :param description: Optional description of the attachment.
+ :type description: str
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNotificationFilterPushUser
+ :rtype: BunqResponseInt
"""
if custom_headers is None:
custom_headers = {}
request_map = {
- cls.FIELD_NOTIFICATION_FILTERS: notification_filters
+ cls.FIELD_DESCRIPTION: description,
+ cls.FIELD_ATTACHMENT_ID: attachment_id
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
api_client = ApiClient(cls._get_api_context())
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ whitelist_id, whitelist_result_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
- return BunqResponseNotificationFilterPushUser.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_POST)
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
)
@classmethod
- def list(cls, params=None, custom_headers=None):
+ def update(cls, whitelist_id, whitelist_result_id, note_attachment_whitelist_result_id, monetary_account_id=None,
+ description=None, custom_headers=None):
"""
:type user_id: int
- :type params: dict[str, str]|None
+ :type monetary_account_id: int
+ :type whitelist_id: int
+ :type whitelist_result_id: int
+ :type note_attachment_whitelist_result_id: int
+ :param description: Optional description of the attachment.
+ :type description: str
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNotificationFilterPushUserList
+ :rtype: BunqResponseInt
"""
- if params is None:
- params = {}
-
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
- response_raw = api_client.get(endpoint_url, params, custom_headers)
-
- return BunqResponseNotificationFilterPushUserList.cast_from_bunq_response(
- cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
- )
-
- @property
- def notification_filters(self):
- """
- :rtype: list[object_.NotificationFilterPush]
- """
-
- return self._notification_filters
-
- def is_all_field_none(self):
- """
- :rtype: bool
- """
-
- if self._notification_filters is not None:
- return False
-
- return True
-
- @staticmethod
- def from_json(json_str):
- """
- :type json_str: str
-
- :rtype: NotificationFilterPushUser
- """
-
- return converter.json_to_class(NotificationFilterPushUser, json_str)
-
-
-class NotificationFilterUrlMonetaryAccount(BunqModel):
- """
- Manage the url notification filters for a user.
-
- :param _notification_filters: The types of notifications that will result in
- a url notification for this monetary account.
- :type _notification_filters: list[object_.NotificationFilterUrl]
- """
-
- # Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/notification-filter-url"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/notification-filter-url"
-
- # Field constants.
- FIELD_NOTIFICATION_FILTERS = "notification_filters"
-
- # Object type.
- _OBJECT_TYPE_GET = "NotificationFilterUrl"
- _notification_filters = None
- _notification_filters_field_for_request = None
+ request_map = {
+ cls.FIELD_DESCRIPTION: description
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
- def __init__(self, notification_filters=None):
- """
- :param notification_filters: The types of notifications that will result in
- a url notification for this monetary account.
- :type notification_filters: list[object_.NotificationFilterUrl]
- """
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ whitelist_id, whitelist_result_id,
+ note_attachment_whitelist_result_id)
+ response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
- self._notification_filters_field_for_request = notification_filters
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
@classmethod
- def create(cls, monetary_account_id=None, notification_filters=None, custom_headers=None):
+ def delete(cls, whitelist_id, whitelist_result_id, note_attachment_whitelist_result_id, monetary_account_id=None,
+ custom_headers=None):
"""
:type user_id: int
:type monetary_account_id: int
- :param notification_filters: The types of notifications that will result
- in a url notification for this monetary account.
- :type notification_filters: list[object_.NotificationFilterUrl]
+ :type whitelist_id: int
+ :type whitelist_result_id: int
+ :type note_attachment_whitelist_result_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseInt
+ :rtype: BunqResponseNone
"""
if custom_headers is None:
custom_headers = {}
- request_map = {
- cls.FIELD_NOTIFICATION_FILTERS: notification_filters
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
-
api_client = ApiClient(cls._get_api_context())
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
- response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ whitelist_id, whitelist_result_id,
+ note_attachment_whitelist_result_id)
+ response_raw = api_client.delete(endpoint_url, custom_headers)
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
+ return BunqResponseNone.cast_from_bunq_response(
+ BunqResponse(None, response_raw.headers)
)
@classmethod
- def list(cls, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, whitelist_id, whitelist_result_id, monetary_account_id=None, params=None, custom_headers=None):
"""
+ Manage the notes for a given user.
+
:type user_id: int
:type monetary_account_id: int
+ :type whitelist_id: int
+ :type whitelist_result_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNotificationFilterUrlMonetaryAccountList
+ :rtype: BunqResponseNoteAttachmentWhitelistResultList
"""
if params is None:
@@ -29125,80 +29620,180 @@ def list(cls, monetary_account_id=None, params=None, custom_headers=None):
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
+ cls._determine_monetary_account_id(monetary_account_id),
+ whitelist_id, whitelist_result_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNotificationFilterUrlMonetaryAccountList.cast_from_bunq_response(
+ return BunqResponseNoteAttachmentWhitelistResultList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
- @property
- def notification_filters(self):
+ @classmethod
+ def get(cls, whitelist_id, whitelist_result_id, note_attachment_whitelist_result_id, monetary_account_id=None,
+ custom_headers=None):
"""
- :rtype: list[object_.NotificationFilterUrl]
+ :type api_context: ApiContext
+ :type user_id: int
+ :type monetary_account_id: int
+ :type whitelist_id: int
+ :type whitelist_result_id: int
+ :type note_attachment_whitelist_result_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseNoteAttachmentWhitelistResult
"""
- return self._notification_filters
+ if custom_headers is None:
+ custom_headers = {}
- def is_all_field_none(self):
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ whitelist_id, whitelist_result_id,
+ note_attachment_whitelist_result_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponseNoteAttachmentWhitelistResult.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @property
+ def id_(self):
"""
- :rtype: bool
+ :rtype: int
"""
- if self._notification_filters is not None:
- return False
-
- return True
+ return self._id_
- @staticmethod
- def from_json(json_str):
+ @property
+ def created(self):
"""
- :type json_str: str
-
- :rtype: NotificationFilterUrlMonetaryAccount
+ :rtype: str
"""
- return converter.json_to_class(NotificationFilterUrlMonetaryAccount, json_str)
+ return self._created
+ @property
+ def updated(self):
+ """
+ :rtype: str
+ """
-class NotificationFilterUrlUser(BunqModel):
- """
- Manage the url notification filters for a user.
-
- :param _notification_filters: The types of notifications that will result in
- a url notification for this user.
- :type _notification_filters: list[object_.NotificationFilterUrl]
- """
+ return self._updated
- # Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/notification-filter-url"
- _ENDPOINT_URL_LISTING = "user/{}/notification-filter-url"
+ @property
+ def label_user_creator(self):
+ """
+ :rtype: object_.LabelUser
+ """
- # Field constants.
- FIELD_NOTIFICATION_FILTERS = "notification_filters"
+ return self._label_user_creator
- # Object type.
- _OBJECT_TYPE_GET = "NotificationFilterUrl"
+ @property
+ def description(self):
+ """
+ :rtype: str
+ """
- _notification_filters = None
- _notification_filters_field_for_request = None
+ return self._description
- def __init__(self, notification_filters=None):
+ @property
+ def attachment(self):
"""
- :param notification_filters: The types of notifications that will result in
- a url notification for this user.
- :type notification_filters: list[object_.NotificationFilterUrl]
+ :rtype: list[object_.AttachmentMonetaryAccountPayment]
"""
- self._notification_filters_field_for_request = notification_filters
+ return self._attachment
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._id_ is not None:
+ return False
+
+ if self._created is not None:
+ return False
+
+ if self._updated is not None:
+ return False
+
+ if self._label_user_creator is not None:
+ return False
+
+ if self._description is not None:
+ return False
+
+ if self._attachment is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: NoteAttachmentWhitelistResult
+ """
+
+ return converter.json_to_class(NoteAttachmentWhitelistResult, json_str)
+
+
+class NoteTextWhitelistResult(BunqModel):
+ """
+ Used to manage text notes.
+
+ :param _content: The content of the note.
+ :type _content: str
+ :param _id_: The id of the note.
+ :type _id_: int
+ :param _created: The timestamp of the note's creation.
+ :type _created: str
+ :param _updated: The timestamp of the note's last update.
+ :type _updated: str
+ :param _label_user_creator: The label of the user who created this note.
+ :type _label_user_creator: object_.LabelUser
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/whitelist/{}/whitelist-result/{}/note-text"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/whitelist/{}/whitelist-result/{}/note-text/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/whitelist/{}/whitelist-result/{}/note-text/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/whitelist/{}/whitelist-result/{}/note-text"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/whitelist/{}/whitelist-result/{}/note-text/{}"
+
+ # Field constants.
+ FIELD_CONTENT = "content"
+
+ # Object type.
+ _OBJECT_TYPE_GET = "NoteText"
+
+ _id_ = None
+ _created = None
+ _updated = None
+ _label_user_creator = None
+ _content = None
+ _content_field_for_request = None
+
+ def __init__(self, content=None):
+ """
+ :param content: The content of the note.
+ :type content: str
+ """
+
+ self._content_field_for_request = content
@classmethod
- def create(cls, notification_filters=None, custom_headers=None):
+ def create(cls, whitelist_id, whitelist_result_id, monetary_account_id=None, content=None, custom_headers=None):
"""
:type user_id: int
- :param notification_filters: The types of notifications that will result
- in a url notification for this user.
- :type notification_filters: list[object_.NotificationFilterUrl]
+ :type monetary_account_id: int
+ :type whitelist_id: int
+ :type whitelist_result_id: int
+ :param content: The content of the note.
+ :type content: str
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -29208,14 +29803,16 @@ def create(cls, notification_filters=None, custom_headers=None):
custom_headers = {}
request_map = {
- cls.FIELD_NOTIFICATION_FILTERS: notification_filters
+ cls.FIELD_CONTENT: content
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
api_client = ApiClient(cls._get_api_context())
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ whitelist_id, whitelist_result_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -29223,13 +29820,82 @@ def create(cls, notification_filters=None, custom_headers=None):
)
@classmethod
- def list(cls, params=None, custom_headers=None):
+ def update(cls, whitelist_id, whitelist_result_id, note_text_whitelist_result_id, monetary_account_id=None,
+ content=None, custom_headers=None):
+ """
+ :type user_id: int
+ :type monetary_account_id: int
+ :type whitelist_id: int
+ :type whitelist_result_id: int
+ :type note_text_whitelist_result_id: int
+ :param content: The content of the note.
+ :type content: str
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+
+ request_map = {
+ cls.FIELD_CONTENT: content
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ whitelist_id, whitelist_result_id, note_text_whitelist_result_id)
+ response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
+
+ @classmethod
+ def delete(cls, whitelist_id, whitelist_result_id, note_text_whitelist_result_id, monetary_account_id=None,
+ custom_headers=None):
+ """
+ :type user_id: int
+ :type monetary_account_id: int
+ :type whitelist_id: int
+ :type whitelist_result_id: int
+ :type note_text_whitelist_result_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseNone
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ whitelist_id, whitelist_result_id, note_text_whitelist_result_id)
+ response_raw = api_client.delete(endpoint_url, custom_headers)
+
+ return BunqResponseNone.cast_from_bunq_response(
+ BunqResponse(None, response_raw.headers)
+ )
+
+ @classmethod
+ def list(cls, whitelist_id, whitelist_result_id, monetary_account_id=None, params=None, custom_headers=None):
"""
+ Manage the notes for a given user.
+
:type user_id: int
+ :type monetary_account_id: int
+ :type whitelist_id: int
+ :type whitelist_result_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNotificationFilterUrlUserList
+ :rtype: BunqResponseNoteTextWhitelistResultList
"""
if params is None:
@@ -29239,52 +29905,103 @@ def list(cls, params=None, custom_headers=None):
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ whitelist_id, whitelist_result_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNotificationFilterUrlUserList.cast_from_bunq_response(
+ return BunqResponseNoteTextWhitelistResultList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
+ @classmethod
+ def get(cls, whitelist_id, whitelist_result_id, note_text_whitelist_result_id, monetary_account_id=None,
+ custom_headers=None):
+ """
+ :type api_context: ApiContext
+ :type user_id: int
+ :type monetary_account_id: int
+ :type whitelist_id: int
+ :type whitelist_result_id: int
+ :type note_text_whitelist_result_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseNoteTextWhitelistResult
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ whitelist_id, whitelist_result_id, note_text_whitelist_result_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponseNoteTextWhitelistResult.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
@property
- def notification_filters(self):
+ def id_(self):
"""
- :rtype: list[object_.NotificationFilterUrl]
+ :rtype: int
"""
- return self._notification_filters
+ return self._id_
- def is_all_field_none(self):
+ @property
+ def created(self):
"""
- :rtype: bool
+ :rtype: str
"""
- if self._notification_filters is not None:
- return False
+ return self._created
- return True
+ @property
+ def updated(self):
+ """
+ :rtype: str
+ """
- @staticmethod
- def from_json(json_str):
+ return self._updated
+
+ @property
+ def label_user_creator(self):
"""
- :type json_str: str
-
- :rtype: NotificationFilterUrlUser
+ :rtype: object_.LabelUser
"""
- return converter.json_to_class(NotificationFilterUrlUser, json_str)
+ return self._label_user_creator
+ @property
+ def content(self):
+ """
+ :rtype: str
+ """
-class ChatMessage(BunqModel):
- """
- Endpoint for retrieving the messages that are part of a conversation.
- """
+ return self._content
def is_all_field_none(self):
"""
:rtype: bool
"""
+ if self._id_ is not None:
+ return False
+
+ if self._created is not None:
+ return False
+
+ if self._updated is not None:
+ return False
+
+ if self._label_user_creator is not None:
+ return False
+
+ if self._content is not None:
+ return False
+
return True
@staticmethod
@@ -29292,77 +30009,82 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: ChatMessage
+ :rtype: NoteTextWhitelistResult
"""
- return converter.json_to_class(ChatMessage, json_str)
+ return converter.json_to_class(NoteTextWhitelistResult, json_str)
-class User(BunqModel, AnchorObjectInterface):
+class NotificationFilterPushUser(BunqModel):
"""
- Using this call you can retrieve information of the user you are logged in
- as. This includes your user id, which is referred to in endpoints.
+ Manage the push notification filters for a user.
- :param _UserLight:
- :type _UserLight: UserLight
- :param _UserPerson:
- :type _UserPerson: UserPerson
- :param _UserCompany:
- :type _UserCompany: UserCompany
- :param _UserApiKey:
- :type _UserApiKey: UserApiKey
- :param _UserPaymentServiceProvider:
- :type _UserPaymentServiceProvider: UserPaymentServiceProvider
+ :param _notification_filters: The types of notifications that will result in
+ a push notification for this user.
+ :type _notification_filters: list[object_.NotificationFilterPush]
"""
- # Error constants.
- _ERROR_NULL_FIELDS = "All fields of an extended model or object are null."
-
# Endpoint constants.
- _ENDPOINT_URL_READ = "user/{}"
- _ENDPOINT_URL_LISTING = "user"
+ _ENDPOINT_URL_CREATE = "user/{}/notification-filter-push"
+ _ENDPOINT_URL_LISTING = "user/{}/notification-filter-push"
+
+ # Field constants.
+ FIELD_NOTIFICATION_FILTERS = "notification_filters"
# Object type.
- _OBJECT_TYPE_GET = "User"
+ _OBJECT_TYPE_POST = "NotificationFilterPush"
+ _OBJECT_TYPE_GET = "NotificationFilterPush"
- _UserLight = None
- _UserPerson = None
- _UserCompany = None
- _UserApiKey = None
- _UserPaymentServiceProvider = None
+ _notification_filters = None
+ _notification_filters_field_for_request = None
+
+ def __init__(self, notification_filters=None):
+ """
+ :param notification_filters: The types of notifications that will result in
+ a push notification for this user.
+ :type notification_filters: list[object_.NotificationFilterPush]
+ """
+
+ self._notification_filters_field_for_request = notification_filters
@classmethod
- def get(cls, custom_headers=None):
+ def create(cls, notification_filters=None, custom_headers=None):
"""
- Get a specific user.
-
- :type api_context: ApiContext
:type user_id: int
+ :param notification_filters: The types of notifications that will result
+ in a push notification for this user.
+ :type notification_filters: list[object_.NotificationFilterPush]
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseUser
+ :rtype: BunqResponseNotificationFilterPushUser
"""
if custom_headers is None:
custom_headers = {}
+ request_map = {
+ cls.FIELD_NOTIFICATION_FILTERS: notification_filters
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id())
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
- return BunqResponseUser.cast_from_bunq_response(
- cls._from_json(response_raw)
+ return BunqResponseNotificationFilterPushUser.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_POST)
)
@classmethod
def list(cls, params=None, custom_headers=None):
"""
- Get a collection of all available users.
-
+ :type user_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseUserList
+ :rtype: BunqResponseNotificationFilterPushUserList
"""
if params is None:
@@ -29372,94 +30094,145 @@ def list(cls, params=None, custom_headers=None):
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseUserList.cast_from_bunq_response(
- cls._from_json_list(response_raw)
+ return BunqResponseNotificationFilterPushUserList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@property
- def UserLight(self):
+ def notification_filters(self):
"""
- :rtype: UserLight
+ :rtype: list[object_.NotificationFilterPush]
"""
- return self._UserLight
+ return self._notification_filters
- @property
- def UserPerson(self):
+ def is_all_field_none(self):
"""
- :rtype: UserPerson
+ :rtype: bool
"""
- return self._UserPerson
+ if self._notification_filters is not None:
+ return False
- @property
- def UserCompany(self):
+ return True
+
+ @staticmethod
+ def from_json(json_str):
"""
- :rtype: UserCompany
+ :type json_str: str
+
+ :rtype: NotificationFilterPushUser
"""
- return self._UserCompany
+ return converter.json_to_class(NotificationFilterPushUser, json_str)
- @property
- def UserApiKey(self):
+
+class NotificationFilterUrlMonetaryAccount(BunqModel):
+ """
+ Manage the url notification filters for a user.
+
+ :param _notification_filters: The types of notifications that will result in
+ a url notification for this monetary account.
+ :type _notification_filters: list[object_.NotificationFilterUrl]
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/notification-filter-url"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/notification-filter-url"
+
+ # Field constants.
+ FIELD_NOTIFICATION_FILTERS = "notification_filters"
+
+ # Object type.
+ _OBJECT_TYPE_GET = "NotificationFilterUrl"
+
+ _notification_filters = None
+ _notification_filters_field_for_request = None
+
+ def __init__(self, notification_filters=None):
"""
- :rtype: UserApiKey
+ :param notification_filters: The types of notifications that will result in
+ a url notification for this monetary account.
+ :type notification_filters: list[object_.NotificationFilterUrl]
"""
- return self._UserApiKey
+ self._notification_filters_field_for_request = notification_filters
- @property
- def UserPaymentServiceProvider(self):
+ @classmethod
+ def create(cls, monetary_account_id=None, notification_filters=None, custom_headers=None):
"""
- :rtype: UserPaymentServiceProvider
+ :type user_id: int
+ :type monetary_account_id: int
+ :param notification_filters: The types of notifications that will result
+ in a url notification for this monetary account.
+ :type notification_filters: list[object_.NotificationFilterUrl]
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
"""
- return self._UserPaymentServiceProvider
+ if custom_headers is None:
+ custom_headers = {}
- def get_referenced_object(self):
+ request_map = {
+ cls.FIELD_NOTIFICATION_FILTERS: notification_filters
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ api_client = ApiClient(cls._get_api_context())
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id))
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
+
+ @classmethod
+ def list(cls, monetary_account_id=None, params=None, custom_headers=None):
"""
- :rtype: BunqModel
- :raise: BunqException
+ :type user_id: int
+ :type monetary_account_id: int
+ :type params: dict[str, str]|None
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseNotificationFilterUrlMonetaryAccountList
"""
- if self._UserLight is not None:
- return self._UserLight
+ if params is None:
+ params = {}
- if self._UserPerson is not None:
- return self._UserPerson
+ if custom_headers is None:
+ custom_headers = {}
- if self._UserCompany is not None:
- return self._UserCompany
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id))
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
- if self._UserApiKey is not None:
- return self._UserApiKey
+ return BunqResponseNotificationFilterUrlMonetaryAccountList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ )
- if self._UserPaymentServiceProvider is not None:
- return self._UserPaymentServiceProvider
+ @property
+ def notification_filters(self):
+ """
+ :rtype: list[object_.NotificationFilterUrl]
+ """
- raise BunqException(self._ERROR_NULL_FIELDS)
+ return self._notification_filters
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._UserLight is not None:
- return False
-
- if self._UserPerson is not None:
- return False
-
- if self._UserCompany is not None:
- return False
-
- if self._UserApiKey is not None:
- return False
-
- if self._UserPaymentServiceProvider is not None:
+ if self._notification_filters is not None:
return False
return True
@@ -29469,29 +30242,343 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: User
+ :rtype: NotificationFilterUrlMonetaryAccount
"""
- return converter.json_to_class(User, json_str)
+ return converter.json_to_class(NotificationFilterUrlMonetaryAccount, json_str)
-class UserLight(BunqModel):
+class NotificationFilterUrlUser(BunqModel):
"""
- Show the authenticated user, if it is a light user.
+ Manage the url notification filters for a user.
- :param _first_name: The user's first name.
- :type _first_name: str
- :param _middle_name: The user's middle name.
- :type _middle_name: str
- :param _last_name: The user's last name.
- :type _last_name: str
- :param _public_nick_name: The public nick name for the user.
- :type _public_nick_name: str
- :param _address_main: The user's main address.
- :type _address_main: object_.Address
- :param _address_postal: The user's postal address.
- :type _address_postal: object_.Address
- :param _avatar_uuid: The public UUID of the user's avatar.
+ :param _notification_filters: The types of notifications that will result in
+ a url notification for this user.
+ :type _notification_filters: list[object_.NotificationFilterUrl]
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_CREATE = "user/{}/notification-filter-url"
+ _ENDPOINT_URL_LISTING = "user/{}/notification-filter-url"
+
+ # Field constants.
+ FIELD_NOTIFICATION_FILTERS = "notification_filters"
+
+ # Object type.
+ _OBJECT_TYPE_GET = "NotificationFilterUrl"
+
+ _notification_filters = None
+ _notification_filters_field_for_request = None
+
+ def __init__(self, notification_filters=None):
+ """
+ :param notification_filters: The types of notifications that will result in
+ a url notification for this user.
+ :type notification_filters: list[object_.NotificationFilterUrl]
+ """
+
+ self._notification_filters_field_for_request = notification_filters
+
+ @classmethod
+ def create(cls, notification_filters=None, custom_headers=None):
+ """
+ :type user_id: int
+ :param notification_filters: The types of notifications that will result
+ in a url notification for this user.
+ :type notification_filters: list[object_.NotificationFilterUrl]
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ request_map = {
+ cls.FIELD_NOTIFICATION_FILTERS: notification_filters
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ api_client = ApiClient(cls._get_api_context())
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
+
+ @classmethod
+ def list(cls, params=None, custom_headers=None):
+ """
+ :type user_id: int
+ :type params: dict[str, str]|None
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseNotificationFilterUrlUserList
+ """
+
+ if params is None:
+ params = {}
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
+
+ return BunqResponseNotificationFilterUrlUserList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @property
+ def notification_filters(self):
+ """
+ :rtype: list[object_.NotificationFilterUrl]
+ """
+
+ return self._notification_filters
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._notification_filters is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: NotificationFilterUrlUser
+ """
+
+ return converter.json_to_class(NotificationFilterUrlUser, json_str)
+
+
+class ChatMessage(BunqModel):
+ """
+ Endpoint for retrieving the messages that are part of a conversation.
+ """
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: ChatMessage
+ """
+
+ return converter.json_to_class(ChatMessage, json_str)
+
+
+class User(BunqModel, AnchorObjectInterface):
+ """
+ Using this call you can retrieve information of the user you are logged in
+ as. This includes your user id, which is referred to in endpoints.
+
+ :param _UserLight:
+ :type _UserLight: UserLight
+ :param _UserPerson:
+ :type _UserPerson: UserPerson
+ :param _UserCompany:
+ :type _UserCompany: UserCompany
+ :param _UserApiKey:
+ :type _UserApiKey: UserApiKey
+ :param _UserPaymentServiceProvider:
+ :type _UserPaymentServiceProvider: UserPaymentServiceProvider
+ """
+
+ # Error constants.
+ _ERROR_NULL_FIELDS = "All fields of an extended model or object are null."
+
+ # Endpoint constants.
+ _ENDPOINT_URL_READ = "user/{}"
+ _ENDPOINT_URL_LISTING = "user"
+
+ # Object type.
+ _OBJECT_TYPE_GET = "User"
+
+ _UserLight = None
+ _UserPerson = None
+ _UserCompany = None
+ _UserApiKey = None
+ _UserPaymentServiceProvider = None
+
+ @classmethod
+ def get(cls, custom_headers=None):
+ """
+ Get a specific user.
+
+ :type api_context: ApiContext
+ :type user_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseUser
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id())
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponseUser.cast_from_bunq_response(
+ cls._from_json(response_raw)
+ )
+
+ @classmethod
+ def list(cls, params=None, custom_headers=None):
+ """
+ Get a collection of all available users.
+
+ :type params: dict[str, str]|None
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseUserList
+ """
+
+ if params is None:
+ params = {}
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
+
+ return BunqResponseUserList.cast_from_bunq_response(
+ cls._from_json_list(response_raw)
+ )
+
+ @property
+ def UserLight(self):
+ """
+ :rtype: UserLight
+ """
+
+ return self._UserLight
+
+ @property
+ def UserPerson(self):
+ """
+ :rtype: UserPerson
+ """
+
+ return self._UserPerson
+
+ @property
+ def UserCompany(self):
+ """
+ :rtype: UserCompany
+ """
+
+ return self._UserCompany
+
+ @property
+ def UserApiKey(self):
+ """
+ :rtype: UserApiKey
+ """
+
+ return self._UserApiKey
+
+ @property
+ def UserPaymentServiceProvider(self):
+ """
+ :rtype: UserPaymentServiceProvider
+ """
+
+ return self._UserPaymentServiceProvider
+
+ def get_referenced_object(self):
+ """
+ :rtype: BunqModel
+ :raise: BunqException
+ """
+
+ if self._UserLight is not None:
+ return self._UserLight
+
+ if self._UserPerson is not None:
+ return self._UserPerson
+
+ if self._UserCompany is not None:
+ return self._UserCompany
+
+ if self._UserApiKey is not None:
+ return self._UserApiKey
+
+ if self._UserPaymentServiceProvider is not None:
+ return self._UserPaymentServiceProvider
+
+ raise BunqException(self._ERROR_NULL_FIELDS)
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._UserLight is not None:
+ return False
+
+ if self._UserPerson is not None:
+ return False
+
+ if self._UserCompany is not None:
+ return False
+
+ if self._UserApiKey is not None:
+ return False
+
+ if self._UserPaymentServiceProvider is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: User
+ """
+
+ return converter.json_to_class(User, json_str)
+
+
+class UserLight(BunqModel):
+ """
+ Show the authenticated user, if it is a light user.
+
+ :param _first_name: The user's first name.
+ :type _first_name: str
+ :param _middle_name: The user's middle name.
+ :type _middle_name: str
+ :param _last_name: The user's last name.
+ :type _last_name: str
+ :param _public_nick_name: The public nick name for the user.
+ :type _public_nick_name: str
+ :param _address_main: The user's main address.
+ :type _address_main: object_.Address
+ :param _address_postal: The user's postal address.
+ :type _address_postal: object_.Address
+ :param _avatar_uuid: The public UUID of the user's avatar.
:type _avatar_uuid: str
:param _social_security_number: The user's social security number.
:type _social_security_number: str
@@ -29574,6 +30661,8 @@ class UserLight(BunqModel):
:type _notification_filters: list[object_.NotificationFilter]
:param _deny_reason: The user deny reason.
:type _deny_reason: str
+ :param _relations: The relations for this user.
+ :type _relations: list[RelationUser]
"""
# Field constants.
@@ -29617,9 +30706,6 @@ class UserLight(BunqModel):
_alias = None
_social_security_number = None
_tax_resident = None
- _document_type = None
- _document_number = None
- _document_country_of_issuance = None
_address_main = None
_address_postal = None
_date_of_birth = None
@@ -29637,6 +30723,7 @@ class UserLight(BunqModel):
_daily_limit_without_confirmation_login = None
_notification_filters = None
_deny_reason = None
+ _relations = None
_first_name_field_for_request = None
_middle_name_field_for_request = None
_last_name_field_for_request = None
@@ -29664,50 +30751,28 @@ class UserLight(BunqModel):
_session_timeout_field_for_request = None
_daily_limit_without_confirmation_login_field_for_request = None
- def __init__(self, address_postal=None, gender=None, nationality=None, country_of_birth=None, place_of_birth=None,
- document_back_attachment_id=None, document_front_attachment_id=None, document_country_of_issuance=None,
- document_number=None, document_type=None, tax_resident=None, social_security_number=None,
- middle_name=None, first_name=None, daily_limit_without_confirmation_login=None, session_timeout=None,
- sub_status=None, status=None, region=None, language=None, date_of_birth=None, avatar_uuid=None,
- address_main=None, public_nick_name=None, last_name=None, legal_guardian_alias=None):
+ def __init__(self, document_back_attachment_id=None, session_timeout=None, legal_guardian_alias=None,
+ sub_status=None, status=None, gender=None, region=None, language=None, nationality=None,
+ country_of_birth=None, place_of_birth=None, date_of_birth=None, document_front_attachment_id=None,
+ first_name=None, document_country_of_issuance=None, document_number=None, document_type=None,
+ tax_resident=None, social_security_number=None, avatar_uuid=None, address_postal=None,
+ address_main=None, public_nick_name=None, last_name=None, middle_name=None,
+ daily_limit_without_confirmation_login=None):
"""
:param first_name: The user's first name.
:type first_name: str
+ :param middle_name: The user's middle name.
+ :type middle_name: str
:param last_name: The user's last name.
:type last_name: str
:param public_nick_name: The user's public nick name.
:type public_nick_name: str
:param address_main: The user's main address.
:type address_main: object_.Address
- :param avatar_uuid: The public UUID of the user's avatar.
- :type avatar_uuid: str
- :param date_of_birth: The user's date of birth. Accepts ISO8601 date
- formats.
- :type date_of_birth: str
- :param language: The user's preferred language. Formatted as a ISO 639-1
- language code plus a ISO 3166-1 alpha-2 country code, seperated by an
- underscore.
- :type language: str
- :param region: The user's preferred region. Formatted as a ISO 639-1
- language code plus a ISO 3166-1 alpha-2 country code, seperated by an
- underscore.
- :type region: str
- :param status: The user status. You are not allowed to update the status via
- PUT.
- :type status: str
- :param sub_status: The user sub-status. Can be updated to SUBMIT to apply
- for a full bunq account.
- :type sub_status: str
- :param session_timeout: The setting for the session timeout of the user in
- seconds.
- :type session_timeout: int
- :param daily_limit_without_confirmation_login: The amount the user can pay
- in the session without asking for credentials.
- :type daily_limit_without_confirmation_login: object_.Amount
- :param middle_name: The user's middle name.
- :type middle_name: str
:param address_postal: The user's postal address.
:type address_postal: object_.Address
+ :param avatar_uuid: The public UUID of the user's avatar.
+ :type avatar_uuid: str
:param social_security_number: The user's social security number.
:type social_security_number: str
:param tax_resident: The user's tax residence numbers for different
@@ -29728,6 +30793,9 @@ def __init__(self, address_postal=None, gender=None, nationality=None, country_o
:param document_back_attachment_id: The reference to the uploaded
picture/scan of the back side of the identification document.
:type document_back_attachment_id: int
+ :param date_of_birth: The user's date of birth. Accepts ISO8601 date
+ formats.
+ :type date_of_birth: str
:param place_of_birth: The user's place of birth.
:type place_of_birth: str
:param country_of_birth: The user's country of birth. Formatted as a SO
@@ -29736,27 +30804,40 @@ def __init__(self, address_postal=None, gender=None, nationality=None, country_o
:param nationality: The user's nationality. Formatted as a SO 3166-1 alpha-2
country code.
:type nationality: str
+ :param language: The user's preferred language. Formatted as a ISO 639-1
+ language code plus a ISO 3166-1 alpha-2 country code, seperated by an
+ underscore.
+ :type language: str
+ :param region: The user's preferred region. Formatted as a ISO 639-1
+ language code plus a ISO 3166-1 alpha-2 country code, seperated by an
+ underscore.
+ :type region: str
:param gender: The user's gender. Can be: MALE, FEMALE and UNKNOWN.
:type gender: str
+ :param status: The user status. You are not allowed to update the status via
+ PUT.
+ :type status: str
+ :param sub_status: The user sub-status. Can be updated to SUBMIT to apply
+ for a full bunq account.
+ :type sub_status: str
:param legal_guardian_alias: The legal guardian of the user. Required for
minors.
:type legal_guardian_alias: object_.Pointer
+ :param session_timeout: The setting for the session timeout of the user in
+ seconds.
+ :type session_timeout: int
+ :param daily_limit_without_confirmation_login: The amount the user can pay
+ in the session without asking for credentials.
+ :type daily_limit_without_confirmation_login: object_.Amount
"""
self._first_name_field_for_request = first_name
+ self._middle_name_field_for_request = middle_name
self._last_name_field_for_request = last_name
self._public_nick_name_field_for_request = public_nick_name
self._address_main_field_for_request = address_main
- self._avatar_uuid_field_for_request = avatar_uuid
- self._date_of_birth_field_for_request = date_of_birth
- self._language_field_for_request = language
- self._region_field_for_request = region
- self._status_field_for_request = status
- self._sub_status_field_for_request = sub_status
- self._session_timeout_field_for_request = session_timeout
- self._daily_limit_without_confirmation_login_field_for_request = daily_limit_without_confirmation_login
- self._middle_name_field_for_request = middle_name
self._address_postal_field_for_request = address_postal
+ self._avatar_uuid_field_for_request = avatar_uuid
self._social_security_number_field_for_request = social_security_number
self._tax_resident_field_for_request = tax_resident
self._document_type_field_for_request = document_type
@@ -29764,11 +30845,18 @@ def __init__(self, address_postal=None, gender=None, nationality=None, country_o
self._document_country_of_issuance_field_for_request = document_country_of_issuance
self._document_front_attachment_id_field_for_request = document_front_attachment_id
self._document_back_attachment_id_field_for_request = document_back_attachment_id
+ self._date_of_birth_field_for_request = date_of_birth
self._place_of_birth_field_for_request = place_of_birth
self._country_of_birth_field_for_request = country_of_birth
self._nationality_field_for_request = nationality
+ self._language_field_for_request = language
+ self._region_field_for_request = region
self._gender_field_for_request = gender
+ self._status_field_for_request = status
+ self._sub_status_field_for_request = sub_status
self._legal_guardian_alias_field_for_request = legal_guardian_alias
+ self._session_timeout_field_for_request = session_timeout
+ self._daily_limit_without_confirmation_login_field_for_request = daily_limit_without_confirmation_login
@property
def id_(self):
@@ -29874,30 +30962,6 @@ def tax_resident(self):
return self._tax_resident
- @property
- def document_type(self):
- """
- :rtype: str
- """
-
- return self._document_type
-
- @property
- def document_number(self):
- """
- :rtype: str
- """
-
- return self._document_number
-
- @property
- def document_country_of_issuance(self):
- """
- :rtype: str
- """
-
- return self._document_country_of_issuance
-
@property
def address_main(self):
"""
@@ -30034,6 +31098,14 @@ def deny_reason(self):
return self._deny_reason
+ @property
+ def relations(self):
+ """
+ :rtype: list[RelationUser]
+ """
+
+ return self._relations
+
def is_all_field_none(self):
"""
:rtype: bool
@@ -30078,15 +31150,6 @@ def is_all_field_none(self):
if self._tax_resident is not None:
return False
- if self._document_type is not None:
- return False
-
- if self._document_number is not None:
- return False
-
- if self._document_country_of_issuance is not None:
- return False
-
if self._address_main is not None:
return False
@@ -30138,6 +31201,9 @@ def is_all_field_none(self):
if self._deny_reason is not None:
return False
+ if self._relations is not None:
+ return False
+
return True
@staticmethod
@@ -30249,6 +31315,8 @@ class UserPerson(BunqModel):
:param _notification_filters: The types of notifications that will result in
a push notification or URL callback for this UserPerson.
:type _notification_filters: list[object_.NotificationFilter]
+ :param _relations: The relations for this user.
+ :type _relations: list[RelationUser]
"""
# Endpoint constants.
@@ -30298,9 +31366,6 @@ class UserPerson(BunqModel):
_public_nick_name = None
_alias = None
_tax_resident = None
- _document_type = None
- _document_number = None
- _document_country_of_issuance = None
_address_main = None
_address_postal = None
_date_of_birth = None
@@ -30317,6 +31382,7 @@ class UserPerson(BunqModel):
_session_timeout = None
_daily_limit_without_confirmation_login = None
_notification_filters = None
+ _relations = None
_first_name_field_for_request = None
_middle_name_field_for_request = None
_last_name_field_for_request = None
@@ -30652,207 +31718,1220 @@ def middle_name(self):
:rtype: str
"""
- return self._middle_name
+ return self._middle_name
+
+ @property
+ def last_name(self):
+ """
+ :rtype: str
+ """
+
+ return self._last_name
+
+ @property
+ def legal_name(self):
+ """
+ :rtype: str
+ """
+
+ return self._legal_name
+
+ @property
+ def display_name(self):
+ """
+ :rtype: str
+ """
+
+ return self._display_name
+
+ @property
+ def public_nick_name(self):
+ """
+ :rtype: str
+ """
+
+ return self._public_nick_name
+
+ @property
+ def alias(self):
+ """
+ :rtype: list[object_.Pointer]
+ """
+
+ return self._alias
+
+ @property
+ def tax_resident(self):
+ """
+ :rtype: list[object_.TaxResident]
+ """
+
+ return self._tax_resident
+
+ @property
+ def address_main(self):
+ """
+ :rtype: object_.Address
+ """
+
+ return self._address_main
+
+ @property
+ def address_postal(self):
+ """
+ :rtype: object_.Address
+ """
+
+ return self._address_postal
+
+ @property
+ def date_of_birth(self):
+ """
+ :rtype: str
+ """
+
+ return self._date_of_birth
+
+ @property
+ def place_of_birth(self):
+ """
+ :rtype: str
+ """
+
+ return self._place_of_birth
+
+ @property
+ def country_of_birth(self):
+ """
+ :rtype: str
+ """
+
+ return self._country_of_birth
+
+ @property
+ def nationality(self):
+ """
+ :rtype: str
+ """
+
+ return self._nationality
+
+ @property
+ def language(self):
+ """
+ :rtype: str
+ """
+
+ return self._language
+
+ @property
+ def region(self):
+ """
+ :rtype: str
+ """
+
+ return self._region
+
+ @property
+ def gender(self):
+ """
+ :rtype: str
+ """
+
+ return self._gender
+
+ @property
+ def avatar(self):
+ """
+ :rtype: object_.Avatar
+ """
+
+ return self._avatar
+
+ @property
+ def version_terms_of_service(self):
+ """
+ :rtype: str
+ """
+
+ return self._version_terms_of_service
+
+ @property
+ def status(self):
+ """
+ :rtype: str
+ """
+
+ return self._status
+
+ @property
+ def sub_status(self):
+ """
+ :rtype: str
+ """
+
+ return self._sub_status
+
+ @property
+ def session_timeout(self):
+ """
+ :rtype: int
+ """
+
+ return self._session_timeout
+
+ @property
+ def daily_limit_without_confirmation_login(self):
+ """
+ :rtype: object_.Amount
+ """
+
+ return self._daily_limit_without_confirmation_login
+
+ @property
+ def notification_filters(self):
+ """
+ :rtype: list[object_.NotificationFilter]
+ """
+
+ return self._notification_filters
+
+ @property
+ def relations(self):
+ """
+ :rtype: list[RelationUser]
+ """
+
+ return self._relations
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._id_ is not None:
+ return False
+
+ if self._created is not None:
+ return False
+
+ if self._updated is not None:
+ return False
+
+ if self._public_uuid is not None:
+ return False
+
+ if self._first_name is not None:
+ return False
+
+ if self._middle_name is not None:
+ return False
+
+ if self._last_name is not None:
+ return False
+
+ if self._legal_name is not None:
+ return False
+
+ if self._display_name is not None:
+ return False
+
+ if self._public_nick_name is not None:
+ return False
+
+ if self._alias is not None:
+ return False
+
+ if self._tax_resident is not None:
+ return False
+
+ if self._address_main is not None:
+ return False
+
+ if self._address_postal is not None:
+ return False
+
+ if self._date_of_birth is not None:
+ return False
+
+ if self._place_of_birth is not None:
+ return False
+
+ if self._country_of_birth is not None:
+ return False
+
+ if self._nationality is not None:
+ return False
+
+ if self._language is not None:
+ return False
+
+ if self._region is not None:
+ return False
+
+ if self._gender is not None:
+ return False
+
+ if self._avatar is not None:
+ return False
+
+ if self._version_terms_of_service is not None:
+ return False
+
+ if self._status is not None:
+ return False
+
+ if self._sub_status is not None:
+ return False
+
+ if self._session_timeout is not None:
+ return False
+
+ if self._daily_limit_without_confirmation_login is not None:
+ return False
+
+ if self._notification_filters is not None:
+ return False
+
+ if self._relations is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: UserPerson
+ """
+
+ return converter.json_to_class(UserPerson, json_str)
+
+
+class UserApiKey(BunqModel):
+ """
+ Used to view OAuth request detais in events.
+
+ :param _id_: The id of the user.
+ :type _id_: int
+ :param _created: The timestamp of the user object's creation.
+ :type _created: str
+ :param _updated: The timestamp of the user object's last update.
+ :type _updated: str
+ :param _requested_by_user: The user who requested access.
+ :type _requested_by_user: object_.UserApiKeyAnchoredUser
+ :param _granted_by_user: The user who granted access.
+ :type _granted_by_user: object_.UserApiKeyAnchoredUser
+ """
+
+ _id_ = None
+ _created = None
+ _updated = None
+ _requested_by_user = None
+ _granted_by_user = None
+
+ @property
+ def id_(self):
+ """
+ :rtype: int
+ """
+
+ return self._id_
+
+ @property
+ def created(self):
+ """
+ :rtype: str
+ """
+
+ return self._created
+
+ @property
+ def updated(self):
+ """
+ :rtype: str
+ """
+
+ return self._updated
+
+ @property
+ def requested_by_user(self):
+ """
+ :rtype: object_.UserApiKeyAnchoredUser
+ """
+
+ return self._requested_by_user
+
+ @property
+ def granted_by_user(self):
+ """
+ :rtype: object_.UserApiKeyAnchoredUser
+ """
+
+ return self._granted_by_user
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._id_ is not None:
+ return False
+
+ if self._created is not None:
+ return False
+
+ if self._updated is not None:
+ return False
+
+ if self._requested_by_user is not None:
+ return False
+
+ if self._granted_by_user is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: UserApiKey
+ """
+
+ return converter.json_to_class(UserApiKey, json_str)
+
+
+class UserPaymentServiceProvider(BunqModel):
+ """
+ Used to view UserPaymentServiceProvider for session creation.
+
+ :param _id_: The id of the user.
+ :type _id_: int
+ :param _created: The timestamp of the user object's creation.
+ :type _created: str
+ :param _updated: The timestamp of the user object's last update.
+ :type _updated: str
+ :param _certificate_distinguished_name: The distinguished name from the
+ certificate used to identify this user.
+ :type _certificate_distinguished_name: str
+ :param _alias: The aliases of the user.
+ :type _alias: list[object_.Pointer]
+ :param _avatar: The user's avatar.
+ :type _avatar: object_.Avatar
+ :param _status: The user status. The user status. Can be: ACTIVE, BLOCKED or
+ DENIED.
+ :type _status: str
+ :param _sub_status: The user sub-status. Can be: NONE
+ :type _sub_status: str
+ :param _public_uuid: The providers's public UUID.
+ :type _public_uuid: str
+ :param _display_name: The display name for the provider.
+ :type _display_name: str
+ :param _public_nick_name: The public nick name for the provider.
+ :type _public_nick_name: str
+ :param _language: The provider's language. Formatted as a ISO 639-1 language
+ code plus a ISO 3166-1 alpha-2 country code, separated by an underscore.
+ :type _language: str
+ :param _region: The provider's region. Formatted as a ISO 639-1 language
+ code plus a ISO 3166-1 alpha-2 country code, separated by an underscore.
+ :type _region: str
+ :param _session_timeout: The setting for the session timeout of the user in
+ seconds.
+ :type _session_timeout: int
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_READ = "user-payment-service-provider/{}"
+
+ # Object type.
+ _OBJECT_TYPE_GET = "UserPaymentServiceProvider"
+
+ _id_ = None
+ _created = None
+ _updated = None
+ _certificate_distinguished_name = None
+ _alias = None
+ _avatar = None
+ _status = None
+ _sub_status = None
+ _public_uuid = None
+ _display_name = None
+ _public_nick_name = None
+ _language = None
+ _region = None
+ _session_timeout = None
+
+ @classmethod
+ def get(cls, user_payment_service_provider_id, custom_headers=None):
+ """
+ :type api_context: ApiContext
+ :type user_payment_service_provider_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseUserPaymentServiceProvider
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(user_payment_service_provider_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponseUserPaymentServiceProvider.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @property
+ def id_(self):
+ """
+ :rtype: int
+ """
+
+ return self._id_
+
+ @property
+ def created(self):
+ """
+ :rtype: str
+ """
+
+ return self._created
+
+ @property
+ def updated(self):
+ """
+ :rtype: str
+ """
+
+ return self._updated
+
+ @property
+ def certificate_distinguished_name(self):
+ """
+ :rtype: str
+ """
+
+ return self._certificate_distinguished_name
+
+ @property
+ def alias(self):
+ """
+ :rtype: list[object_.Pointer]
+ """
+
+ return self._alias
+
+ @property
+ def avatar(self):
+ """
+ :rtype: object_.Avatar
+ """
+
+ return self._avatar
+
+ @property
+ def status(self):
+ """
+ :rtype: str
+ """
+
+ return self._status
+
+ @property
+ def sub_status(self):
+ """
+ :rtype: str
+ """
+
+ return self._sub_status
+
+ @property
+ def public_uuid(self):
+ """
+ :rtype: str
+ """
+
+ return self._public_uuid
+
+ @property
+ def display_name(self):
+ """
+ :rtype: str
+ """
+
+ return self._display_name
+
+ @property
+ def public_nick_name(self):
+ """
+ :rtype: str
+ """
+
+ return self._public_nick_name
+
+ @property
+ def language(self):
+ """
+ :rtype: str
+ """
+
+ return self._language
+
+ @property
+ def region(self):
+ """
+ :rtype: str
+ """
+
+ return self._region
+
+ @property
+ def session_timeout(self):
+ """
+ :rtype: int
+ """
+
+ return self._session_timeout
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._id_ is not None:
+ return False
+
+ if self._created is not None:
+ return False
+
+ if self._updated is not None:
+ return False
+
+ if self._certificate_distinguished_name is not None:
+ return False
+
+ if self._alias is not None:
+ return False
+
+ if self._avatar is not None:
+ return False
+
+ if self._status is not None:
+ return False
+
+ if self._sub_status is not None:
+ return False
+
+ if self._public_uuid is not None:
+ return False
+
+ if self._display_name is not None:
+ return False
+
+ if self._public_nick_name is not None:
+ return False
+
+ if self._language is not None:
+ return False
+
+ if self._region is not None:
+ return False
+
+ if self._session_timeout is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: UserPaymentServiceProvider
+ """
+
+ return converter.json_to_class(UserPaymentServiceProvider, json_str)
+
+
+class OauthCallbackUrl(BunqModel):
+ """
+ Used for managing OAuth Client Callback URLs.
+
+ :param _url: The URL for this callback.
+ :type _url: str
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_READ = "user/{}/oauth-client/{}/callback-url/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/oauth-client/{}/callback-url"
+ _ENDPOINT_URL_UPDATE = "user/{}/oauth-client/{}/callback-url/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/oauth-client/{}/callback-url"
+ _ENDPOINT_URL_DELETE = "user/{}/oauth-client/{}/callback-url/{}"
+
+ # Field constants.
+ FIELD_URL = "url"
+
+ # Object type.
+ _OBJECT_TYPE_GET = "OauthCallbackUrl"
+
+ _url = None
+ _url_field_for_request = None
+
+ def __init__(self, url=None):
+ """
+ :param url: The URL for this callback.
+ :type url: str
+ """
+
+ self._url_field_for_request = url
+
+ @classmethod
+ def get(cls, oauth_client_id, oauth_callback_url_id, custom_headers=None):
+ """
+ :type api_context: ApiContext
+ :type user_id: int
+ :type oauth_client_id: int
+ :type oauth_callback_url_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseOauthCallbackUrl
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), oauth_client_id, oauth_callback_url_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponseOauthCallbackUrl.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @classmethod
+ def create(cls, oauth_client_id, url, custom_headers=None):
+ """
+ :type user_id: int
+ :type oauth_client_id: int
+ :param url: The URL for this callback.
+ :type url: str
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ request_map = {
+ cls.FIELD_URL: url
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ api_client = ApiClient(cls._get_api_context())
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(), oauth_client_id)
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
+
+ @classmethod
+ def update(cls, oauth_client_id, oauth_callback_url_id, url=None, custom_headers=None):
+ """
+ :type user_id: int
+ :type oauth_client_id: int
+ :type oauth_callback_url_id: int
+ :param url: The URL for this callback.
+ :type url: str
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+
+ request_map = {
+ cls.FIELD_URL: url
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(), oauth_client_id, oauth_callback_url_id)
+ response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
+
+ @classmethod
+ def list(cls, oauth_client_id, params=None, custom_headers=None):
+ """
+ :type user_id: int
+ :type oauth_client_id: int
+ :type params: dict[str, str]|None
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseOauthCallbackUrlList
+ """
+
+ if params is None:
+ params = {}
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(), oauth_client_id)
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
+
+ return BunqResponseOauthCallbackUrlList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @classmethod
+ def delete(cls, oauth_client_id, oauth_callback_url_id, custom_headers=None):
+ """
+ :type user_id: int
+ :type oauth_client_id: int
+ :type oauth_callback_url_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseNone
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(), oauth_client_id, oauth_callback_url_id)
+ response_raw = api_client.delete(endpoint_url, custom_headers)
+
+ return BunqResponseNone.cast_from_bunq_response(
+ BunqResponse(None, response_raw.headers)
+ )
+
+ @property
+ def url(self):
+ """
+ :rtype: str
+ """
+
+ return self._url
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._url is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: OauthCallbackUrl
+ """
+
+ return converter.json_to_class(OauthCallbackUrl, json_str)
+
+
+class OauthClient(BunqModel):
+ """
+ Used for managing OAuth Clients.
+
+ :param _status: The status of the pack group, can be ACTIVE, CANCELLED or
+ CANCELLED_PENDING.
+ :type _status: str
+ :param _id_: Id of the client.
+ :type _id_: int
+ :param _client_id: The Client ID associated with this Oauth Client
+ :type _client_id: str
+ :param _secret: Secret associated with this Oauth Client
+ :type _secret: str
+ :param _callback_url: The callback URLs which are bound to this Oauth Client
+ :type _callback_url: list[object_.OauthCallbackUrl]
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_READ = "user/{}/oauth-client/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/oauth-client"
+ _ENDPOINT_URL_UPDATE = "user/{}/oauth-client/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/oauth-client"
+
+ # Field constants.
+ FIELD_STATUS = "status"
+
+ # Object type.
+ _OBJECT_TYPE_GET = "OauthClient"
+
+ _id_ = None
+ _status = None
+ _client_id = None
+ _secret = None
+ _callback_url = None
+ _status_field_for_request = None
+
+ def __init__(self, status=None):
+ """
+ :param status: The status of the Oauth Client, can be ACTIVE or CANCELLED.
+ :type status: str
+ """
+
+ self._status_field_for_request = status
+
+ @classmethod
+ def get(cls, oauth_client_id, custom_headers=None):
+ """
+ :type api_context: ApiContext
+ :type user_id: int
+ :type oauth_client_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseOauthClient
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), oauth_client_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponseOauthClient.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @classmethod
+ def create(cls, status=None, custom_headers=None):
+ """
+ :type user_id: int
+ :param status: The status of the Oauth Client, can be ACTIVE or
+ CANCELLED.
+ :type status: str
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ request_map = {
+ cls.FIELD_STATUS: status
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ api_client = ApiClient(cls._get_api_context())
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
+
+ @classmethod
+ def update(cls, oauth_client_id, status=None, custom_headers=None):
+ """
+ :type user_id: int
+ :type oauth_client_id: int
+ :param status: The status of the Oauth Client, can be ACTIVE or
+ CANCELLED.
+ :type status: str
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+
+ request_map = {
+ cls.FIELD_STATUS: status
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(), oauth_client_id)
+ response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
+
+ @classmethod
+ def list(cls, params=None, custom_headers=None):
+ """
+ :type user_id: int
+ :type params: dict[str, str]|None
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseOauthClientList
+ """
+
+ if params is None:
+ params = {}
- @property
- def last_name(self):
- """
- :rtype: str
- """
+ if custom_headers is None:
+ custom_headers = {}
- return self._last_name
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
+
+ return BunqResponseOauthClientList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ )
@property
- def legal_name(self):
+ def id_(self):
"""
- :rtype: str
+ :rtype: int
"""
- return self._legal_name
+ return self._id_
@property
- def display_name(self):
+ def status(self):
"""
:rtype: str
"""
- return self._display_name
+ return self._status
@property
- def public_nick_name(self):
+ def client_id(self):
"""
:rtype: str
"""
- return self._public_nick_name
+ return self._client_id
@property
- def alias(self):
+ def secret(self):
"""
- :rtype: list[object_.Pointer]
+ :rtype: str
"""
- return self._alias
+ return self._secret
@property
- def tax_resident(self):
+ def callback_url(self):
"""
- :rtype: list[object_.TaxResident]
+ :rtype: list[object_.OauthCallbackUrl]
"""
- return self._tax_resident
+ return self._callback_url
- @property
- def document_type(self):
+ def is_all_field_none(self):
"""
- :rtype: str
+ :rtype: bool
"""
- return self._document_type
-
- @property
- def document_number(self):
- """
- :rtype: str
- """
+ if self._id_ is not None:
+ return False
- return self._document_number
+ if self._status is not None:
+ return False
- @property
- def document_country_of_issuance(self):
- """
- :rtype: str
- """
+ if self._client_id is not None:
+ return False
- return self._document_country_of_issuance
+ if self._secret is not None:
+ return False
- @property
- def address_main(self):
- """
- :rtype: object_.Address
- """
+ if self._callback_url is not None:
+ return False
- return self._address_main
+ return True
- @property
- def address_postal(self):
+ @staticmethod
+ def from_json(json_str):
"""
- :rtype: object_.Address
+ :type json_str: str
+
+ :rtype: OauthClient
"""
- return self._address_postal
+ return converter.json_to_class(OauthClient, json_str)
- @property
- def date_of_birth(self):
- """
- :rtype: str
- """
- return self._date_of_birth
+class PaymentAutoAllocateDefinition(BunqModel):
+ """
+ List all the definitions in a payment auto allocate.
+
+ :param _type_: The type of definition.
+ :type _type_: str
+ :param _counterparty_alias: The alias of the party we are allocating the
+ money to.
+ :type _counterparty_alias: object_.MonetaryAccountReference
+ :param _description: The description for the payment.
+ :type _description: str
+ :param _amount: The amount to allocate.
+ :type _amount: object_.Amount
+ :param _fraction: The percentage of the triggering payment's amount to
+ allocate.
+ :type _fraction: float
+ :param _id_: The id of the PaymentAutoAllocateDefinition.
+ :type _id_: int
+ :param _created: The timestamp when the PaymentAutoAllocateDefinition was
+ created.
+ :type _created: str
+ :param _updated: The timestamp when the PaymentAutoAllocateDefinition was
+ last updated.
+ :type _updated: str
+ """
- @property
- def place_of_birth(self):
- """
- :rtype: str
- """
+ # Endpoint constants.
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/payment-auto-allocate/{}/definition"
- return self._place_of_birth
+ # Field constants.
+ FIELD_TYPE = "type"
+ FIELD_COUNTERPARTY_ALIAS = "counterparty_alias"
+ FIELD_DESCRIPTION = "description"
+ FIELD_AMOUNT = "amount"
+ FIELD_FRACTION = "fraction"
- @property
- def country_of_birth(self):
- """
- :rtype: str
- """
+ # Object type.
+ _OBJECT_TYPE_GET = "PaymentAutoAllocateDefinition"
- return self._country_of_birth
+ _id_ = None
+ _created = None
+ _updated = None
+ _counterparty_alias = None
+ _description = None
+ _amount = None
+ _fraction = None
+ _type__field_for_request = None
+ _counterparty_alias_field_for_request = None
+ _description_field_for_request = None
+ _amount_field_for_request = None
+ _fraction_field_for_request = None
- @property
- def nationality(self):
+ def __init__(self, type_=None, counterparty_alias=None, description=None, amount=None, fraction=None):
"""
- :rtype: str
+ :param type_: The type of definition.
+ :type type_: str
+ :param counterparty_alias: The alias of the party we are allocating the
+ money to.
+ :type counterparty_alias: object_.Pointer
+ :param description: The description for the payment.
+ :type description: str
+ :param amount: The amount to allocate.
+ :type amount: object_.Amount
+ :param fraction: The percentage of the triggering payment's amount to
+ allocate.
+ :type fraction: float
"""
- return self._nationality
+ self._type__field_for_request = type_
+ self._counterparty_alias_field_for_request = counterparty_alias
+ self._description_field_for_request = description
+ self._amount_field_for_request = amount
+ self._fraction_field_for_request = fraction
- @property
- def language(self):
+ @classmethod
+ def list(cls, payment_auto_allocate_id, monetary_account_id=None, params=None, custom_headers=None):
"""
- :rtype: str
+ :type user_id: int
+ :type monetary_account_id: int
+ :type payment_auto_allocate_id: int
+ :type params: dict[str, str]|None
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponsePaymentAutoAllocateDefinitionList
"""
- return self._language
-
- @property
- def region(self):
- """
- :rtype: str
- """
+ if params is None:
+ params = {}
- return self._region
+ if custom_headers is None:
+ custom_headers = {}
- @property
- def gender(self):
- """
- :rtype: str
- """
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ payment_auto_allocate_id)
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
- return self._gender
+ return BunqResponsePaymentAutoAllocateDefinitionList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ )
@property
- def avatar(self):
+ def id_(self):
"""
- :rtype: object_.Avatar
+ :rtype: int
"""
- return self._avatar
+ return self._id_
@property
- def version_terms_of_service(self):
+ def created(self):
"""
:rtype: str
"""
- return self._version_terms_of_service
+ return self._created
@property
- def status(self):
+ def updated(self):
"""
:rtype: str
"""
- return self._status
+ return self._updated
@property
- def sub_status(self):
+ def counterparty_alias(self):
"""
- :rtype: str
+ :rtype: object_.MonetaryAccountReference
"""
- return self._sub_status
+ return self._counterparty_alias
@property
- def session_timeout(self):
+ def description(self):
"""
- :rtype: int
+ :rtype: str
"""
- return self._session_timeout
+ return self._description
@property
- def daily_limit_without_confirmation_login(self):
+ def amount(self):
"""
:rtype: object_.Amount
"""
- return self._daily_limit_without_confirmation_login
+ return self._amount
@property
- def notification_filters(self):
+ def fraction(self):
"""
- :rtype: list[object_.NotificationFilter]
+ :rtype: float
"""
- return self._notification_filters
+ return self._fraction
def is_all_field_none(self):
"""
@@ -30868,88 +32947,16 @@ def is_all_field_none(self):
if self._updated is not None:
return False
- if self._public_uuid is not None:
- return False
-
- if self._first_name is not None:
- return False
-
- if self._middle_name is not None:
- return False
-
- if self._last_name is not None:
- return False
-
- if self._legal_name is not None:
- return False
-
- if self._display_name is not None:
- return False
-
- if self._public_nick_name is not None:
- return False
-
- if self._alias is not None:
- return False
-
- if self._tax_resident is not None:
- return False
-
- if self._document_type is not None:
- return False
-
- if self._document_number is not None:
- return False
-
- if self._document_country_of_issuance is not None:
- return False
-
- if self._address_main is not None:
- return False
-
- if self._address_postal is not None:
- return False
-
- if self._date_of_birth is not None:
- return False
-
- if self._place_of_birth is not None:
- return False
-
- if self._country_of_birth is not None:
- return False
-
- if self._nationality is not None:
- return False
-
- if self._language is not None:
- return False
-
- if self._region is not None:
- return False
-
- if self._gender is not None:
- return False
-
- if self._avatar is not None:
- return False
-
- if self._version_terms_of_service is not None:
- return False
-
- if self._status is not None:
- return False
-
- if self._sub_status is not None:
+ if self._counterparty_alias is not None:
return False
- if self._session_timeout is not None:
+ if self._description is not None:
return False
- if self._daily_limit_without_confirmation_login is not None:
+ if self._amount is not None:
return False
- if self._notification_filters is not None:
+ if self._fraction is not None:
return False
return True
@@ -30959,304 +32966,178 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: UserPerson
+ :rtype: PaymentAutoAllocateDefinition
"""
- return converter.json_to_class(UserPerson, json_str)
+ return converter.json_to_class(PaymentAutoAllocateDefinition, json_str)
-class UserCompany(BunqModel):
+class PaymentAutoAllocate(BunqModel):
"""
- With UserCompany you can retrieve information regarding the authenticated
- UserCompany and update specific fields.
Notification filters can be
- set on a UserCompany level to receive callbacks. For more information check
- the dedicated callbacks page.
+ Manage a users automatic payment auto allocated settings.
- :param _name: The company name.
- :type _name: str
- :param _public_nick_name: The company's public nick name.
- :type _public_nick_name: str
- :param _avatar_uuid: The public UUID of the company's avatar.
- :type _avatar_uuid: str
- :param _address_main: The company's main address.
- :type _address_main: object_.Address
- :param _address_postal: The company's postal address.
- :type _address_postal: object_.Address
- :param _language: The person's preferred language. Formatted as a ISO 639-1
- language code plus a ISO 3166-1 alpha-2 country code, seperated by an
- underscore.
- :type _language: str
- :param _region: The person's preferred region. Formatted as a ISO 639-1
- language code plus a ISO 3166-1 alpha-2 country code, seperated by an
- underscore.
- :type _region: str
- :param _country: The country as an ISO 3166-1 alpha-2 country code..
- :type _country: str
- :param _ubo: The names of the company's ultimate beneficiary owners. Minimum
- zero, maximum four.
- :type _ubo: list[object_.Ubo]
- :param _chamber_of_commerce_number: The company's chamber of commerce
- number.
- :type _chamber_of_commerce_number: str
- :param _legal_form: The company's legal form.
- :type _legal_form: str
- :param _status: The user status. Can be: ACTIVE, SIGNUP, RECOVERY.
- :type _status: str
- :param _sub_status: The user sub-status. Can be: NONE, FACE_RESET, APPROVAL,
- APPROVAL_DIRECTOR, APPROVAL_PARENT, APPROVAL_SUPPORT, COUNTER_IBAN, IDEAL or
- SUBMIT.
- :type _sub_status: str
- :param _session_timeout: The setting for the session timeout of the company
- in seconds.
- :type _session_timeout: int
- :param _daily_limit_without_confirmation_login: The amount the company can
- pay in the session without asking for credentials.
- :type _daily_limit_without_confirmation_login: object_.Amount
- :param _id_: The id of the modified company.
+ :param _payment_id: The payment that should be used to define the triggers
+ for the payment auto allocate.
+ :type _payment_id: int
+ :param _type_: The type.
+ :type _type_: str
+ :param _definition: The definition of how the money should be allocated.
+ :type _definition: list[PaymentAutoAllocateDefinition]
+ :param _id_: The id of the PaymentAutoAllocate.
:type _id_: int
- :param _created: The timestamp of the company object's creation.
+ :param _created: The timestamp when the PaymentAutoAllocate was created.
:type _created: str
- :param _updated: The timestamp of the company object's last update.
+ :param _updated: The timestamp when the PaymentAutoAllocate was last
+ updated.
:type _updated: str
- :param _public_uuid: The company's public UUID.
- :type _public_uuid: str
- :param _display_name: The company's display name.
- :type _display_name: str
- :param _alias: The aliases of the account.
- :type _alias: list[object_.Pointer]
- :param _type_of_business_entity: The type of business entity.
- :type _type_of_business_entity: str
- :param _sector_of_industry: The sector of industry.
- :type _sector_of_industry: str
- :param _counter_bank_iban: The company's other bank account IBAN, through
- which we verify it.
- :type _counter_bank_iban: str
- :param _avatar: The company's avatar.
- :type _avatar: object_.Avatar
- :param _version_terms_of_service: The version of the terms of service
- accepted by the user.
- :type _version_terms_of_service: str
- :param _director_alias: The existing bunq user alias for the company's
- director.
- :type _director_alias: object_.LabelUser
- :param _notification_filters: The types of notifications that will result in
- a push notification or URL callback for this UserCompany.
- :type _notification_filters: list[object_.NotificationFilter]
- :param _customer: The customer profile of the company.
- :type _customer: Customer
- :param _customer_limit: The customer limits of the company.
- :type _customer_limit: CustomerLimit
- :param _billing_contract: The subscription of the company.
- :type _billing_contract: list[BillingContractSubscription]
- :param _deny_reason: The user deny reason.
- :type _deny_reason: str
+ :param _status: The status.
+ :type _status: str
+ :param _trigger_amount: The amount on which this payment auto allocate will
+ be triggered.
+ :type _trigger_amount: object_.Amount
+ :param _payment: The payment that was used to define the triggers for this
+ payment auto allocate.
+ :type _payment: Payment
"""
# Endpoint constants.
- _ENDPOINT_URL_READ = "user-company/{}"
- _ENDPOINT_URL_UPDATE = "user-company/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/payment-auto-allocate"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/payment-auto-allocate/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/payment-auto-allocate"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/payment-auto-allocate/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/payment-auto-allocate/{}"
# Field constants.
- FIELD_NAME = "name"
- FIELD_PUBLIC_NICK_NAME = "public_nick_name"
- FIELD_AVATAR_UUID = "avatar_uuid"
- FIELD_ADDRESS_MAIN = "address_main"
- FIELD_ADDRESS_POSTAL = "address_postal"
- FIELD_LANGUAGE = "language"
- FIELD_REGION = "region"
- FIELD_COUNTRY = "country"
- FIELD_UBO = "ubo"
- FIELD_CHAMBER_OF_COMMERCE_NUMBER = "chamber_of_commerce_number"
- FIELD_LEGAL_FORM = "legal_form"
- FIELD_STATUS = "status"
- FIELD_SUB_STATUS = "sub_status"
- FIELD_SESSION_TIMEOUT = "session_timeout"
- FIELD_DAILY_LIMIT_WITHOUT_CONFIRMATION_LOGIN = "daily_limit_without_confirmation_login"
+ FIELD_PAYMENT_ID = "payment_id"
+ FIELD_TYPE = "type"
+ FIELD_DEFINITION = "definition"
# Object type.
- _OBJECT_TYPE_GET = "UserCompany"
+ _OBJECT_TYPE_GET = "PaymentAutoAllocate"
_id_ = None
_created = None
_updated = None
- _public_uuid = None
- _name = None
- _display_name = None
- _public_nick_name = None
- _alias = None
- _chamber_of_commerce_number = None
- _legal_form = None
- _type_of_business_entity = None
- _sector_of_industry = None
- _counter_bank_iban = None
- _avatar = None
- _address_main = None
- _address_postal = None
- _version_terms_of_service = None
- _director_alias = None
- _language = None
- _country = None
- _region = None
- _ubo = None
+ _type_ = None
_status = None
- _sub_status = None
- _session_timeout = None
- _daily_limit_without_confirmation_login = None
- _notification_filters = None
- _customer = None
- _customer_limit = None
- _billing_contract = None
- _deny_reason = None
- _name_field_for_request = None
- _public_nick_name_field_for_request = None
- _avatar_uuid_field_for_request = None
- _address_main_field_for_request = None
- _address_postal_field_for_request = None
- _language_field_for_request = None
- _region_field_for_request = None
- _country_field_for_request = None
- _ubo_field_for_request = None
- _chamber_of_commerce_number_field_for_request = None
- _legal_form_field_for_request = None
- _status_field_for_request = None
- _sub_status_field_for_request = None
- _session_timeout_field_for_request = None
- _daily_limit_without_confirmation_login_field_for_request = None
+ _trigger_amount = None
+ _payment = None
+ _payment_id_field_for_request = None
+ _type__field_for_request = None
+ _definition_field_for_request = None
+
+ def __init__(self, payment_id, type_, definition=None):
+ """
+ :param payment_id: The payment that should be used to define the triggers
+ for the payment auto allocate.
+ :type payment_id: int
+ :param type_: Whether a payment should be sorted ONCE or RECURRING.
+ :type type_: str
+ :param definition: The definition of how the money should be allocated.
+ :type definition: list[PaymentAutoAllocateDefinition]
+ """
- def __init__(self, address_main=None, language=None, region=None, name=None, public_nick_name=None,
- avatar_uuid=None, address_postal=None, country=None, ubo=None, chamber_of_commerce_number=None,
- legal_form=None, status=None, sub_status=None, session_timeout=None,
- daily_limit_without_confirmation_login=None):
+ self._payment_id_field_for_request = payment_id
+ self._type__field_for_request = type_
+ self._definition_field_for_request = definition
+
+ @classmethod
+ def create(cls, payment_id, type_, definition, monetary_account_id=None, custom_headers=None):
"""
- :param address_main: The user's main address.
- :type address_main: object_.Address
- :param language: The person's preferred language. Formatted as a ISO 639-1
- language code plus a ISO 3166-1 alpha-2 country code, seperated by an
- underscore.
- :type language: str
- :param region: The person's preferred region. Formatted as a ISO 639-1
- language code plus a ISO 3166-1 alpha-2 country code, seperated by an
- underscore.
- :type region: str
- :param name: The company name.
- :type name: str
- :param public_nick_name: The company's nick name.
- :type public_nick_name: str
- :param avatar_uuid: The public UUID of the company's avatar.
- :type avatar_uuid: str
- :param address_postal: The company's postal address.
- :type address_postal: object_.Address
- :param country: The country where the company is registered.
- :type country: str
- :param ubo: The names and birth dates of the company's ultimate beneficiary
- owners. Minimum zero, maximum four.
- :type ubo: list[object_.Ubo]
- :param chamber_of_commerce_number: The company's chamber of commerce number.
- :type chamber_of_commerce_number: str
- :param legal_form: The company's legal form.
- :type legal_form: str
- :param status: The user status. Can be: ACTIVE, SIGNUP, RECOVERY.
- :type status: str
- :param sub_status: The user sub-status. Can be: NONE, FACE_RESET, APPROVAL,
- APPROVAL_DIRECTOR, APPROVAL_PARENT, APPROVAL_SUPPORT, COUNTER_IBAN, IDEAL or
- SUBMIT.
- :type sub_status: str
- :param session_timeout: The setting for the session timeout of the company
- in seconds.
- :type session_timeout: int
- :param daily_limit_without_confirmation_login: The amount the company can
- pay in the session without asking for credentials.
- :type daily_limit_without_confirmation_login: object_.Amount
+ :type user_id: int
+ :type monetary_account_id: int
+ :param payment_id: The payment that should be used to define the
+ triggers for the payment auto allocate.
+ :type payment_id: int
+ :param type_: Whether a payment should be sorted ONCE or RECURRING.
+ :type type_: str
+ :param definition: The definition of how the money should be allocated.
+ :type definition: list[PaymentAutoAllocateDefinition]
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
"""
- self._address_main_field_for_request = address_main
- self._language_field_for_request = language
- self._region_field_for_request = region
- self._name_field_for_request = name
- self._public_nick_name_field_for_request = public_nick_name
- self._avatar_uuid_field_for_request = avatar_uuid
- self._address_postal_field_for_request = address_postal
- self._country_field_for_request = country
- self._ubo_field_for_request = ubo
- self._chamber_of_commerce_number_field_for_request = chamber_of_commerce_number
- self._legal_form_field_for_request = legal_form
- self._status_field_for_request = status
- self._sub_status_field_for_request = sub_status
- self._session_timeout_field_for_request = session_timeout
- self._daily_limit_without_confirmation_login_field_for_request = daily_limit_without_confirmation_login
+ if custom_headers is None:
+ custom_headers = {}
+
+ request_map = {
+ cls.FIELD_PAYMENT_ID: payment_id,
+ cls.FIELD_TYPE: type_,
+ cls.FIELD_DEFINITION: definition
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ api_client = ApiClient(cls._get_api_context())
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id))
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
@classmethod
- def get(cls, custom_headers=None):
+ def get(cls, payment_auto_allocate_id, monetary_account_id=None, custom_headers=None):
"""
- Get a specific company.
-
:type api_context: ApiContext
- :type user_company_id: int
+ :type user_id: int
+ :type monetary_account_id: int
+ :type payment_auto_allocate_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseUserCompany
+ :rtype: BunqResponsePaymentAutoAllocate
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ payment_auto_allocate_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseUserCompany.cast_from_bunq_response(
+ return BunqResponsePaymentAutoAllocate.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def update(cls, name=None, public_nick_name=None, avatar_uuid=None, address_main=None, address_postal=None,
- language=None, region=None, country=None, ubo=None, chamber_of_commerce_number=None, legal_form=None,
- status=None, sub_status=None, session_timeout=None, daily_limit_without_confirmation_login=None,
- custom_headers=None):
+ def list(cls, monetary_account_id=None, params=None, custom_headers=None):
"""
- Modify a specific company's data.
+ :type user_id: int
+ :type monetary_account_id: int
+ :type params: dict[str, str]|None
+ :type custom_headers: dict[str, str]|None
- :type user_company_id: int
- :param name: The company name.
- :type name: str
- :param public_nick_name: The company's nick name.
- :type public_nick_name: str
- :param avatar_uuid: The public UUID of the company's avatar.
- :type avatar_uuid: str
- :param address_main: The user's main address.
- :type address_main: object_.Address
- :param address_postal: The company's postal address.
- :type address_postal: object_.Address
- :param language: The person's preferred language. Formatted as a ISO
- 639-1 language code plus a ISO 3166-1 alpha-2 country code, seperated by
- an underscore.
- :type language: str
- :param region: The person's preferred region. Formatted as a ISO 639-1
- language code plus a ISO 3166-1 alpha-2 country code, seperated by an
- underscore.
- :type region: str
- :param country: The country where the company is registered.
- :type country: str
- :param ubo: The names and birth dates of the company's ultimate
- beneficiary owners. Minimum zero, maximum four.
- :type ubo: list[object_.Ubo]
- :param chamber_of_commerce_number: The company's chamber of commerce
- number.
- :type chamber_of_commerce_number: str
- :param legal_form: The company's legal form.
- :type legal_form: str
- :param status: The user status. Can be: ACTIVE, SIGNUP, RECOVERY.
- :type status: str
- :param sub_status: The user sub-status. Can be: NONE, FACE_RESET,
- APPROVAL, APPROVAL_DIRECTOR, APPROVAL_PARENT, APPROVAL_SUPPORT,
- COUNTER_IBAN, IDEAL or SUBMIT.
- :type sub_status: str
- :param session_timeout: The setting for the session timeout of the
- company in seconds.
- :type session_timeout: int
- :param daily_limit_without_confirmation_login: The amount the company
- can pay in the session without asking for credentials.
- :type daily_limit_without_confirmation_login: object_.Amount
+ :rtype: BunqResponsePaymentAutoAllocateList
+ """
+
+ if params is None:
+ params = {}
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id))
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
+
+ return BunqResponsePaymentAutoAllocateList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @classmethod
+ def update(cls, payment_auto_allocate_id, monetary_account_id=None, definition=None, custom_headers=None):
+ """
+ :type user_id: int
+ :type monetary_account_id: int
+ :type payment_auto_allocate_id: int
+ :param definition: The definition of how the money should be allocated.
+ :type definition: list[PaymentAutoAllocateDefinition]
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -31268,33 +33149,45 @@ def update(cls, name=None, public_nick_name=None, avatar_uuid=None, address_main
api_client = ApiClient(cls._get_api_context())
request_map = {
- cls.FIELD_NAME: name,
- cls.FIELD_PUBLIC_NICK_NAME: public_nick_name,
- cls.FIELD_AVATAR_UUID: avatar_uuid,
- cls.FIELD_ADDRESS_MAIN: address_main,
- cls.FIELD_ADDRESS_POSTAL: address_postal,
- cls.FIELD_LANGUAGE: language,
- cls.FIELD_REGION: region,
- cls.FIELD_COUNTRY: country,
- cls.FIELD_UBO: ubo,
- cls.FIELD_CHAMBER_OF_COMMERCE_NUMBER: chamber_of_commerce_number,
- cls.FIELD_LEGAL_FORM: legal_form,
- cls.FIELD_STATUS: status,
- cls.FIELD_SUB_STATUS: sub_status,
- cls.FIELD_SESSION_TIMEOUT: session_timeout,
- cls.FIELD_DAILY_LIMIT_WITHOUT_CONFIRMATION_LOGIN: daily_limit_without_confirmation_login
+ cls.FIELD_DEFINITION: definition
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id())
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ payment_auto_allocate_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
cls._process_for_id(response_raw)
)
+ @classmethod
+ def delete(cls, payment_auto_allocate_id, monetary_account_id=None, custom_headers=None):
+ """
+ :type user_id: int
+ :type monetary_account_id: int
+ :type payment_auto_allocate_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseNone
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ payment_auto_allocate_id)
+ response_raw = api_client.delete(endpoint_url, custom_headers)
+
+ return BunqResponseNone.cast_from_bunq_response(
+ BunqResponse(None, response_raw.headers)
+ )
+
@property
def id_(self):
"""
@@ -31320,156 +33213,320 @@ def updated(self):
return self._updated
@property
- def public_uuid(self):
+ def type_(self):
"""
:rtype: str
"""
- return self._public_uuid
+ return self._type_
@property
- def name(self):
+ def status(self):
"""
:rtype: str
"""
- return self._name
+ return self._status
@property
- def display_name(self):
+ def trigger_amount(self):
"""
- :rtype: str
+ :rtype: object_.Amount
"""
- return self._display_name
+ return self._trigger_amount
@property
- def public_nick_name(self):
+ def payment(self):
"""
- :rtype: str
+ :rtype: Payment
"""
- return self._public_nick_name
+ return self._payment
- @property
- def alias(self):
+ def is_all_field_none(self):
"""
- :rtype: list[object_.Pointer]
+ :rtype: bool
"""
- return self._alias
+ if self._id_ is not None:
+ return False
- @property
- def chamber_of_commerce_number(self):
- """
- :rtype: str
- """
+ if self._created is not None:
+ return False
- return self._chamber_of_commerce_number
+ if self._updated is not None:
+ return False
- @property
- def legal_form(self):
+ if self._type_ is not None:
+ return False
+
+ if self._status is not None:
+ return False
+
+ if self._trigger_amount is not None:
+ return False
+
+ if self._payment is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
"""
- :rtype: str
+ :type json_str: str
+
+ :rtype: PaymentAutoAllocate
"""
- return self._legal_form
+ return converter.json_to_class(PaymentAutoAllocate, json_str)
- @property
- def type_of_business_entity(self):
+
+class PaymentAutoAllocateUser(BunqModel, AnchorObjectInterface):
+ """
+ List a users automatic payment auto allocated settings.
+
+ :param _PaymentAutoAllocate:
+ :type _PaymentAutoAllocate: PaymentAutoAllocate
+ """
+
+ # Error constants.
+ _ERROR_NULL_FIELDS = "All fields of an extended model or object are null."
+
+ # Endpoint constants.
+ _ENDPOINT_URL_LISTING = "user/{}/payment-auto-allocate"
+
+ # Object type.
+ _OBJECT_TYPE_GET = "PaymentAutoAllocate"
+
+ _PaymentAutoAllocate = None
+
+ @classmethod
+ def list(cls, params=None, custom_headers=None):
"""
- :rtype: str
+ :type user_id: int
+ :type params: dict[str, str]|None
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponsePaymentAutoAllocateUserList
"""
- return self._type_of_business_entity
+ if params is None:
+ params = {}
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
+
+ return BunqResponsePaymentAutoAllocateUserList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ )
@property
- def sector_of_industry(self):
+ def PaymentAutoAllocate(self):
"""
- :rtype: str
+ :rtype: PaymentAutoAllocate
"""
- return self._sector_of_industry
+ return self._PaymentAutoAllocate
- @property
- def counter_bank_iban(self):
+ def get_referenced_object(self):
"""
- :rtype: str
+ :rtype: BunqModel
+ :raise: BunqException
"""
- return self._counter_bank_iban
+ if self._PaymentAutoAllocate is not None:
+ return self._PaymentAutoAllocate
- @property
- def avatar(self):
+ raise BunqException(self._ERROR_NULL_FIELDS)
+
+ def is_all_field_none(self):
"""
- :rtype: object_.Avatar
+ :rtype: bool
"""
- return self._avatar
+ if self._PaymentAutoAllocate is not None:
+ return False
- @property
- def address_main(self):
+ return True
+
+ @staticmethod
+ def from_json(json_str):
"""
- :rtype: object_.Address
+ :type json_str: str
+
+ :rtype: PaymentAutoAllocateUser
"""
- return self._address_main
+ return converter.json_to_class(PaymentAutoAllocateUser, json_str)
- @property
- def address_postal(self):
+
+class PaymentServiceProviderCredential(BunqModel):
+ """
+ Register a Payment Service Provider and provide credentials
+
+ :param _client_payment_service_provider_certificate: Payment Services
+ Directive 2 compatible QSEAL certificate
+ :type _client_payment_service_provider_certificate: str
+ :param _client_payment_service_provider_certificate_chain: Intermediate and
+ root certificate belonging to the provided certificate.
+ :type _client_payment_service_provider_certificate_chain: str
+ :param _client_public_key_signature: The Base64 encoded signature of the
+ public key provided during installation and with the installation token
+ appended as a nonce. Signed with the private key belonging to the QSEAL
+ certificate.
+ :type _client_public_key_signature: str
+ :param _id_: The id of the credential.
+ :type _id_: int
+ :param _created: The timestamp of the credential object's creation.
+ :type _created: str
+ :param _updated: The timestamp of the credential object's last update.
+ :type _updated: str
+ :param _status: The status of the credential.
+ :type _status: str
+ :param _expiry_time: When the status is PENDING_FIRST_USE: when the
+ credential expires.
+ :type _expiry_time: str
+ :param _token_value: When the status is PENDING_FIRST_USE: the value of the
+ token.
+ :type _token_value: str
+ :param _permitted_device: When the status is ACTIVE: the details of the
+ device that may use the credential.
+ :type _permitted_device: object_.PermittedDevice
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_READ = "payment-service-provider-credential/{}"
+ _ENDPOINT_URL_CREATE = "payment-service-provider-credential"
+
+ # Field constants.
+ FIELD_CLIENT_PAYMENT_SERVICE_PROVIDER_CERTIFICATE = "client_payment_service_provider_certificate"
+ FIELD_CLIENT_PAYMENT_SERVICE_PROVIDER_CERTIFICATE_CHAIN = "client_payment_service_provider_certificate_chain"
+ FIELD_CLIENT_PUBLIC_KEY_SIGNATURE = "client_public_key_signature"
+
+ # Object type.
+ _OBJECT_TYPE_GET = "CredentialPasswordIp"
+
+ _id_ = None
+ _created = None
+ _updated = None
+ _status = None
+ _expiry_time = None
+ _token_value = None
+ _permitted_device = None
+ _client_payment_service_provider_certificate_field_for_request = None
+ _client_payment_service_provider_certificate_chain_field_for_request = None
+ _client_public_key_signature_field_for_request = None
+
+ def __init__(self, client_payment_service_provider_certificate, client_payment_service_provider_certificate_chain,
+ client_public_key_signature):
"""
- :rtype: object_.Address
+ :param client_payment_service_provider_certificate: Payment Services
+ Directive 2 compatible QSEAL certificate
+ :type client_payment_service_provider_certificate: str
+ :param client_payment_service_provider_certificate_chain: Intermediate and
+ root certificate belonging to the provided certificate.
+ :type client_payment_service_provider_certificate_chain: str
+ :param client_public_key_signature: The Base64 encoded signature of the
+ public key provided during installation and with the installation token
+ appended as a nonce. Signed with the private key belonging to the QSEAL
+ certificate.
+ :type client_public_key_signature: str
"""
- return self._address_postal
+ self._client_payment_service_provider_certificate_field_for_request = client_payment_service_provider_certificate
+ self._client_payment_service_provider_certificate_chain_field_for_request = client_payment_service_provider_certificate_chain
+ self._client_public_key_signature_field_for_request = client_public_key_signature
- @property
- def version_terms_of_service(self):
+ @classmethod
+ def get(cls, payment_service_provider_credential_id, custom_headers=None):
"""
- :rtype: str
+ :type api_context: ApiContext
+ :type payment_service_provider_credential_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponsePaymentServiceProviderCredential
"""
- return self._version_terms_of_service
+ if custom_headers is None:
+ custom_headers = {}
- @property
- def director_alias(self):
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(payment_service_provider_credential_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponsePaymentServiceProviderCredential.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @classmethod
+ def create(cls, client_payment_service_provider_certificate, client_payment_service_provider_certificate_chain,
+ client_public_key_signature, custom_headers=None):
"""
- :rtype: object_.LabelUser
+ :param client_payment_service_provider_certificate: Payment Services
+ Directive 2 compatible QSEAL certificate
+ :type client_payment_service_provider_certificate: str
+ :param client_payment_service_provider_certificate_chain: Intermediate
+ and root certificate belonging to the provided certificate.
+ :type client_payment_service_provider_certificate_chain: str
+ :param client_public_key_signature: The Base64 encoded signature of the
+ public key provided during installation and with the installation token
+ appended as a nonce. Signed with the private key belonging to the QSEAL
+ certificate.
+ :type client_public_key_signature: str
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
"""
- return self._director_alias
+ if custom_headers is None:
+ custom_headers = {}
+
+ request_map = {
+ cls.FIELD_CLIENT_PAYMENT_SERVICE_PROVIDER_CERTIFICATE: client_payment_service_provider_certificate,
+ cls.FIELD_CLIENT_PAYMENT_SERVICE_PROVIDER_CERTIFICATE_CHAIN: client_payment_service_provider_certificate_chain,
+ cls.FIELD_CLIENT_PUBLIC_KEY_SIGNATURE: client_public_key_signature
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ api_client = ApiClient(cls._get_api_context())
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
@property
- def language(self):
+ def id_(self):
"""
- :rtype: str
+ :rtype: int
"""
- return self._language
+ return self._id_
@property
- def country(self):
+ def created(self):
"""
:rtype: str
"""
- return self._country
+ return self._created
@property
- def region(self):
+ def updated(self):
"""
:rtype: str
"""
- return self._region
-
- @property
- def ubo(self):
- """
- :rtype: list[object_.Ubo]
- """
-
- return self._ubo
+ return self._updated
@property
def status(self):
@@ -31480,68 +33537,28 @@ def status(self):
return self._status
@property
- def sub_status(self):
+ def expiry_time(self):
"""
:rtype: str
"""
- return self._sub_status
-
- @property
- def session_timeout(self):
- """
- :rtype: int
- """
-
- return self._session_timeout
-
- @property
- def daily_limit_without_confirmation_login(self):
- """
- :rtype: object_.Amount
- """
-
- return self._daily_limit_without_confirmation_login
-
- @property
- def notification_filters(self):
- """
- :rtype: list[object_.NotificationFilter]
- """
-
- return self._notification_filters
-
- @property
- def customer(self):
- """
- :rtype: Customer
- """
-
- return self._customer
-
- @property
- def customer_limit(self):
- """
- :rtype: CustomerLimit
- """
-
- return self._customer_limit
+ return self._expiry_time
@property
- def billing_contract(self):
+ def token_value(self):
"""
- :rtype: list[BillingContractSubscription]
+ :rtype: str
"""
- return self._billing_contract
+ return self._token_value
@property
- def deny_reason(self):
+ def permitted_device(self):
"""
- :rtype: str
+ :rtype: object_.PermittedDevice
"""
- return self._deny_reason
+ return self._permitted_device
def is_all_field_none(self):
"""
@@ -31557,297 +33574,492 @@ def is_all_field_none(self):
if self._updated is not None:
return False
- if self._public_uuid is not None:
- return False
-
- if self._name is not None:
- return False
-
- if self._display_name is not None:
- return False
-
- if self._public_nick_name is not None:
+ if self._status is not None:
return False
- if self._alias is not None:
+ if self._expiry_time is not None:
return False
- if self._chamber_of_commerce_number is not None:
+ if self._token_value is not None:
return False
- if self._legal_form is not None:
+ if self._permitted_device is not None:
return False
- if self._type_of_business_entity is not None:
- return False
+ return True
- if self._sector_of_industry is not None:
- return False
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: PaymentServiceProviderCredential
+ """
- if self._counter_bank_iban is not None:
- return False
+ return converter.json_to_class(PaymentServiceProviderCredential, json_str)
- if self._avatar is not None:
- return False
- if self._address_main is not None:
- return False
+class PaymentServiceProviderDraftPayment(BunqModel):
+ """
+ Manage the PaymentServiceProviderDraftPayment's for a PISP.
+
+ :param _sender_iban: The sender IBAN.
+ :type _sender_iban: str
+ :param _sender_name: The name of the sender.
+ :type _sender_name: str
+ :param _counterparty_iban: The IBAN of the counterparty.
+ :type _counterparty_iban: str
+ :param _counterparty_name: The name of the counterparty.
+ :type _counterparty_name: str
+ :param _description: Description of the payment.
+ :type _description: str
+ :param _amount: The amount of the draft payment
+ :type _amount: object_.Amount
+ :param _status: The status of the draft payment
+ :type _status: str
+ :param _receiver_iban: The sender IBAN.
+ :type _receiver_iban: str
+ """
- if self._address_postal is not None:
- return False
+ # Endpoint constants.
+ _ENDPOINT_URL_CREATE = "user/{}/payment-service-provider-draft-payment"
+ _ENDPOINT_URL_UPDATE = "user/{}/payment-service-provider-draft-payment/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/payment-service-provider-draft-payment"
+ _ENDPOINT_URL_READ = "user/{}/payment-service-provider-draft-payment/{}"
- if self._version_terms_of_service is not None:
- return False
+ # Field constants.
+ FIELD_SENDER_IBAN = "sender_iban"
+ FIELD_SENDER_NAME = "sender_name"
+ FIELD_COUNTERPARTY_IBAN = "counterparty_iban"
+ FIELD_COUNTERPARTY_NAME = "counterparty_name"
+ FIELD_DESCRIPTION = "description"
+ FIELD_AMOUNT = "amount"
+ FIELD_STATUS = "status"
- if self._director_alias is not None:
- return False
+ # Object type.
+ _OBJECT_TYPE_GET = "PaymentServiceProviderDraftPayment"
- if self._language is not None:
- return False
+ _sender_iban = None
+ _receiver_iban = None
+ _amount = None
+ _status = None
+ _sender_iban_field_for_request = None
+ _sender_name_field_for_request = None
+ _counterparty_iban_field_for_request = None
+ _counterparty_name_field_for_request = None
+ _description_field_for_request = None
+ _amount_field_for_request = None
+ _status_field_for_request = None
- if self._country is not None:
- return False
+ def __init__(self, sender_iban, counterparty_iban, counterparty_name, description, amount, sender_name=None,
+ status=None):
+ """
+ :param sender_iban: The IBAN of the sender.
+ :type sender_iban: str
+ :param counterparty_iban: The IBAN of the counterparty.
+ :type counterparty_iban: str
+ :param counterparty_name: The name of the counterparty.
+ :type counterparty_name: str
+ :param description: Description of the payment.
+ :type description: str
+ :param amount: The Amount to transfer with the Payment. Must be bigger than
+ 0.
+ :type amount: object_.Amount
+ :param sender_name: The name of the sender.
+ :type sender_name: str
+ :param status: The new status of the Draft Payment. Can only be set to
+ REJECTED or CANCELLED by update.
+ :type status: str
+ """
- if self._region is not None:
- return False
+ self._sender_iban_field_for_request = sender_iban
+ self._counterparty_iban_field_for_request = counterparty_iban
+ self._counterparty_name_field_for_request = counterparty_name
+ self._description_field_for_request = description
+ self._amount_field_for_request = amount
+ self._sender_name_field_for_request = sender_name
+ self._status_field_for_request = status
- if self._ubo is not None:
- return False
+ @classmethod
+ def create(cls, sender_iban, counterparty_iban, counterparty_name, description, amount, sender_name=None,
+ status=None, custom_headers=None):
+ """
+ :type user_id: int
+ :param sender_iban: The IBAN of the sender.
+ :type sender_iban: str
+ :param counterparty_iban: The IBAN of the counterparty.
+ :type counterparty_iban: str
+ :param counterparty_name: The name of the counterparty.
+ :type counterparty_name: str
+ :param description: Description of the payment.
+ :type description: str
+ :param amount: The Amount to transfer with the Payment. Must be bigger
+ than 0.
+ :type amount: object_.Amount
+ :param sender_name: The name of the sender.
+ :type sender_name: str
+ :param status: The new status of the Draft Payment. Can only be set to
+ REJECTED or CANCELLED by update.
+ :type status: str
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
+ """
- if self._status is not None:
- return False
+ if custom_headers is None:
+ custom_headers = {}
- if self._sub_status is not None:
- return False
+ request_map = {
+ cls.FIELD_SENDER_IBAN: sender_iban,
+ cls.FIELD_SENDER_NAME: sender_name,
+ cls.FIELD_COUNTERPARTY_IBAN: counterparty_iban,
+ cls.FIELD_COUNTERPARTY_NAME: counterparty_name,
+ cls.FIELD_DESCRIPTION: description,
+ cls.FIELD_AMOUNT: amount,
+ cls.FIELD_STATUS: status
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
- if self._session_timeout is not None:
- return False
+ api_client = ApiClient(cls._get_api_context())
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
- if self._daily_limit_without_confirmation_login is not None:
- return False
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
- if self._notification_filters is not None:
- return False
+ @classmethod
+ def update(cls, payment_service_provider_draft_payment_id, status=None, custom_headers=None):
+ """
+ :type user_id: int
+ :type payment_service_provider_draft_payment_id: int
+ :param status: The new status of the Draft Payment. Can only be set to
+ REJECTED or CANCELLED by update.
+ :type status: str
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
+ """
- if self._customer is not None:
- return False
+ if custom_headers is None:
+ custom_headers = {}
- if self._customer_limit is not None:
- return False
+ api_client = ApiClient(cls._get_api_context())
- if self._billing_contract is not None:
- return False
+ request_map = {
+ cls.FIELD_STATUS: status
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
- if self._deny_reason is not None:
- return False
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
+ payment_service_provider_draft_payment_id)
+ response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
- return True
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
- @staticmethod
- def from_json(json_str):
+ @classmethod
+ def list(cls, params=None, custom_headers=None):
"""
- :type json_str: str
+ :type user_id: int
+ :type params: dict[str, str]|None
+ :type custom_headers: dict[str, str]|None
- :rtype: UserCompany
+ :rtype: BunqResponsePaymentServiceProviderDraftPaymentList
"""
- return converter.json_to_class(UserCompany, json_str)
-
+ if params is None:
+ params = {}
-class Customer(BunqModel):
- """
- Used to view a customer.
-
- :param _billing_account_id: The primary billing account account's id.
- :type _billing_account_id: str
- :param _invoice_notification_preference: The preferred notification type for
- invoices.
- :type _invoice_notification_preference: str
- :param _id_: The id of the customer.
- :type _id_: int
- :param _created: The timestamp of the customer object's creation.
- :type _created: str
- :param _updated: The timestamp of the customer object's last update.
- :type _updated: str
- """
+ if custom_headers is None:
+ custom_headers = {}
- # Field constants.
- FIELD_BILLING_ACCOUNT_ID = "billing_account_id"
- FIELD_INVOICE_NOTIFICATION_PREFERENCE = "invoice_notification_preference"
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
- _id_ = None
- _created = None
- _updated = None
- _billing_account_id = None
- _invoice_notification_preference = None
- _billing_account_id_field_for_request = None
- _invoice_notification_preference_field_for_request = None
+ return BunqResponsePaymentServiceProviderDraftPaymentList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ )
- def __init__(self, billing_account_id=None, invoice_notification_preference=None):
+ @classmethod
+ def get(cls, payment_service_provider_draft_payment_id, custom_headers=None):
"""
- :param billing_account_id: The primary billing account account's id.
- :type billing_account_id: str
- :param invoice_notification_preference: The preferred notification type for
- invoices
- :type invoice_notification_preference: str
+ :type api_context: ApiContext
+ :type user_id: int
+ :type payment_service_provider_draft_payment_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponsePaymentServiceProviderDraftPayment
"""
- self._billing_account_id_field_for_request = billing_account_id
- self._invoice_notification_preference_field_for_request = invoice_notification_preference
+ if custom_headers is None:
+ custom_headers = {}
- @property
- def id_(self):
- """
- :rtype: int
- """
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
+ payment_service_provider_draft_payment_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return self._id_
+ return BunqResponsePaymentServiceProviderDraftPayment.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
@property
- def created(self):
+ def sender_iban(self):
"""
:rtype: str
"""
- return self._created
+ return self._sender_iban
@property
- def updated(self):
+ def receiver_iban(self):
"""
:rtype: str
"""
- return self._updated
+ return self._receiver_iban
@property
- def billing_account_id(self):
+ def amount(self):
"""
- :rtype: str
+ :rtype: object_.Amount
"""
- return self._billing_account_id
+ return self._amount
@property
- def invoice_notification_preference(self):
+ def status(self):
"""
:rtype: str
"""
- return self._invoice_notification_preference
+ return self._status
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._id_ is not None:
+ if self._sender_iban is not None:
return False
- if self._created is not None:
+ if self._receiver_iban is not None:
return False
- if self._updated is not None:
+ if self._amount is not None:
return False
- if self._billing_account_id is not None:
+ if self._status is not None:
return False
- if self._invoice_notification_preference is not None:
- return False
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: PaymentServiceProviderDraftPayment
+ """
+
+ return converter.json_to_class(PaymentServiceProviderDraftPayment, json_str)
+
+
+class PermittedIp(BunqModel):
+ """
+ Manage the IPs which may be used for a credential of a user for server
+ authentication.
+
+ :param _ip: The IP address.
+ :type _ip: str
+ :param _status: The status of the IP. May be "ACTIVE" or "INACTIVE". It is
+ only possible to make requests from "ACTIVE" IP addresses. Only "ACTIVE" IPs
+ will be billed.
+ :type _status: str
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_READ = "user/{}/credential-password-ip/{}/ip/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/credential-password-ip/{}/ip"
+ _ENDPOINT_URL_LISTING = "user/{}/credential-password-ip/{}/ip"
+ _ENDPOINT_URL_UPDATE = "user/{}/credential-password-ip/{}/ip/{}"
+
+ # Field constants.
+ FIELD_IP = "ip"
+ FIELD_STATUS = "status"
+
+ # Object type.
+ _OBJECT_TYPE_GET = "PermittedIp"
+
+ _ip = None
+ _status = None
+ _ip_field_for_request = None
+ _status_field_for_request = None
+
+ def __init__(self, ip, status=None):
+ """
+ :param ip: The IP address.
+ :type ip: str
+ :param status: The status of the IP. May be "ACTIVE" or "INACTIVE". It is
+ only possible to make requests from "ACTIVE" IP addresses. Only "ACTIVE" IPs
+ will be billed.
+ :type status: str
+ """
+
+ self._ip_field_for_request = ip
+ self._status_field_for_request = status
+
+ @classmethod
+ def get(cls, credential_password_ip_id, permitted_ip_id, custom_headers=None):
+ """
+ :type api_context: ApiContext
+ :type user_id: int
+ :type credential_password_ip_id: int
+ :type permitted_ip_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponsePermittedIp
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), credential_password_ip_id,
+ permitted_ip_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponsePermittedIp.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @classmethod
+ def create(cls, credential_password_ip_id, ip, status=None, custom_headers=None):
+ """
+ :type user_id: int
+ :type credential_password_ip_id: int
+ :param ip: The IP address.
+ :type ip: str
+ :param status: The status of the IP. May be "ACTIVE" or "INACTIVE". It
+ is only possible to make requests from "ACTIVE" IP addresses. Only
+ "ACTIVE" IPs will be billed.
+ :type status: str
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ request_map = {
+ cls.FIELD_IP: ip,
+ cls.FIELD_STATUS: status
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ api_client = ApiClient(cls._get_api_context())
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(), credential_password_ip_id)
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
- return True
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
- @staticmethod
- def from_json(json_str):
+ @classmethod
+ def list(cls, credential_password_ip_id, params=None, custom_headers=None):
"""
- :type json_str: str
+ :type user_id: int
+ :type credential_password_ip_id: int
+ :type params: dict[str, str]|None
+ :type custom_headers: dict[str, str]|None
- :rtype: Customer
+ :rtype: BunqResponsePermittedIpList
"""
- return converter.json_to_class(Customer, json_str)
+ if params is None:
+ params = {}
+ if custom_headers is None:
+ custom_headers = {}
-class UserApiKey(BunqModel):
- """
- Used to view OAuth request detais in events.
-
- :param _id_: The id of the user.
- :type _id_: int
- :param _created: The timestamp of the user object's creation.
- :type _created: str
- :param _updated: The timestamp of the user object's last update.
- :type _updated: str
- :param _requested_by_user: The user who requested access.
- :type _requested_by_user: object_.UserApiKeyAnchoredUser
- :param _granted_by_user: The user who granted access.
- :type _granted_by_user: object_.UserApiKeyAnchoredUser
- """
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(), credential_password_ip_id)
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
- _id_ = None
- _created = None
- _updated = None
- _requested_by_user = None
- _granted_by_user = None
+ return BunqResponsePermittedIpList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ )
- @property
- def id_(self):
+ @classmethod
+ def update(cls, credential_password_ip_id, permitted_ip_id, status=None, custom_headers=None):
"""
- :rtype: int
+ :type user_id: int
+ :type credential_password_ip_id: int
+ :type permitted_ip_id: int
+ :param status: The status of the IP. May be "ACTIVE" or "INACTIVE". It
+ is only possible to make requests from "ACTIVE" IP addresses. Only
+ "ACTIVE" IPs will be billed.
+ :type status: str
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
"""
- return self._id_
+ if custom_headers is None:
+ custom_headers = {}
- @property
- def created(self):
- """
- :rtype: str
- """
+ api_client = ApiClient(cls._get_api_context())
- return self._created
+ request_map = {
+ cls.FIELD_STATUS: status
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
- @property
- def updated(self):
- """
- :rtype: str
- """
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(), credential_password_ip_id,
+ permitted_ip_id)
+ response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
- return self._updated
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
@property
- def requested_by_user(self):
+ def ip(self):
"""
- :rtype: object_.UserApiKeyAnchoredUser
+ :rtype: str
"""
- return self._requested_by_user
+ return self._ip
@property
- def granted_by_user(self):
+ def status(self):
"""
- :rtype: object_.UserApiKeyAnchoredUser
+ :rtype: str
"""
- return self._granted_by_user
+ return self._status
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._id_ is not None:
- return False
-
- if self._created is not None:
- return False
-
- if self._updated is not None:
- return False
-
- if self._requested_by_user is not None:
+ if self._ip is not None:
return False
- if self._granted_by_user is not None:
+ if self._status is not None:
return False
return True
@@ -31857,93 +34069,98 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: UserApiKey
+ :rtype: PermittedIp
"""
- return converter.json_to_class(UserApiKey, json_str)
+ return converter.json_to_class(PermittedIp, json_str)
-class UserPaymentServiceProvider(BunqModel):
+class Reward(BunqModel):
"""
- Used to view UserPaymentServiceProvider for session creation.
+ Used to view Rewards.
- :param _id_: The id of the user.
+ :param _id_: The id of the reward.
:type _id_: int
- :param _created: The timestamp of the user object's creation.
+ :param _created: The time the reward was created.
:type _created: str
- :param _updated: The timestamp of the user object's last update.
+ :param _updated: The time the reward was last updated.
:type _updated: str
- :param _certificate_distinguished_name: The distinguished name from the
- certificate used to identify this user.
- :type _certificate_distinguished_name: str
- :param _alias: The aliases of the user.
- :type _alias: list[object_.Pointer]
- :param _avatar: The user's avatar.
- :type _avatar: object_.Avatar
- :param _status: The user status. The user status. Can be: ACTIVE, BLOCKED or
- DENIED.
+ :param _status: The status of the reward.
:type _status: str
- :param _sub_status: The user sub-status. Can be: NONE
+ :param _sub_status: The subStatus of the reward.
:type _sub_status: str
- :param _public_uuid: The providers's public UUID.
- :type _public_uuid: str
- :param _display_name: The display name for the provider.
- :type _display_name: str
- :param _public_nick_name: The public nick name for the provider.
- :type _public_nick_name: str
- :param _language: The provider's language. Formatted as a ISO 639-1 language
- code plus a ISO 3166-1 alpha-2 country code, separated by an underscore.
- :type _language: str
- :param _region: The provider's region. Formatted as a ISO 639-1 language
- code plus a ISO 3166-1 alpha-2 country code, separated by an underscore.
- :type _region: str
- :param _session_timeout: The setting for the session timeout of the user in
- seconds.
- :type _session_timeout: int
+ :param _type_: The type of the reward.
+ :type _type_: str
+ :param _counterparty_alias: The alias of the other user eligible for the
+ reward award.
+ :type _counterparty_alias: object_.LabelUser
+ :param _amount_reward: The amount that will be/was awarded as reward for the
+ reward.
+ :type _amount_reward: object_.Amount
"""
# Endpoint constants.
- _ENDPOINT_URL_READ = "user-payment-service-provider/{}"
+ _ENDPOINT_URL_READ = "user/{}/reward/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/reward"
# Object type.
- _OBJECT_TYPE_GET = "UserPaymentServiceProvider"
+ _OBJECT_TYPE_GET = "Reward"
_id_ = None
_created = None
_updated = None
- _certificate_distinguished_name = None
- _alias = None
- _avatar = None
_status = None
_sub_status = None
- _public_uuid = None
- _display_name = None
- _public_nick_name = None
- _language = None
- _region = None
- _session_timeout = None
+ _type_ = None
+ _counterparty_alias = None
+ _amount_reward = None
@classmethod
- def get(cls, user_payment_service_provider_id, custom_headers=None):
+ def get(cls, reward_id, custom_headers=None):
"""
:type api_context: ApiContext
- :type user_payment_service_provider_id: int
+ :type user_id: int
+ :type reward_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseUserPaymentServiceProvider
+ :rtype: BunqResponseReward
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(user_payment_service_provider_id)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), reward_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseUserPaymentServiceProvider.cast_from_bunq_response(
+ return BunqResponseReward.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
+ @classmethod
+ def list(cls, params=None, custom_headers=None):
+ """
+ :type user_id: int
+ :type params: dict[str, str]|None
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseRewardList
+ """
+
+ if params is None:
+ params = {}
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
+
+ return BunqResponseRewardList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
@property
def id_(self):
"""
@@ -31968,30 +34185,6 @@ def updated(self):
return self._updated
- @property
- def certificate_distinguished_name(self):
- """
- :rtype: str
- """
-
- return self._certificate_distinguished_name
-
- @property
- def alias(self):
- """
- :rtype: list[object_.Pointer]
- """
-
- return self._alias
-
- @property
- def avatar(self):
- """
- :rtype: object_.Avatar
- """
-
- return self._avatar
-
@property
def status(self):
"""
@@ -32009,52 +34202,28 @@ def sub_status(self):
return self._sub_status
@property
- def public_uuid(self):
- """
- :rtype: str
- """
-
- return self._public_uuid
-
- @property
- def display_name(self):
- """
- :rtype: str
- """
-
- return self._display_name
-
- @property
- def public_nick_name(self):
- """
- :rtype: str
- """
-
- return self._public_nick_name
-
- @property
- def language(self):
+ def type_(self):
"""
:rtype: str
"""
- return self._language
+ return self._type_
@property
- def region(self):
+ def counterparty_alias(self):
"""
- :rtype: str
+ :rtype: object_.LabelUser
"""
- return self._region
+ return self._counterparty_alias
@property
- def session_timeout(self):
+ def amount_reward(self):
"""
- :rtype: int
+ :rtype: object_.Amount
"""
- return self._session_timeout
+ return self._amount_reward
def is_all_field_none(self):
"""
@@ -32070,37 +34239,19 @@ def is_all_field_none(self):
if self._updated is not None:
return False
- if self._certificate_distinguished_name is not None:
- return False
-
- if self._alias is not None:
- return False
-
- if self._avatar is not None:
- return False
-
if self._status is not None:
return False
if self._sub_status is not None:
return False
- if self._public_uuid is not None:
- return False
-
- if self._display_name is not None:
- return False
-
- if self._public_nick_name is not None:
- return False
-
- if self._language is not None:
+ if self._type_ is not None:
return False
- if self._region is not None:
+ if self._counterparty_alias is not None:
return False
- if self._session_timeout is not None:
+ if self._amount_reward is not None:
return False
return True
@@ -32110,138 +34261,251 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: UserPaymentServiceProvider
+ :rtype: Reward
"""
- return converter.json_to_class(UserPaymentServiceProvider, json_str)
+ return converter.json_to_class(Reward, json_str)
-class OauthCallbackUrl(BunqModel):
+class SandboxUserCompany(BunqModel):
"""
- Used for managing OAuth Client Callback URLs.
+ Used to create a sandbox userCompany.
- :param _url: The URL for this callback.
- :type _url: str
+ :param _api_key: The API key of the newly created sandbox userCompany.
+ :type _api_key: str
"""
# Endpoint constants.
- _ENDPOINT_URL_READ = "user/{}/oauth-client/{}/callback-url/{}"
- _ENDPOINT_URL_CREATE = "user/{}/oauth-client/{}/callback-url"
- _ENDPOINT_URL_UPDATE = "user/{}/oauth-client/{}/callback-url/{}"
- _ENDPOINT_URL_LISTING = "user/{}/oauth-client/{}/callback-url"
- _ENDPOINT_URL_DELETE = "user/{}/oauth-client/{}/callback-url/{}"
-
- # Field constants.
- FIELD_URL = "url"
+ _ENDPOINT_URL_CREATE = "sandbox-user-company"
# Object type.
- _OBJECT_TYPE_GET = "OauthCallbackUrl"
-
- _url = None
- _url_field_for_request = None
-
- def __init__(self, url=None):
- """
- :param url: The URL for this callback.
- :type url: str
- """
+ _OBJECT_TYPE_POST = "ApiKey"
- self._url_field_for_request = url
+ _api_key = None
@classmethod
- def get(cls, oauth_client_id, oauth_callback_url_id, custom_headers=None):
+ def create(cls, custom_headers=None):
"""
- :type api_context: ApiContext
- :type user_id: int
- :type oauth_client_id: int
- :type oauth_callback_url_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseOauthCallbackUrl
+ :rtype: BunqResponseSandboxUserCompany
"""
if custom_headers is None:
custom_headers = {}
+ request_map = {
+
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), oauth_client_id, oauth_callback_url_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
- return BunqResponseOauthCallbackUrl.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ return BunqResponseSandboxUserCompany.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_POST)
)
+ @property
+ def api_key(self):
+ """
+ :rtype: str
+ """
+
+ return self._api_key
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._api_key is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: SandboxUserCompany
+ """
+
+ return converter.json_to_class(SandboxUserCompany, json_str)
+
+
+class SandboxUserPerson(BunqModel):
+ """
+ Used to create a sandbox userPerson.
+
+ :param _api_key: The API key of the newly created sandbox userPerson.
+ :type _api_key: str
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_CREATE = "sandbox-user-person"
+
+ # Object type.
+ _OBJECT_TYPE_POST = "ApiKey"
+
+ _api_key = None
+
@classmethod
- def create(cls, oauth_client_id, url, custom_headers=None):
+ def create(cls, custom_headers=None):
"""
- :type user_id: int
- :type oauth_client_id: int
- :param url: The URL for this callback.
- :type url: str
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseInt
+ :rtype: BunqResponseSandboxUserPerson
"""
if custom_headers is None:
custom_headers = {}
request_map = {
- cls.FIELD_URL: url
+
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
api_client = ApiClient(cls._get_api_context())
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(), oauth_client_id)
+ endpoint_url = cls._ENDPOINT_URL_CREATE
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
+ return BunqResponseSandboxUserPerson.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_POST)
)
+ @property
+ def api_key(self):
+ """
+ :rtype: str
+ """
+
+ return self._api_key
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._api_key is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: SandboxUserPerson
+ """
+
+ return converter.json_to_class(SandboxUserPerson, json_str)
+
+
+class SandboxUser(BunqModel):
+ """
+ Used to create a sandbox user.
+
+ :param _api_key: The API key of the newly created sandbox user.
+ :type _api_key: str
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_CREATE = "sandbox-user"
+
+ # Object type.
+ _OBJECT_TYPE_POST = "ApiKey"
+
+ _api_key = None
+
@classmethod
- def update(cls, oauth_client_id, oauth_callback_url_id, url=None, custom_headers=None):
+ def create(cls, custom_headers=None):
"""
- :type user_id: int
- :type oauth_client_id: int
- :type oauth_callback_url_id: int
- :param url: The URL for this callback.
- :type url: str
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseInt
+ :rtype: BunqResponseSandboxUser
"""
if custom_headers is None:
custom_headers = {}
- api_client = ApiClient(cls._get_api_context())
-
request_map = {
- cls.FIELD_URL: url
+
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
+ api_client = ApiClient(cls._get_api_context())
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(), oauth_client_id, oauth_callback_url_id)
- response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_CREATE
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
+ return BunqResponseSandboxUser.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_POST)
)
+ @property
+ def api_key(self):
+ """
+ :rtype: str
+ """
+
+ return self._api_key
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._api_key is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: SandboxUser
+ """
+
+ return converter.json_to_class(SandboxUser, json_str)
+
+
+class ScheduleUser(BunqModel):
+ """
+ view for reading the scheduled definitions.
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_LISTING = "user/{}/schedule"
+
+ # Object type.
+ _OBJECT_TYPE_GET = "ScheduleUser"
+
@classmethod
- def list(cls, oauth_client_id, params=None, custom_headers=None):
+ def list(cls, params=None, custom_headers=None):
"""
+ Get a collection of scheduled definition for all accessible monetary
+ accounts of the user. You can add the parameter type to filter the
+ response. When
+ type={SCHEDULE_DEFINITION_PAYMENT,SCHEDULE_DEFINITION_PAYMENT_BATCH} is
+ provided only schedule definition object that relate to these
+ definitions are returned.
+
:type user_id: int
- :type oauth_client_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseOauthCallbackUrlList
+ :rtype: BunqResponseScheduleUserList
"""
if params is None:
@@ -32251,19 +34515,45 @@ def list(cls, oauth_client_id, params=None, custom_headers=None):
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(), oauth_client_id)
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseOauthCallbackUrlList.cast_from_bunq_response(
+ return BunqResponseScheduleUserList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: ScheduleUser
+ """
+
+ return converter.json_to_class(ScheduleUser, json_str)
+
+
+class Session(BunqModel):
+ """
+ Endpoint for operations over the current session.
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_DELETE = "session/{}"
+
@classmethod
- def delete(cls, oauth_client_id, oauth_callback_url_id, custom_headers=None):
+ def delete(cls, session_id, custom_headers=None):
"""
- :type user_id: int
- :type oauth_client_id: int
- :type oauth_callback_url_id: int
+ Deletes the current session.
+
+ :type session_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -32273,29 +34563,18 @@ def delete(cls, oauth_client_id, oauth_callback_url_id, custom_headers=None):
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(), oauth_client_id, oauth_callback_url_id)
+ endpoint_url = cls._ENDPOINT_URL_DELETE.format(session_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
BunqResponse(None, response_raw.headers)
)
- @property
- def url(self):
- """
- :rtype: str
- """
-
- return self._url
-
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._url is not None:
- return False
-
return True
@staticmethod
@@ -32303,116 +34582,109 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: OauthCallbackUrl
+ :rtype: Session
"""
- return converter.json_to_class(OauthCallbackUrl, json_str)
+ return converter.json_to_class(Session, json_str)
-class OauthClient(BunqModel):
+class ShareInviteMonetaryAccountAmountUsed(BunqModel):
"""
- Used for managing OAuth Clients.
-
- :param _status: The status of the pack group, can be ACTIVE, CANCELLED or
- CANCELLED_PENDING.
- :type _status: str
- :param _id_: Id of the client.
- :type _id_: int
- :param _client_id: The Client ID associated with this Oauth Client
- :type _client_id: str
- :param _secret: Secret associated with this Oauth Client
- :type _secret: str
- :param _callback_url: The callback URLs which are bound to this Oauth Client
- :type _callback_url: list[object_.OauthCallbackUrl]
+ When you have connected your monetary account to a user, and given this user
+ a (for example) daily budget of 10 EUR. If this users has used his entire
+ budget or part of it, this call can be used to reset the amount he used to
+ 0. The user can then spend the daily budget of 10 EUR again.
"""
# Endpoint constants.
- _ENDPOINT_URL_READ = "user/{}/oauth-client/{}"
- _ENDPOINT_URL_CREATE = "user/{}/oauth-client"
- _ENDPOINT_URL_UPDATE = "user/{}/oauth-client/{}"
- _ENDPOINT_URL_LISTING = "user/{}/oauth-client"
-
- # Field constants.
- FIELD_STATUS = "status"
-
- # Object type.
- _OBJECT_TYPE_GET = "OauthClient"
-
- _id_ = None
- _status = None
- _client_id = None
- _secret = None
- _callback_url = None
- _status_field_for_request = None
-
- def __init__(self, status=None):
- """
- :param status: The status of the Oauth Client, can be ACTIVE or CANCELLED.
- :type status: str
- """
-
- self._status_field_for_request = status
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/share-invite-monetary-account-inquiry/{}/amount-used/{}"
@classmethod
- def get(cls, oauth_client_id, custom_headers=None):
+ def delete(cls, share_invite_monetary_account_inquiry_id, share_invite_monetary_account_amount_used_id,
+ monetary_account_id=None, custom_headers=None):
"""
- :type api_context: ApiContext
+ Reset the available budget for an account share. To be called without
+ any ID at the end of the path.
+
:type user_id: int
- :type oauth_client_id: int
+ :type monetary_account_id: int
+ :type share_invite_monetary_account_inquiry_id: int
+ :type share_invite_monetary_account_amount_used_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseOauthClient
+ :rtype: BunqResponseNone
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), oauth_client_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ share_invite_monetary_account_inquiry_id,
+ share_invite_monetary_account_amount_used_id)
+ response_raw = api_client.delete(endpoint_url, custom_headers)
- return BunqResponseOauthClient.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ return BunqResponseNone.cast_from_bunq_response(
+ BunqResponse(None, response_raw.headers)
)
- @classmethod
- def create(cls, status=None, custom_headers=None):
+ def is_all_field_none(self):
"""
- :type user_id: int
- :param status: The status of the Oauth Client, can be ACTIVE or
- CANCELLED.
- :type status: str
- :type custom_headers: dict[str, str]|None
+ :rtype: bool
+ """
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
- :rtype: BunqResponseInt
+ :rtype: ShareInviteMonetaryAccountAmountUsed
"""
- if custom_headers is None:
- custom_headers = {}
+ return converter.json_to_class(ShareInviteMonetaryAccountAmountUsed, json_str)
- request_map = {
- cls.FIELD_STATUS: status
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
- api_client = ApiClient(cls._get_api_context())
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
- response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+class TabItemShopBatch(BunqModel):
+ """
+ Create a batch of tab items.
+
+ :param _tab_items: The list of tab items in the batch.
+ :type _tab_items: list[TabItemShop]
+ """
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
- )
+ # Endpoint constants.
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/cash-register/{}/tab/{}/tab-item-batch"
+
+ # Field constants.
+ FIELD_TAB_ITEMS = "tab_items"
+
+ _tab_items = None
+ _tab_items_field_for_request = None
+
+ def __init__(self, tab_items):
+ """
+ :param tab_items: The list of tab items we want to create in a single batch.
+ Limited to 50 items per batch.
+ :type tab_items: list[TabItemShop]
+ """
+
+ self._tab_items_field_for_request = tab_items
@classmethod
- def update(cls, oauth_client_id, status=None, custom_headers=None):
+ def create(cls, cash_register_id, tab_uuid, tab_items, monetary_account_id=None, custom_headers=None):
"""
+ Create tab items as a batch.
+
:type user_id: int
- :type oauth_client_id: int
- :param status: The status of the Oauth Client, can be ACTIVE or
- CANCELLED.
- :type status: str
+ :type monetary_account_id: int
+ :type cash_register_id: int
+ :type tab_uuid: str
+ :param tab_items: The list of tab items we want to create in a single
+ batch. Limited to 50 items per batch.
+ :type tab_items: list[TabItemShop]
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -32421,104 +34693,37 @@ def update(cls, oauth_client_id, status=None, custom_headers=None):
if custom_headers is None:
custom_headers = {}
- api_client = ApiClient(cls._get_api_context())
-
request_map = {
- cls.FIELD_STATUS: status
+ cls.FIELD_TAB_ITEMS: tab_items
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
+ api_client = ApiClient(cls._get_api_context())
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(), oauth_client_id)
- response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ cash_register_id, tab_uuid)
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
cls._process_for_id(response_raw)
)
- @classmethod
- def list(cls, params=None, custom_headers=None):
- """
- :type user_id: int
- :type params: dict[str, str]|None
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseOauthClientList
- """
-
- if params is None:
- params = {}
-
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
- response_raw = api_client.get(endpoint_url, params, custom_headers)
-
- return BunqResponseOauthClientList.cast_from_bunq_response(
- cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
- )
-
- @property
- def id_(self):
- """
- :rtype: int
- """
-
- return self._id_
-
- @property
- def status(self):
- """
- :rtype: str
- """
-
- return self._status
-
- @property
- def client_id(self):
- """
- :rtype: str
- """
-
- return self._client_id
-
- @property
- def secret(self):
- """
- :rtype: str
- """
-
- return self._secret
-
@property
- def callback_url(self):
+ def tab_items(self):
"""
- :rtype: list[object_.OauthCallbackUrl]
+ :rtype: list[TabItemShop]
"""
- return self._callback_url
+ return self._tab_items
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._id_ is not None:
- return False
-
- if self._status is not None:
- return False
-
- if self._client_id is not None:
- return False
-
- if self._secret is not None:
- return False
-
- if self._callback_url is not None:
+ if self._tab_items is not None:
return False
return True
@@ -32528,96 +34733,258 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: OauthClient
+ :rtype: TabItemShopBatch
"""
- return converter.json_to_class(OauthClient, json_str)
+ return converter.json_to_class(TabItemShopBatch, json_str)
-class PaymentAutoAllocateDefinition(BunqModel):
+class TabItemShop(BunqModel):
"""
- List all the definitions in a payment auto allocate.
+ After youβve created a Tab using /tab-usage-single or /tab-usage-multiple
+ you can add items and attachments using tab-item. You can only add or modify
+ TabItems of a Tab which status is OPEN. The amount of the TabItems will not
+ influence the total_amount of the corresponding Tab. However, if you've
+ created any TabItems for a Tab the sum of the amounts of these items must be
+ equal to the total_amount of the Tab when you change its status to
+ PAYABLE/WAITING_FOR_PAYMENT.
- :param _type_: The type of definition.
- :type _type_: str
- :param _counterparty_alias: The alias of the party we are allocating the
- money to.
- :type _counterparty_alias: object_.MonetaryAccountReference
- :param _description: The description for the payment.
+ :param _description: The TabItem's brief description.
:type _description: str
- :param _amount: The amount to allocate.
+ :param _ean_code: The TabItem's EAN code.
+ :type _ean_code: str
+ :param _avatar_attachment_uuid: An AttachmentPublic UUID that used as an
+ avatar for the TabItem.
+ :type _avatar_attachment_uuid: str
+ :param _tab_attachment: A list of AttachmentTab attached to the TabItem.
+ :type _tab_attachment: list[object_.AttachmentTab]
+ :param _quantity: The quantity of the TabItem.
+ :type _quantity: float
+ :param _amount: The money amount of the TabItem.
:type _amount: object_.Amount
- :param _fraction: The percentage of the triggering payment's amount to
- allocate.
- :type _fraction: float
- :param _id_: The id of the PaymentAutoAllocateDefinition.
+ :param _id_: The id of the created TabItem.
:type _id_: int
- :param _created: The timestamp when the PaymentAutoAllocateDefinition was
- created.
- :type _created: str
- :param _updated: The timestamp when the PaymentAutoAllocateDefinition was
- last updated.
- :type _updated: str
+ :param _avatar_attachment: A struct with an AttachmentPublic UUID that used
+ as an avatar for the TabItem.
+ :type _avatar_attachment: object_.AttachmentPublic
"""
# Endpoint constants.
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/payment-auto-allocate/{}/definition"
+ _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/cash-register/{}/tab/{}/tab-item"
+ _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/cash-register/{}/tab/{}/tab-item/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/cash-register/{}/tab/{}/tab-item/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/cash-register/{}/tab/{}/tab-item"
+ _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/cash-register/{}/tab/{}/tab-item/{}"
# Field constants.
- FIELD_TYPE = "type"
- FIELD_COUNTERPARTY_ALIAS = "counterparty_alias"
FIELD_DESCRIPTION = "description"
+ FIELD_EAN_CODE = "ean_code"
+ FIELD_AVATAR_ATTACHMENT_UUID = "avatar_attachment_uuid"
+ FIELD_TAB_ATTACHMENT = "tab_attachment"
+ FIELD_QUANTITY = "quantity"
FIELD_AMOUNT = "amount"
- FIELD_FRACTION = "fraction"
# Object type.
- _OBJECT_TYPE_GET = "PaymentAutoAllocateDefinition"
+ _OBJECT_TYPE_GET = "TabItem"
+
+ _id_ = None
+ _description = None
+ _ean_code = None
+ _avatar_attachment = None
+ _tab_attachment = None
+ _quantity = None
+ _amount = None
+ _description_field_for_request = None
+ _ean_code_field_for_request = None
+ _avatar_attachment_uuid_field_for_request = None
+ _tab_attachment_field_for_request = None
+ _quantity_field_for_request = None
+ _amount_field_for_request = None
+
+ def __init__(self, description=None, ean_code=None, avatar_attachment_uuid=None, tab_attachment=None, quantity=None,
+ amount=None):
+ """
+ :param description: The TabItem's brief description. Can't be empty and must
+ be no longer than 100 characters
+ :type description: str
+ :param ean_code: The TabItem's EAN code.
+ :type ean_code: str
+ :param avatar_attachment_uuid: An AttachmentPublic UUID that used as an
+ avatar for the TabItem.
+ :type avatar_attachment_uuid: str
+ :param tab_attachment: A list of AttachmentTab attached to the TabItem.
+ :type tab_attachment: list[int]
+ :param quantity: The quantity of the TabItem. Formatted as a number
+ containing up to 15 digits, up to 15 decimals and using a dot.
+ :type quantity: str
+ :param amount: The money amount of the TabItem. Will not change the value of
+ the corresponding Tab.
+ :type amount: object_.Amount
+ """
+
+ self._description_field_for_request = description
+ self._ean_code_field_for_request = ean_code
+ self._avatar_attachment_uuid_field_for_request = avatar_attachment_uuid
+ self._tab_attachment_field_for_request = tab_attachment
+ self._quantity_field_for_request = quantity
+ self._amount_field_for_request = amount
+
+ @classmethod
+ def create(cls, cash_register_id, tab_uuid, description, monetary_account_id=None, ean_code=None,
+ avatar_attachment_uuid=None, tab_attachment=None, quantity=None, amount=None, custom_headers=None):
+ """
+ Create a new TabItem for a given Tab.
+
+ :type user_id: int
+ :type monetary_account_id: int
+ :type cash_register_id: int
+ :type tab_uuid: str
+ :param description: The TabItem's brief description. Can't be empty and
+ must be no longer than 100 characters
+ :type description: str
+ :param ean_code: The TabItem's EAN code.
+ :type ean_code: str
+ :param avatar_attachment_uuid: An AttachmentPublic UUID that used as an
+ avatar for the TabItem.
+ :type avatar_attachment_uuid: str
+ :param tab_attachment: A list of AttachmentTab attached to the TabItem.
+ :type tab_attachment: list[int]
+ :param quantity: The quantity of the TabItem. Formatted as a number
+ containing up to 15 digits, up to 15 decimals and using a dot.
+ :type quantity: str
+ :param amount: The money amount of the TabItem. Will not change the
+ value of the corresponding Tab.
+ :type amount: object_.Amount
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ request_map = {
+ cls.FIELD_DESCRIPTION: description,
+ cls.FIELD_EAN_CODE: ean_code,
+ cls.FIELD_AVATAR_ATTACHMENT_UUID: avatar_attachment_uuid,
+ cls.FIELD_TAB_ATTACHMENT: tab_attachment,
+ cls.FIELD_QUANTITY: quantity,
+ cls.FIELD_AMOUNT: amount
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ api_client = ApiClient(cls._get_api_context())
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ cash_register_id, tab_uuid)
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
+
+ @classmethod
+ def update(cls, cash_register_id, tab_uuid, tab_item_shop_id, monetary_account_id=None, description=None,
+ ean_code=None, avatar_attachment_uuid=None, tab_attachment=None, quantity=None, amount=None,
+ custom_headers=None):
+ """
+ Modify a TabItem from a given Tab.
+
+ :type user_id: int
+ :type monetary_account_id: int
+ :type cash_register_id: int
+ :type tab_uuid: str
+ :type tab_item_shop_id: int
+ :param description: The TabItem's brief description. Can't be empty and
+ must be no longer than 100 characters
+ :type description: str
+ :param ean_code: The TabItem's EAN code.
+ :type ean_code: str
+ :param avatar_attachment_uuid: An AttachmentPublic UUID that used as an
+ avatar for the TabItem.
+ :type avatar_attachment_uuid: str
+ :param tab_attachment: A list of AttachmentTab attached to the TabItem.
+ :type tab_attachment: list[int]
+ :param quantity: The quantity of the TabItem. Formatted as a number
+ containing up to 15 digits, up to 15 decimals and using a dot.
+ :type quantity: str
+ :param amount: The money amount of the TabItem. Will not change the
+ value of the corresponding Tab.
+ :type amount: object_.Amount
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+
+ request_map = {
+ cls.FIELD_DESCRIPTION: description,
+ cls.FIELD_EAN_CODE: ean_code,
+ cls.FIELD_AVATAR_ATTACHMENT_UUID: avatar_attachment_uuid,
+ cls.FIELD_TAB_ATTACHMENT: tab_attachment,
+ cls.FIELD_QUANTITY: quantity,
+ cls.FIELD_AMOUNT: amount
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ cash_register_id, tab_uuid, tab_item_shop_id)
+ response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
- _id_ = None
- _created = None
- _updated = None
- _counterparty_alias = None
- _description = None
- _amount = None
- _fraction = None
- _type__field_for_request = None
- _counterparty_alias_field_for_request = None
- _description_field_for_request = None
- _amount_field_for_request = None
- _fraction_field_for_request = None
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
- def __init__(self, type_=None, counterparty_alias=None, description=None, amount=None, fraction=None):
+ @classmethod
+ def delete(cls, cash_register_id, tab_uuid, tab_item_shop_id, monetary_account_id=None, custom_headers=None):
"""
- :param type_: The type of definition.
- :type type_: str
- :param counterparty_alias: The alias of the party we are allocating the
- money to.
- :type counterparty_alias: object_.Pointer
- :param description: The description for the payment.
- :type description: str
- :param amount: The amount to allocate.
- :type amount: object_.Amount
- :param fraction: The percentage of the triggering payment's amount to
- allocate.
- :type fraction: float
+ Delete a specific TabItem from a Tab.
+
+ :type user_id: int
+ :type monetary_account_id: int
+ :type cash_register_id: int
+ :type tab_uuid: str
+ :type tab_item_shop_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseNone
"""
- self._type__field_for_request = type_
- self._counterparty_alias_field_for_request = counterparty_alias
- self._description_field_for_request = description
- self._amount_field_for_request = amount
- self._fraction_field_for_request = fraction
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ cash_register_id, tab_uuid, tab_item_shop_id)
+ response_raw = api_client.delete(endpoint_url, custom_headers)
+
+ return BunqResponseNone.cast_from_bunq_response(
+ BunqResponse(None, response_raw.headers)
+ )
@classmethod
- def list(cls, payment_auto_allocate_id, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, cash_register_id, tab_uuid, monetary_account_id=None, params=None, custom_headers=None):
"""
+ Get a collection of TabItems from a given Tab.
+
:type user_id: int
:type monetary_account_id: int
- :type payment_auto_allocate_id: int
+ :type cash_register_id: int
+ :type tab_uuid: str
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponsePaymentAutoAllocateDefinitionList
+ :rtype: BunqResponseTabItemShopList
"""
if params is None:
@@ -32629,13 +34996,42 @@ def list(cls, payment_auto_allocate_id, monetary_account_id=None, params=None, c
api_client = ApiClient(cls._get_api_context())
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
cls._determine_monetary_account_id(monetary_account_id),
- payment_auto_allocate_id)
+ cash_register_id, tab_uuid)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponsePaymentAutoAllocateDefinitionList.cast_from_bunq_response(
+ return BunqResponseTabItemShopList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
+ @classmethod
+ def get(cls, cash_register_id, tab_uuid, tab_item_shop_id, monetary_account_id=None, custom_headers=None):
+ """
+ Get a specific TabItem from a given Tab.
+
+ :type api_context: ApiContext
+ :type user_id: int
+ :type monetary_account_id: int
+ :type cash_register_id: int
+ :type tab_uuid: str
+ :type tab_item_shop_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseTabItemShop
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ cash_register_id, tab_uuid, tab_item_shop_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponseTabItemShop.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
@property
def id_(self):
"""
@@ -32645,52 +35041,52 @@ def id_(self):
return self._id_
@property
- def created(self):
+ def description(self):
"""
:rtype: str
"""
- return self._created
+ return self._description
@property
- def updated(self):
+ def ean_code(self):
"""
:rtype: str
"""
- return self._updated
+ return self._ean_code
@property
- def counterparty_alias(self):
+ def avatar_attachment(self):
"""
- :rtype: object_.MonetaryAccountReference
+ :rtype: object_.AttachmentPublic
"""
- return self._counterparty_alias
+ return self._avatar_attachment
@property
- def description(self):
+ def tab_attachment(self):
"""
- :rtype: str
+ :rtype: list[object_.AttachmentTab]
"""
- return self._description
+ return self._tab_attachment
@property
- def amount(self):
+ def quantity(self):
"""
- :rtype: object_.Amount
+ :rtype: float
"""
- return self._amount
+ return self._quantity
@property
- def fraction(self):
+ def amount(self):
"""
- :rtype: float
+ :rtype: object_.Amount
"""
- return self._fraction
+ return self._amount
def is_all_field_none(self):
"""
@@ -32700,22 +35096,22 @@ def is_all_field_none(self):
if self._id_ is not None:
return False
- if self._created is not None:
+ if self._description is not None:
return False
- if self._updated is not None:
+ if self._ean_code is not None:
return False
- if self._counterparty_alias is not None:
+ if self._avatar_attachment is not None:
return False
- if self._description is not None:
+ if self._tab_attachment is not None:
return False
- if self._amount is not None:
+ if self._quantity is not None:
return False
- if self._fraction is not None:
+ if self._amount is not None:
return False
return True
@@ -32725,283 +35121,367 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: PaymentAutoAllocateDefinition
+ :rtype: TabItemShop
"""
- return converter.json_to_class(PaymentAutoAllocateDefinition, json_str)
+ return converter.json_to_class(TabItemShop, json_str)
-class PaymentAutoAllocate(BunqModel):
+class TabQrCodeContent(BunqModel):
"""
- Manage a users automatic payment auto allocated settings.
+ This call returns the raw content of the QR code that links to this Tab.
+ When a bunq user scans this QR code with the bunq app the Tab will be shown
+ on his/her device.
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/cash-register/{}/tab/{}/qr-code-content"
+
+ # Object type.
+ _OBJECT_TYPE_GET = "TabQrCodeContent"
+
+ @classmethod
+ def list(cls, cash_register_id, tab_uuid, monetary_account_id=None, custom_headers=None):
+ """
+ Returns the raw content of the QR code that links to this Tab. The raw
+ content is the binary representation of a file, without any JSON
+ wrapping.
+
+ :type user_id: int
+ :type monetary_account_id: int
+ :type cash_register_id: int
+ :type tab_uuid: str
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseBytes
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
+ cls._determine_monetary_account_id(monetary_account_id),
+ cash_register_id, tab_uuid)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponseBytes.cast_from_bunq_response(
+ BunqResponse(response_raw.body_bytes, response_raw.headers)
+ )
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: TabQrCodeContent
+ """
+
+ return converter.json_to_class(TabQrCodeContent, json_str)
+
+
+class TokenQrRequestIdeal(BunqModel):
+ """
+ Using this call you create a request for payment from an external token
+ provided with an ideal transaction. Make sure your iDEAL payments are
+ compliant with the iDEAL standards, by following the following manual:
+ https://www.bunq.com/terms-idealstandards. It's very important to keep these
+ points in mind when you are using the endpoint to make iDEAL payments from
+ your application.
- :param _payment_id: The payment that should be used to define the triggers
- for the payment auto allocate.
- :type _payment_id: int
- :param _type_: The type.
- :type _type_: str
- :param _definition: The definition of how the money should be allocated.
- :type _definition: list[PaymentAutoAllocateDefinition]
- :param _id_: The id of the PaymentAutoAllocate.
+ :param _token: The token passed from a site or read from a QR code.
+ :type _token: str
+ :param _id_: The id of the RequestResponse.
:type _id_: int
- :param _created: The timestamp when the PaymentAutoAllocate was created.
- :type _created: str
- :param _updated: The timestamp when the PaymentAutoAllocate was last
- updated.
- :type _updated: str
- :param _status: The status.
+ :param _time_responded: The timestamp of when the RequestResponse was
+ responded to.
+ :type _time_responded: str
+ :param _time_expiry: The timestamp of when the RequestResponse expired or
+ will expire.
+ :type _time_expiry: str
+ :param _monetary_account_id: The id of the MonetaryAccount the
+ RequestResponse was received on.
+ :type _monetary_account_id: int
+ :param _amount_inquired: The requested Amount.
+ :type _amount_inquired: object_.Amount
+ :param _amount_responded: The Amount the RequestResponse was accepted with.
+ :type _amount_responded: object_.Amount
+ :param _alias: The LabelMonetaryAccount with the public information of the
+ MonetaryAccount this RequestResponse was received on.
+ :type _alias: object_.MonetaryAccountReference
+ :param _counterparty_alias: The LabelMonetaryAccount with the public
+ information of the MonetaryAccount that is requesting money with this
+ RequestResponse.
+ :type _counterparty_alias: object_.MonetaryAccountReference
+ :param _description: The description for the RequestResponse provided by the
+ requesting party. Maximum 9000 characters.
+ :type _description: str
+ :param _attachment: The Attachments attached to the RequestResponse.
+ :type _attachment: list[object_.Attachment]
+ :param _status: The status of the created RequestResponse. Can only be
+ PENDING.
:type _status: str
- :param _trigger_amount: The amount on which this payment auto allocate will
- be triggered.
- :type _trigger_amount: object_.Amount
- :param _payment: The payment that was used to define the triggers for this
- payment auto allocate.
- :type _payment: Payment
+ :param _minimum_age: The minimum age the user accepting the RequestResponse
+ must have.
+ :type _minimum_age: int
+ :param _require_address: Whether or not an address must be provided on
+ accept.
+ :type _require_address: str
+ :param _address_shipping: The shipping address provided by the accepting
+ user if an address was requested.
+ :type _address_shipping: object_.Address
+ :param _address_billing: The billing address provided by the accepting user
+ if an address was requested.
+ :type _address_billing: object_.Address
+ :param _geolocation: The Geolocation where the RequestResponse was created.
+ :type _geolocation: object_.Geolocation
+ :param _redirect_url: The URL which the user is sent to after accepting or
+ rejecting the Request.
+ :type _redirect_url: str
+ :param _type_: The type of the RequestResponse. Can be only be IDEAL.
+ :type _type_: str
+ :param _sub_type: The subtype of the RequestResponse. Can be only be NONE.
+ :type _sub_type: str
+ :param _eligible_whitelist_id: The whitelist id for this action or null.
+ :type _eligible_whitelist_id: int
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/payment-auto-allocate"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/payment-auto-allocate/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/payment-auto-allocate"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/payment-auto-allocate/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/payment-auto-allocate/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/token-qr-request-ideal"
# Field constants.
- FIELD_PAYMENT_ID = "payment_id"
- FIELD_TYPE = "type"
- FIELD_DEFINITION = "definition"
+ FIELD_TOKEN = "token"
# Object type.
- _OBJECT_TYPE_GET = "PaymentAutoAllocate"
+ _OBJECT_TYPE_POST = "RequestResponse"
_id_ = None
- _created = None
- _updated = None
- _type_ = None
+ _time_responded = None
+ _time_expiry = None
+ _monetary_account_id = None
+ _amount_inquired = None
+ _amount_responded = None
+ _alias = None
+ _counterparty_alias = None
+ _description = None
+ _attachment = None
_status = None
- _trigger_amount = None
- _payment = None
- _payment_id_field_for_request = None
- _type__field_for_request = None
- _definition_field_for_request = None
+ _minimum_age = None
+ _require_address = None
+ _address_shipping = None
+ _address_billing = None
+ _geolocation = None
+ _redirect_url = None
+ _type_ = None
+ _sub_type = None
+ _eligible_whitelist_id = None
+ _token_field_for_request = None
- def __init__(self, payment_id, type_, definition=None):
+ def __init__(self, token):
"""
- :param payment_id: The payment that should be used to define the triggers
- for the payment auto allocate.
- :type payment_id: int
- :param type_: Whether a payment should be sorted ONCE or RECURRING.
- :type type_: str
- :param definition: The definition of how the money should be allocated.
- :type definition: list[PaymentAutoAllocateDefinition]
+ :param token: The token passed from a site or read from a QR code.
+ :type token: str
"""
- self._payment_id_field_for_request = payment_id
- self._type__field_for_request = type_
- self._definition_field_for_request = definition
+ self._token_field_for_request = token
@classmethod
- def create(cls, payment_id, type_, definition, monetary_account_id=None, custom_headers=None):
+ def create(cls, token, custom_headers=None):
"""
+ Create a request from an ideal transaction.
+
:type user_id: int
- :type monetary_account_id: int
- :param payment_id: The payment that should be used to define the
- triggers for the payment auto allocate.
- :type payment_id: int
- :param type_: Whether a payment should be sorted ONCE or RECURRING.
- :type type_: str
- :param definition: The definition of how the money should be allocated.
- :type definition: list[PaymentAutoAllocateDefinition]
+ :param token: The token passed from a site or read from a QR code.
+ :type token: str
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseInt
+ :rtype: BunqResponseTokenQrRequestIdeal
"""
if custom_headers is None:
custom_headers = {}
request_map = {
- cls.FIELD_PAYMENT_ID: payment_id,
- cls.FIELD_TYPE: type_,
- cls.FIELD_DEFINITION: definition
+ cls.FIELD_TOKEN: token
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
api_client = ApiClient(cls._get_api_context())
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
+ return BunqResponseTokenQrRequestIdeal.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_POST)
)
- @classmethod
- def get(cls, payment_auto_allocate_id, monetary_account_id=None, custom_headers=None):
+ @property
+ def id_(self):
"""
- :type api_context: ApiContext
- :type user_id: int
- :type monetary_account_id: int
- :type payment_auto_allocate_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponsePaymentAutoAllocate
+ :rtype: int
"""
- if custom_headers is None:
- custom_headers = {}
+ return self._id_
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- payment_auto_allocate_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
+ @property
+ def time_responded(self):
+ """
+ :rtype: str
+ """
- return BunqResponsePaymentAutoAllocate.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
- )
+ return self._time_responded
- @classmethod
- def list(cls, monetary_account_id=None, params=None, custom_headers=None):
+ @property
+ def time_expiry(self):
"""
- :type user_id: int
- :type monetary_account_id: int
- :type params: dict[str, str]|None
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponsePaymentAutoAllocateList
+ :rtype: str
"""
- if params is None:
- params = {}
+ return self._time_expiry
- if custom_headers is None:
- custom_headers = {}
+ @property
+ def monetary_account_id(self):
+ """
+ :rtype: int
+ """
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id))
- response_raw = api_client.get(endpoint_url, params, custom_headers)
+ return self._monetary_account_id
- return BunqResponsePaymentAutoAllocateList.cast_from_bunq_response(
- cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
- )
+ @property
+ def amount_inquired(self):
+ """
+ :rtype: object_.Amount
+ """
- @classmethod
- def update(cls, payment_auto_allocate_id, monetary_account_id=None, definition=None, custom_headers=None):
+ return self._amount_inquired
+
+ @property
+ def amount_responded(self):
"""
- :type user_id: int
- :type monetary_account_id: int
- :type payment_auto_allocate_id: int
- :param definition: The definition of how the money should be allocated.
- :type definition: list[PaymentAutoAllocateDefinition]
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseInt
+ :rtype: object_.Amount
"""
- if custom_headers is None:
- custom_headers = {}
+ return self._amount_responded
- api_client = ApiClient(cls._get_api_context())
+ @property
+ def alias(self):
+ """
+ :rtype: object_.MonetaryAccountReference
+ """
- request_map = {
- cls.FIELD_DEFINITION: definition
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
+ return self._alias
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- payment_auto_allocate_id)
- response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+ @property
+ def counterparty_alias(self):
+ """
+ :rtype: object_.MonetaryAccountReference
+ """
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
- )
+ return self._counterparty_alias
- @classmethod
- def delete(cls, payment_auto_allocate_id, monetary_account_id=None, custom_headers=None):
+ @property
+ def description(self):
"""
- :type user_id: int
- :type monetary_account_id: int
- :type payment_auto_allocate_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseNone
+ :rtype: str
"""
- if custom_headers is None:
- custom_headers = {}
+ return self._description
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- payment_auto_allocate_id)
- response_raw = api_client.delete(endpoint_url, custom_headers)
+ @property
+ def attachment(self):
+ """
+ :rtype: list[object_.Attachment]
+ """
- return BunqResponseNone.cast_from_bunq_response(
- BunqResponse(None, response_raw.headers)
- )
+ return self._attachment
+
+ @property
+ def status(self):
+ """
+ :rtype: str
+ """
+
+ return self._status
@property
- def id_(self):
+ def minimum_age(self):
"""
:rtype: int
"""
- return self._id_
+ return self._minimum_age
@property
- def created(self):
+ def require_address(self):
"""
:rtype: str
"""
- return self._created
+ return self._require_address
@property
- def updated(self):
+ def address_shipping(self):
"""
- :rtype: str
+ :rtype: object_.Address
"""
- return self._updated
+ return self._address_shipping
@property
- def type_(self):
+ def address_billing(self):
+ """
+ :rtype: object_.Address
+ """
+
+ return self._address_billing
+
+ @property
+ def geolocation(self):
+ """
+ :rtype: object_.Geolocation
+ """
+
+ return self._geolocation
+
+ @property
+ def redirect_url(self):
"""
:rtype: str
"""
- return self._type_
+ return self._redirect_url
@property
- def status(self):
+ def type_(self):
"""
:rtype: str
"""
- return self._status
+ return self._type_
@property
- def trigger_amount(self):
+ def sub_type(self):
"""
- :rtype: object_.Amount
+ :rtype: str
"""
- return self._trigger_amount
+ return self._sub_type
@property
- def payment(self):
+ def eligible_whitelist_id(self):
"""
- :rtype: Payment
+ :rtype: int
"""
- return self._payment
+ return self._eligible_whitelist_id
def is_all_field_none(self):
"""
@@ -33011,22 +35491,61 @@ def is_all_field_none(self):
if self._id_ is not None:
return False
- if self._created is not None:
+ if self._time_responded is not None:
return False
- if self._updated is not None:
+ if self._time_expiry is not None:
return False
- if self._type_ is not None:
+ if self._monetary_account_id is not None:
+ return False
+
+ if self._amount_inquired is not None:
+ return False
+
+ if self._amount_responded is not None:
+ return False
+
+ if self._alias is not None:
+ return False
+
+ if self._counterparty_alias is not None:
+ return False
+
+ if self._description is not None:
+ return False
+
+ if self._attachment is not None:
return False
if self._status is not None:
return False
- if self._trigger_amount is not None:
+ if self._minimum_age is not None:
return False
- if self._payment is not None:
+ if self._require_address is not None:
+ return False
+
+ if self._address_shipping is not None:
+ return False
+
+ if self._address_billing is not None:
+ return False
+
+ if self._geolocation is not None:
+ return False
+
+ if self._redirect_url is not None:
+ return False
+
+ if self._type_ is not None:
+ return False
+
+ if self._sub_type is not None:
+ return False
+
+ if self._eligible_whitelist_id is not None:
return False
return True
@@ -33036,82 +35555,76 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: PaymentAutoAllocate
+ :rtype: TokenQrRequestIdeal
"""
- return converter.json_to_class(PaymentAutoAllocate, json_str)
+ return converter.json_to_class(TokenQrRequestIdeal, json_str)
-class PaymentAutoAllocateUser(BunqModel, AnchorObjectInterface):
+class TokenQrRequestSofort(BunqModel):
"""
- List a users automatic payment auto allocated settings.
+ Using this call you can create a SOFORT Request assigned to your User by
+ providing the Token of the request.
- :param _PaymentAutoAllocate:
- :type _PaymentAutoAllocate: PaymentAutoAllocate
+ :param _token: The token passed from a site or read from a QR code.
+ :type _token: str
"""
- # Error constants.
- _ERROR_NULL_FIELDS = "All fields of an extended model or object are null."
-
# Endpoint constants.
- _ENDPOINT_URL_LISTING = "user/{}/payment-auto-allocate"
+ _ENDPOINT_URL_CREATE = "user/{}/token-qr-request-sofort"
+
+ # Field constants.
+ FIELD_TOKEN = "token"
# Object type.
- _OBJECT_TYPE_GET = "PaymentAutoAllocate"
+ _OBJECT_TYPE_POST = "RequestResponse"
- _PaymentAutoAllocate = None
+ _token_field_for_request = None
+
+ def __init__(self, token):
+ """
+ :param token: The token passed from a site or read from a QR code.
+ :type token: str
+ """
+
+ self._token_field_for_request = token
@classmethod
- def list(cls, params=None, custom_headers=None):
+ def create(cls, token, custom_headers=None):
"""
+ Create a request from an SOFORT transaction.
+
:type user_id: int
- :type params: dict[str, str]|None
+ :param token: The token passed from a site or read from a QR code.
+ :type token: str
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponsePaymentAutoAllocateUserList
+ :rtype: BunqResponseTokenQrRequestSofort
"""
- if params is None:
- params = {}
-
if custom_headers is None:
custom_headers = {}
+ request_map = {
+ cls.FIELD_TOKEN: token
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
- response_raw = api_client.get(endpoint_url, params, custom_headers)
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
- return BunqResponsePaymentAutoAllocateUserList.cast_from_bunq_response(
- cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ return BunqResponseTokenQrRequestSofort.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_POST)
)
- @property
- def PaymentAutoAllocate(self):
- """
- :rtype: PaymentAutoAllocate
- """
-
- return self._PaymentAutoAllocate
-
- def get_referenced_object(self):
- """
- :rtype: BunqModel
- :raise: BunqException
- """
-
- if self._PaymentAutoAllocate is not None:
- return self._PaymentAutoAllocate
-
- raise BunqException(self._ERROR_NULL_FIELDS)
-
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._PaymentAutoAllocate is not None:
- return False
-
return True
@staticmethod
@@ -33119,230 +35632,263 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: PaymentAutoAllocateUser
+ :rtype: TokenQrRequestSofort
"""
- return converter.json_to_class(PaymentAutoAllocateUser, json_str)
+ return converter.json_to_class(TokenQrRequestSofort, json_str)
-class PaymentServiceProviderCredential(BunqModel):
+class TransferwiseAccountQuote(BunqModel):
"""
- Register a Payment Service Provider and provide credentials
+ Used to manage recipient accounts with Transferwise.
- :param _client_payment_service_provider_certificate: Payment Services
- Directive 2 compatible QSEAL certificate
- :type _client_payment_service_provider_certificate: str
- :param _client_payment_service_provider_certificate_chain: Intermediate and
- root certificate belonging to the provided certificate.
- :type _client_payment_service_provider_certificate_chain: str
- :param _client_public_key_signature: The Base64 encoded signature of the
- public key provided during installation and with the installation token
- appended as a nonce. Signed with the private key belonging to the QSEAL
- certificate.
- :type _client_public_key_signature: str
- :param _id_: The id of the credential.
- :type _id_: int
- :param _created: The timestamp of the credential object's creation.
- :type _created: str
- :param _updated: The timestamp of the credential object's last update.
- :type _updated: str
- :param _status: The status of the credential.
- :type _status: str
- :param _expiry_time: When the status is PENDING_FIRST_USE: when the
- credential expires.
- :type _expiry_time: str
- :param _token_value: When the status is PENDING_FIRST_USE: the value of the
- token.
- :type _token_value: str
- :param _permitted_device: When the status is ACTIVE: the details of the
- device that may use the credential.
- :type _permitted_device: object_.PermittedDevice
+ :param _country: The country of the account.
+ :type _country: str
+ :param _name_account_holder: The name of the account holder.
+ :type _name_account_holder: str
+ :param _type_: The chosen recipient account type. The possible options are
+ provided dynamically in the response endpoint.
+ :type _type_: str
+ :param _detail: The fields which were specified as "required" and have since
+ been filled by the user. Always provide the full list.
+ :type _detail: list[object_.TransferwiseRequirementField]
+ :param _account_id: Transferwise's id of the account.
+ :type _account_id: str
+ :param _currency: The currency the account.
+ :type _currency: str
+ :param _account_number: The account number.
+ :type _account_number: str
+ :param _bank_code: The bank code.
+ :type _bank_code: str
"""
# Endpoint constants.
- _ENDPOINT_URL_READ = "payment-service-provider-credential/{}"
- _ENDPOINT_URL_CREATE = "payment-service-provider-credential"
+ _ENDPOINT_URL_CREATE = "user/{}/transferwise-quote/{}/transferwise-recipient"
+ _ENDPOINT_URL_READ = "user/{}/transferwise-quote/{}/transferwise-recipient/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/transferwise-quote/{}/transferwise-recipient"
+ _ENDPOINT_URL_DELETE = "user/{}/transferwise-quote/{}/transferwise-recipient/{}"
# Field constants.
- FIELD_CLIENT_PAYMENT_SERVICE_PROVIDER_CERTIFICATE = "client_payment_service_provider_certificate"
- FIELD_CLIENT_PAYMENT_SERVICE_PROVIDER_CERTIFICATE_CHAIN = "client_payment_service_provider_certificate_chain"
- FIELD_CLIENT_PUBLIC_KEY_SIGNATURE = "client_public_key_signature"
+ FIELD_COUNTRY = "country"
+ FIELD_NAME_ACCOUNT_HOLDER = "name_account_holder"
+ FIELD_TYPE = "type"
+ FIELD_DETAIL = "detail"
# Object type.
- _OBJECT_TYPE_GET = "CredentialPasswordIp"
+ _OBJECT_TYPE_GET = "TransferwiseRecipient"
- _id_ = None
- _created = None
- _updated = None
- _status = None
- _expiry_time = None
- _token_value = None
- _permitted_device = None
- _client_payment_service_provider_certificate_field_for_request = None
- _client_payment_service_provider_certificate_chain_field_for_request = None
- _client_public_key_signature_field_for_request = None
+ _account_id = None
+ _currency = None
+ _country = None
+ _name_account_holder = None
+ _account_number = None
+ _bank_code = None
+ _country_field_for_request = None
+ _name_account_holder_field_for_request = None
+ _type__field_for_request = None
+ _detail_field_for_request = None
- def __init__(self, client_payment_service_provider_certificate, client_payment_service_provider_certificate_chain,
- client_public_key_signature):
+ def __init__(self, name_account_holder, type_, country=None, detail=None):
"""
- :param client_payment_service_provider_certificate: Payment Services
- Directive 2 compatible QSEAL certificate
- :type client_payment_service_provider_certificate: str
- :param client_payment_service_provider_certificate_chain: Intermediate and
- root certificate belonging to the provided certificate.
- :type client_payment_service_provider_certificate_chain: str
- :param client_public_key_signature: The Base64 encoded signature of the
- public key provided during installation and with the installation token
- appended as a nonce. Signed with the private key belonging to the QSEAL
- certificate.
- :type client_public_key_signature: str
+ :param name_account_holder: The name of the account holder.
+ :type name_account_holder: str
+ :param type_: The chosen recipient account type. The possible options are
+ provided dynamically in the response endpoint.
+ :type type_: str
+ :param country: The country of the receiving account.
+ :type country: str
+ :param detail: The fields which were specified as "required" and have since
+ been filled by the user. Always provide the full list.
+ :type detail: list[object_.TransferwiseRequirementField]
"""
- self._client_payment_service_provider_certificate_field_for_request = client_payment_service_provider_certificate
- self._client_payment_service_provider_certificate_chain_field_for_request = client_payment_service_provider_certificate_chain
- self._client_public_key_signature_field_for_request = client_public_key_signature
+ self._name_account_holder_field_for_request = name_account_holder
+ self._type__field_for_request = type_
+ self._country_field_for_request = country
+ self._detail_field_for_request = detail
@classmethod
- def get(cls, payment_service_provider_credential_id, custom_headers=None):
+ def create(cls, transferwise_quote_id, name_account_holder, type_, country=None, detail=None, custom_headers=None):
+ """
+ :type user_id: int
+ :type transferwise_quote_id: int
+ :param name_account_holder: The name of the account holder.
+ :type name_account_holder: str
+ :param type_: The chosen recipient account type. The possible options
+ are provided dynamically in the response endpoint.
+ :type type_: str
+ :param country: The country of the receiving account.
+ :type country: str
+ :param detail: The fields which were specified as "required" and have
+ since been filled by the user. Always provide the full list.
+ :type detail: list[object_.TransferwiseRequirementField]
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ request_map = {
+ cls.FIELD_COUNTRY: country,
+ cls.FIELD_NAME_ACCOUNT_HOLDER: name_account_holder,
+ cls.FIELD_TYPE: type_,
+ cls.FIELD_DETAIL: detail
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ api_client = ApiClient(cls._get_api_context())
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(), transferwise_quote_id)
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
+
+ @classmethod
+ def get(cls, transferwise_quote_id, transferwise_account_quote_id, custom_headers=None):
"""
:type api_context: ApiContext
- :type payment_service_provider_credential_id: int
+ :type user_id: int
+ :type transferwise_quote_id: int
+ :type transferwise_account_quote_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponsePaymentServiceProviderCredential
+ :rtype: BunqResponseTransferwiseAccountQuote
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(payment_service_provider_credential_id)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), transferwise_quote_id,
+ transferwise_account_quote_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponsePaymentServiceProviderCredential.cast_from_bunq_response(
+ return BunqResponseTransferwiseAccountQuote.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def create(cls, client_payment_service_provider_certificate, client_payment_service_provider_certificate_chain,
- client_public_key_signature, custom_headers=None):
+ def list(cls, transferwise_quote_id, params=None, custom_headers=None):
"""
- :param client_payment_service_provider_certificate: Payment Services
- Directive 2 compatible QSEAL certificate
- :type client_payment_service_provider_certificate: str
- :param client_payment_service_provider_certificate_chain: Intermediate
- and root certificate belonging to the provided certificate.
- :type client_payment_service_provider_certificate_chain: str
- :param client_public_key_signature: The Base64 encoded signature of the
- public key provided during installation and with the installation token
- appended as a nonce. Signed with the private key belonging to the QSEAL
- certificate.
- :type client_public_key_signature: str
+ :type user_id: int
+ :type transferwise_quote_id: int
+ :type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseInt
+ :rtype: BunqResponseTransferwiseAccountQuoteList
"""
+ if params is None:
+ params = {}
+
if custom_headers is None:
custom_headers = {}
- request_map = {
- cls.FIELD_CLIENT_PAYMENT_SERVICE_PROVIDER_CERTIFICATE: client_payment_service_provider_certificate,
- cls.FIELD_CLIENT_PAYMENT_SERVICE_PROVIDER_CERTIFICATE_CHAIN: client_payment_service_provider_certificate_chain,
- cls.FIELD_CLIENT_PUBLIC_KEY_SIGNATURE: client_public_key_signature
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
-
api_client = ApiClient(cls._get_api_context())
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE
- response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(), transferwise_quote_id)
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
+ return BunqResponseTransferwiseAccountQuoteList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
- @property
- def id_(self):
+ @classmethod
+ def delete(cls, transferwise_quote_id, transferwise_account_quote_id, custom_headers=None):
"""
- :rtype: int
+ :type user_id: int
+ :type transferwise_quote_id: int
+ :type transferwise_account_quote_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseNone
"""
- return self._id_
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(), transferwise_quote_id,
+ transferwise_account_quote_id)
+ response_raw = api_client.delete(endpoint_url, custom_headers)
+
+ return BunqResponseNone.cast_from_bunq_response(
+ BunqResponse(None, response_raw.headers)
+ )
@property
- def created(self):
+ def account_id(self):
"""
:rtype: str
"""
- return self._created
+ return self._account_id
@property
- def updated(self):
+ def currency(self):
"""
:rtype: str
"""
- return self._updated
+ return self._currency
@property
- def status(self):
+ def country(self):
"""
:rtype: str
"""
- return self._status
+ return self._country
@property
- def expiry_time(self):
+ def name_account_holder(self):
"""
:rtype: str
"""
- return self._expiry_time
+ return self._name_account_holder
@property
- def token_value(self):
+ def account_number(self):
"""
:rtype: str
"""
- return self._token_value
+ return self._account_number
@property
- def permitted_device(self):
+ def bank_code(self):
"""
- :rtype: object_.PermittedDevice
+ :rtype: str
"""
- return self._permitted_device
+ return self._bank_code
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._id_ is not None:
- return False
-
- if self._created is not None:
+ if self._account_id is not None:
return False
- if self._updated is not None:
+ if self._currency is not None:
return False
- if self._status is not None:
+ if self._country is not None:
return False
- if self._expiry_time is not None:
+ if self._name_account_holder is not None:
return False
- if self._token_value is not None:
+ if self._account_number is not None:
return False
- if self._permitted_device is not None:
+ if self._bank_code is not None:
return False
return True
@@ -33352,151 +35898,88 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: PaymentServiceProviderCredential
+ :rtype: TransferwiseAccountQuote
"""
- return converter.json_to_class(PaymentServiceProviderCredential, json_str)
+ return converter.json_to_class(TransferwiseAccountQuote, json_str)
-class PaymentServiceProviderDraftPayment(BunqModel):
+class TransferwiseAccountRequirement(BunqModel):
"""
- Manage the PaymentServiceProviderDraftPayment's for a PISP.
+ Used to determine the recipient account requirements for Transferwise
+ transfers.
- :param _sender_iban: The sender IBAN.
- :type _sender_iban: str
- :param _sender_name: The name of the sender.
- :type _sender_name: str
- :param _counterparty_iban: The IBAN of the counterparty.
- :type _counterparty_iban: str
- :param _counterparty_name: The name of the counterparty.
- :type _counterparty_name: str
- :param _description: Description of the payment.
- :type _description: str
- :param _amount: The amount of the draft payment
- :type _amount: object_.Amount
- :param _status: The status of the draft payment
- :type _status: str
- :param _receiver_iban: The sender IBAN.
- :type _receiver_iban: str
+ :param _country: The country of the receiving account.
+ :type _country: str
+ :param _name_account_holder: The name of the account holder.
+ :type _name_account_holder: str
+ :param _type_: A possible recipient account type.
+ :type _type_: str
+ :param _detail: The fields which were specified as "required" and have since
+ been filled by the user. Always provide the full list.
+ :type _detail: list[object_.TransferwiseRequirementField]
+ :param _label: The label of the possible recipient account type to show to
+ the user.
+ :type _label: str
+ :param _fields: The fields which the user needs to fill.
+ :type _fields: list[object_.TransferwiseRequirementField]
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/payment-service-provider-draft-payment"
- _ENDPOINT_URL_UPDATE = "user/{}/payment-service-provider-draft-payment/{}"
- _ENDPOINT_URL_LISTING = "user/{}/payment-service-provider-draft-payment"
- _ENDPOINT_URL_READ = "user/{}/payment-service-provider-draft-payment/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/transferwise-quote/{}/transferwise-recipient-requirement"
+ _ENDPOINT_URL_LISTING = "user/{}/transferwise-quote/{}/transferwise-recipient-requirement"
# Field constants.
- FIELD_SENDER_IBAN = "sender_iban"
- FIELD_SENDER_NAME = "sender_name"
- FIELD_COUNTERPARTY_IBAN = "counterparty_iban"
- FIELD_COUNTERPARTY_NAME = "counterparty_name"
- FIELD_DESCRIPTION = "description"
- FIELD_AMOUNT = "amount"
- FIELD_STATUS = "status"
+ FIELD_COUNTRY = "country"
+ FIELD_NAME_ACCOUNT_HOLDER = "name_account_holder"
+ FIELD_TYPE = "type"
+ FIELD_DETAIL = "detail"
# Object type.
- _OBJECT_TYPE_GET = "PaymentServiceProviderDraftPayment"
-
- _sender_iban = None
- _receiver_iban = None
- _amount = None
- _status = None
- _sender_iban_field_for_request = None
- _sender_name_field_for_request = None
- _counterparty_iban_field_for_request = None
- _counterparty_name_field_for_request = None
- _description_field_for_request = None
- _amount_field_for_request = None
- _status_field_for_request = None
-
- def __init__(self, sender_iban, counterparty_iban, counterparty_name, description, amount, sender_name=None,
- status=None):
- """
- :param sender_iban: The IBAN of the sender.
- :type sender_iban: str
- :param counterparty_iban: The IBAN of the counterparty.
- :type counterparty_iban: str
- :param counterparty_name: The name of the counterparty.
- :type counterparty_name: str
- :param description: Description of the payment.
- :type description: str
- :param amount: The Amount to transfer with the Payment. Must be bigger than
- 0.
- :type amount: object_.Amount
- :param sender_name: The name of the sender.
- :type sender_name: str
- :param status: The new status of the Draft Payment. Can only be set to
- REJECTED or CANCELLED by update.
- :type status: str
- """
+ _OBJECT_TYPE_GET = "TransferwiseRequirement"
- self._sender_iban_field_for_request = sender_iban
- self._counterparty_iban_field_for_request = counterparty_iban
- self._counterparty_name_field_for_request = counterparty_name
- self._description_field_for_request = description
- self._amount_field_for_request = amount
- self._sender_name_field_for_request = sender_name
- self._status_field_for_request = status
+ _type_ = None
+ _label = None
+ _fields = None
+ _country_field_for_request = None
+ _name_account_holder_field_for_request = None
+ _type__field_for_request = None
+ _detail_field_for_request = None
- @classmethod
- def create(cls, sender_iban, counterparty_iban, counterparty_name, description, amount, sender_name=None,
- status=None, custom_headers=None):
+ def __init__(self, name_account_holder, type_, country=None, detail=None):
"""
- :type user_id: int
- :param sender_iban: The IBAN of the sender.
- :type sender_iban: str
- :param counterparty_iban: The IBAN of the counterparty.
- :type counterparty_iban: str
- :param counterparty_name: The name of the counterparty.
- :type counterparty_name: str
- :param description: Description of the payment.
- :type description: str
- :param amount: The Amount to transfer with the Payment. Must be bigger
- than 0.
- :type amount: object_.Amount
- :param sender_name: The name of the sender.
- :type sender_name: str
- :param status: The new status of the Draft Payment. Can only be set to
- REJECTED or CANCELLED by update.
- :type status: str
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseInt
+ :param name_account_holder: The name of the account holder.
+ :type name_account_holder: str
+ :param type_: The chosen recipient account type. The possible options are
+ provided dynamically in the response endpoint.
+ :type type_: str
+ :param country: The country of the receiving account.
+ :type country: str
+ :param detail: The fields which were specified as "required" and have since
+ been filled by the user. Always provide the full list.
+ :type detail: list[object_.TransferwiseRequirementField]
"""
- if custom_headers is None:
- custom_headers = {}
-
- request_map = {
- cls.FIELD_SENDER_IBAN: sender_iban,
- cls.FIELD_SENDER_NAME: sender_name,
- cls.FIELD_COUNTERPARTY_IBAN: counterparty_iban,
- cls.FIELD_COUNTERPARTY_NAME: counterparty_name,
- cls.FIELD_DESCRIPTION: description,
- cls.FIELD_AMOUNT: amount,
- cls.FIELD_STATUS: status
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
-
- api_client = ApiClient(cls._get_api_context())
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
- response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
-
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
- )
+ self._name_account_holder_field_for_request = name_account_holder
+ self._type__field_for_request = type_
+ self._country_field_for_request = country
+ self._detail_field_for_request = detail
@classmethod
- def update(cls, payment_service_provider_draft_payment_id, status=None, custom_headers=None):
+ def create(cls, transferwise_quote_id, name_account_holder, type_, country=None, detail=None, custom_headers=None):
"""
- :type user_id: int
- :type payment_service_provider_draft_payment_id: int
- :param status: The new status of the Draft Payment. Can only be set to
- REJECTED or CANCELLED by update.
- :type status: str
+ :type user_id: int
+ :type transferwise_quote_id: int
+ :param name_account_holder: The name of the account holder.
+ :type name_account_holder: str
+ :param type_: The chosen recipient account type. The possible options
+ are provided dynamically in the response endpoint.
+ :type type_: str
+ :param country: The country of the receiving account.
+ :type country: str
+ :param detail: The fields which were specified as "required" and have
+ since been filled by the user. Always provide the full list.
+ :type detail: list[object_.TransferwiseRequirementField]
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -33505,31 +35988,33 @@ def update(cls, payment_service_provider_draft_payment_id, status=None, custom_h
if custom_headers is None:
custom_headers = {}
- api_client = ApiClient(cls._get_api_context())
-
request_map = {
- cls.FIELD_STATUS: status
+ cls.FIELD_COUNTRY: country,
+ cls.FIELD_NAME_ACCOUNT_HOLDER: name_account_holder,
+ cls.FIELD_TYPE: type_,
+ cls.FIELD_DETAIL: detail
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
+ api_client = ApiClient(cls._get_api_context())
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
- payment_service_provider_draft_payment_id)
- response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(), transferwise_quote_id)
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
cls._process_for_id(response_raw)
)
@classmethod
- def list(cls, params=None, custom_headers=None):
+ def list(cls, transferwise_quote_id, params=None, custom_headers=None):
"""
:type user_id: int
+ :type transferwise_quote_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponsePaymentServiceProviderDraftPaymentList
+ :rtype: BunqResponseTransferwiseAccountRequirementList
"""
if params is None:
@@ -33539,83 +36024,146 @@ def list(cls, params=None, custom_headers=None):
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(), transferwise_quote_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponsePaymentServiceProviderDraftPaymentList.cast_from_bunq_response(
+ return BunqResponseTransferwiseAccountRequirementList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
+ @property
+ def type_(self):
+ """
+ :rtype: str
+ """
+
+ return self._type_
+
+ @property
+ def label(self):
+ """
+ :rtype: str
+ """
+
+ return self._label
+
+ @property
+ def fields(self):
+ """
+ :rtype: list[object_.TransferwiseRequirementField]
+ """
+
+ return self._fields
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._type_ is not None:
+ return False
+
+ if self._label is not None:
+ return False
+
+ if self._fields is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: TransferwiseAccountRequirement
+ """
+
+ return converter.json_to_class(TransferwiseAccountRequirement, json_str)
+
+
+class TransferwiseCurrency(BunqModel):
+ """
+ Used to get a list of supported currencies for Transferwise.
+
+ :param _currency: The currency code.
+ :type _currency: str
+ :param _name: The currency name.
+ :type _name: str
+ :param _country: The country code associated with the currency.
+ :type _country: str
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_LISTING = "user/{}/transferwise-currency"
+
+ # Object type.
+ _OBJECT_TYPE_GET = "TransferwiseCurrency"
+
+ _currency = None
+ _name = None
+ _country = None
+
@classmethod
- def get(cls, payment_service_provider_draft_payment_id, custom_headers=None):
+ def list(cls, params=None, custom_headers=None):
"""
- :type api_context: ApiContext
:type user_id: int
- :type payment_service_provider_draft_payment_id: int
+ :type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponsePaymentServiceProviderDraftPayment
+ :rtype: BunqResponseTransferwiseCurrencyList
"""
+ if params is None:
+ params = {}
+
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
- payment_service_provider_draft_payment_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponsePaymentServiceProviderDraftPayment.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ return BunqResponseTransferwiseCurrencyList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@property
- def sender_iban(self):
+ def currency(self):
"""
:rtype: str
"""
- return self._sender_iban
+ return self._currency
@property
- def receiver_iban(self):
+ def name(self):
"""
:rtype: str
"""
- return self._receiver_iban
-
- @property
- def amount(self):
- """
- :rtype: object_.Amount
- """
-
- return self._amount
+ return self._name
@property
- def status(self):
+ def country(self):
"""
:rtype: str
"""
- return self._status
+ return self._country
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._sender_iban is not None:
- return False
-
- if self._receiver_iban is not None:
+ if self._currency is not None:
return False
- if self._amount is not None:
+ if self._name is not None:
return False
- if self._status is not None:
+ if self._country is not None:
return False
return True
@@ -33625,91 +36173,100 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: PaymentServiceProviderDraftPayment
+ :rtype: TransferwiseCurrency
"""
- return converter.json_to_class(PaymentServiceProviderDraftPayment, json_str)
+ return converter.json_to_class(TransferwiseCurrency, json_str)
-class PermittedIp(BunqModel):
+class TransferwiseQuoteTemporary(BunqModel):
"""
- Manage the IPs which may be used for a credential of a user for server
- authentication.
+ Used to get temporary quotes from Transferwise. These cannot be used to
+ initiate payments
- :param _ip: The IP address.
- :type _ip: str
- :param _status: The status of the IP. May be "ACTIVE" or "INACTIVE". It is
- only possible to make requests from "ACTIVE" IP addresses. Only "ACTIVE" IPs
- will be billed.
- :type _status: str
+ :param _currency_source: The source currency.
+ :type _currency_source: str
+ :param _currency_target: The target currency.
+ :type _currency_target: str
+ :param _amount_source: The source amount.
+ :type _amount_source: object_.Amount
+ :param _amount_target: The target amount.
+ :type _amount_target: object_.Amount
+ :param _id_: The id of the quote.
+ :type _id_: int
+ :param _created: The timestamp of the note's creation.
+ :type _created: str
+ :param _updated: The timestamp of the note's last update.
+ :type _updated: str
+ :param _time_expiry: The expiration timestamp of the quote. Will always be
+ null for temporary quotes.
+ :type _time_expiry: str
+ :param _quote_id: The quote id Transferwise needs. Will always be null for
+ temporary quotes.
+ :type _quote_id: str
+ :param _rate: The rate.
+ :type _rate: str
"""
# Endpoint constants.
- _ENDPOINT_URL_READ = "user/{}/credential-password-ip/{}/ip/{}"
- _ENDPOINT_URL_CREATE = "user/{}/credential-password-ip/{}/ip"
- _ENDPOINT_URL_LISTING = "user/{}/credential-password-ip/{}/ip"
- _ENDPOINT_URL_UPDATE = "user/{}/credential-password-ip/{}/ip/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/transferwise-quote-temporary"
+ _ENDPOINT_URL_READ = "user/{}/transferwise-quote-temporary/{}"
# Field constants.
- FIELD_IP = "ip"
- FIELD_STATUS = "status"
+ FIELD_CURRENCY_SOURCE = "currency_source"
+ FIELD_CURRENCY_TARGET = "currency_target"
+ FIELD_AMOUNT_SOURCE = "amount_source"
+ FIELD_AMOUNT_TARGET = "amount_target"
# Object type.
- _OBJECT_TYPE_GET = "PermittedIp"
+ _OBJECT_TYPE_GET = "TransferwiseQuote"
- _ip = None
- _status = None
- _ip_field_for_request = None
- _status_field_for_request = None
-
- def __init__(self, ip, status=None):
- """
- :param ip: The IP address.
- :type ip: str
- :param status: The status of the IP. May be "ACTIVE" or "INACTIVE". It is
- only possible to make requests from "ACTIVE" IP addresses. Only "ACTIVE" IPs
- will be billed.
- :type status: str
- """
-
- self._ip_field_for_request = ip
- self._status_field_for_request = status
+ _id_ = None
+ _created = None
+ _updated = None
+ _time_expiry = None
+ _quote_id = None
+ _amount_source = None
+ _amount_target = None
+ _rate = None
+ _currency_source_field_for_request = None
+ _currency_target_field_for_request = None
+ _amount_source_field_for_request = None
+ _amount_target_field_for_request = None
- @classmethod
- def get(cls, credential_password_ip_id, permitted_ip_id, custom_headers=None):
+ def __init__(self, currency_source, currency_target, amount_source=None, amount_target=None):
"""
- :type api_context: ApiContext
- :type user_id: int
- :type credential_password_ip_id: int
- :type permitted_ip_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponsePermittedIp
+ :param currency_source: The source currency.
+ :type currency_source: str
+ :param currency_target: The target currency.
+ :type currency_target: str
+ :param amount_source: The source amount. Required if target amount is left
+ empty.
+ :type amount_source: object_.Amount
+ :param amount_target: The target amount. Required if source amount is left
+ empty.
+ :type amount_target: object_.Amount
"""
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), credential_password_ip_id,
- permitted_ip_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
-
- return BunqResponsePermittedIp.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
- )
+ self._currency_source_field_for_request = currency_source
+ self._currency_target_field_for_request = currency_target
+ self._amount_source_field_for_request = amount_source
+ self._amount_target_field_for_request = amount_target
@classmethod
- def create(cls, credential_password_ip_id, ip, status=None, custom_headers=None):
+ def create(cls, currency_source, currency_target, amount_source=None, amount_target=None, custom_headers=None):
"""
:type user_id: int
- :type credential_password_ip_id: int
- :param ip: The IP address.
- :type ip: str
- :param status: The status of the IP. May be "ACTIVE" or "INACTIVE". It
- is only possible to make requests from "ACTIVE" IP addresses. Only
- "ACTIVE" IPs will be billed.
- :type status: str
+ :param currency_source: The source currency.
+ :type currency_source: str
+ :param currency_target: The target currency.
+ :type currency_target: str
+ :param amount_source: The source amount. Required if target amount is
+ left empty.
+ :type amount_source: object_.Amount
+ :param amount_target: The target amount. Required if source amount is
+ left empty.
+ :type amount_target: object_.Amount
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -33719,15 +36276,17 @@ def create(cls, credential_password_ip_id, ip, status=None, custom_headers=None)
custom_headers = {}
request_map = {
- cls.FIELD_IP: ip,
- cls.FIELD_STATUS: status
+ cls.FIELD_CURRENCY_SOURCE: currency_source,
+ cls.FIELD_CURRENCY_TARGET: currency_target,
+ cls.FIELD_AMOUNT_SOURCE: amount_source,
+ cls.FIELD_AMOUNT_TARGET: amount_target
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
api_client = ApiClient(cls._get_api_context())
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(), credential_password_ip_id)
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -33735,40 +36294,185 @@ def create(cls, credential_password_ip_id, ip, status=None, custom_headers=None)
)
@classmethod
- def list(cls, credential_password_ip_id, params=None, custom_headers=None):
+ def get(cls, transferwise_quote_temporary_id, custom_headers=None):
"""
+ :type api_context: ApiContext
:type user_id: int
- :type credential_password_ip_id: int
- :type params: dict[str, str]|None
+ :type transferwise_quote_temporary_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponsePermittedIpList
+ :rtype: BunqResponseTransferwiseQuoteTemporary
"""
- if params is None:
- params = {}
-
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(), credential_password_ip_id)
- response_raw = api_client.get(endpoint_url, params, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), transferwise_quote_temporary_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponsePermittedIpList.cast_from_bunq_response(
- cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ return BunqResponseTransferwiseQuoteTemporary.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
+ @property
+ def id_(self):
+ """
+ :rtype: int
+ """
+
+ return self._id_
+
+ @property
+ def created(self):
+ """
+ :rtype: str
+ """
+
+ return self._created
+
+ @property
+ def updated(self):
+ """
+ :rtype: str
+ """
+
+ return self._updated
+
+ @property
+ def time_expiry(self):
+ """
+ :rtype: str
+ """
+
+ return self._time_expiry
+
+ @property
+ def quote_id(self):
+ """
+ :rtype: str
+ """
+
+ return self._quote_id
+
+ @property
+ def amount_source(self):
+ """
+ :rtype: object_.Amount
+ """
+
+ return self._amount_source
+
+ @property
+ def amount_target(self):
+ """
+ :rtype: object_.Amount
+ """
+
+ return self._amount_target
+
+ @property
+ def rate(self):
+ """
+ :rtype: str
+ """
+
+ return self._rate
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._id_ is not None:
+ return False
+
+ if self._created is not None:
+ return False
+
+ if self._updated is not None:
+ return False
+
+ if self._time_expiry is not None:
+ return False
+
+ if self._quote_id is not None:
+ return False
+
+ if self._amount_source is not None:
+ return False
+
+ if self._amount_target is not None:
+ return False
+
+ if self._rate is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: TransferwiseQuoteTemporary
+ """
+
+ return converter.json_to_class(TransferwiseQuoteTemporary, json_str)
+
+
+class TransferwiseTransferRequirement(BunqModel):
+ """
+ Used to determine the account requirements for Transferwise transfers.
+
+ :param _recipient_id: The id of the target account.
+ :type _recipient_id: str
+ :param _detail: The fields which were specified as "required" and have since
+ been filled by the user. Always provide the full list.
+ :type _detail: list[object_.TransferwiseRequirementField]
+ :param _type_: A possible transfer type.
+ :type _type_: str
+ :param _label: The label of the possible transfer type to show to the user.
+ :type _label: str
+ :param _fields: The fields which the user needs to fill.
+ :type _fields: list[object_.TransferwiseRequirementField]
+ """
+
+ # Endpoint constants.
+ _ENDPOINT_URL_CREATE = "user/{}/transferwise-quote/{}/transferwise-transfer-requirement"
+
+ # Field constants.
+ FIELD_RECIPIENT_ID = "recipient_id"
+ FIELD_DETAIL = "detail"
+
+ _type_ = None
+ _label = None
+ _fields = None
+ _recipient_id_field_for_request = None
+ _detail_field_for_request = None
+
+ def __init__(self, recipient_id, detail=None):
+ """
+ :param recipient_id: The id of the target account.
+ :type recipient_id: str
+ :param detail: The fields which were specified as "required" and have since
+ been filled by the user. Always provide the full list.
+ :type detail: list[object_.TransferwiseRequirementField]
+ """
+
+ self._recipient_id_field_for_request = recipient_id
+ self._detail_field_for_request = detail
+
@classmethod
- def update(cls, credential_password_ip_id, permitted_ip_id, status=None, custom_headers=None):
+ def create(cls, transferwise_quote_id, recipient_id, detail=None, custom_headers=None):
"""
:type user_id: int
- :type credential_password_ip_id: int
- :type permitted_ip_id: int
- :param status: The status of the IP. May be "ACTIVE" or "INACTIVE". It
- is only possible to make requests from "ACTIVE" IP addresses. Only
- "ACTIVE" IPs will be billed.
- :type status: str
+ :type transferwise_quote_id: int
+ :param recipient_id: The id of the target account.
+ :type recipient_id: str
+ :param detail: The fields which were specified as "required" and have
+ since been filled by the user. Always provide the full list.
+ :type detail: list[object_.TransferwiseRequirementField]
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -33777,48 +36481,58 @@ def update(cls, credential_password_ip_id, permitted_ip_id, status=None, custom_
if custom_headers is None:
custom_headers = {}
- api_client = ApiClient(cls._get_api_context())
-
request_map = {
- cls.FIELD_STATUS: status
+ cls.FIELD_RECIPIENT_ID: recipient_id,
+ cls.FIELD_DETAIL: detail
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
+ api_client = ApiClient(cls._get_api_context())
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(), credential_password_ip_id,
- permitted_ip_id)
- response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(), transferwise_quote_id)
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
cls._process_for_id(response_raw)
)
@property
- def ip(self):
+ def type_(self):
"""
:rtype: str
"""
- return self._ip
+ return self._type_
@property
- def status(self):
+ def label(self):
"""
:rtype: str
"""
- return self._status
+ return self._label
+
+ @property
+ def fields(self):
+ """
+ :rtype: list[object_.TransferwiseRequirementField]
+ """
+
+ return self._fields
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._ip is not None:
+ if self._type_ is not None:
return False
- if self._status is not None:
+ if self._label is not None:
+ return False
+
+ if self._fields is not None:
return False
return True
@@ -33828,72 +36542,85 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: PermittedIp
+ :rtype: TransferwiseTransferRequirement
"""
- return converter.json_to_class(PermittedIp, json_str)
+ return converter.json_to_class(TransferwiseTransferRequirement, json_str)
-class Reward(BunqModel):
+class TransferwiseUser(BunqModel):
"""
- Used to view Rewards.
+ Used to manage Transferwise users.
- :param _id_: The id of the reward.
+ :param _oauth_code: The OAuth code returned by Transferwise we should be
+ using to gain access to the user's Transferwise account.
+ :type _oauth_code: str
+ :param _id_: The id of the TransferwiseUser.
:type _id_: int
- :param _created: The time the reward was created.
+ :param _created: The timestamp of the TransferwiseUser's creation.
:type _created: str
- :param _updated: The time the reward was last updated.
+ :param _updated: The timestamp of the TransferwiseUser's last update.
:type _updated: str
- :param _status: The status of the reward.
- :type _status: str
- :param _sub_status: The subStatus of the reward.
- :type _sub_status: str
- :param _type_: The type of the reward.
- :type _type_: str
- :param _counterparty_alias: The alias of the other user eligible for the
- reward award.
- :type _counterparty_alias: object_.LabelUser
- :param _amount_reward: The amount that will be/was awarded as reward for the
- reward.
- :type _amount_reward: object_.Amount
+ :param _name: The name the user is registered with at TransferWise.
+ :type _name: str
+ :param _email: The email the user is registered with at TransferWise.
+ :type _email: str
"""
# Endpoint constants.
- _ENDPOINT_URL_READ = "user/{}/reward/{}"
- _ENDPOINT_URL_LISTING = "user/{}/reward"
+ _ENDPOINT_URL_CREATE = "user/{}/transferwise-user"
+ _ENDPOINT_URL_LISTING = "user/{}/transferwise-user"
+
+ # Field constants.
+ FIELD_OAUTH_CODE = "oauth_code"
# Object type.
- _OBJECT_TYPE_GET = "Reward"
+ _OBJECT_TYPE_GET = "TransferwiseUser"
_id_ = None
_created = None
_updated = None
- _status = None
- _sub_status = None
- _type_ = None
- _counterparty_alias = None
- _amount_reward = None
+ _name = None
+ _email = None
+ _oauth_code_field_for_request = None
+
+ def __init__(self, oauth_code=None):
+ """
+ :param oauth_code: The OAuth code returned by Transferwise we should be
+ using to gain access to the user's Transferwise account.
+ :type oauth_code: str
+ """
+
+ self._oauth_code_field_for_request = oauth_code
@classmethod
- def get(cls, reward_id, custom_headers=None):
+ def create(cls, oauth_code=None, custom_headers=None):
"""
- :type api_context: ApiContext
:type user_id: int
- :type reward_id: int
+ :param oauth_code: The OAuth code returned by Transferwise we should be
+ using to gain access to the user's Transferwise account.
+ :type oauth_code: str
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseReward
+ :rtype: BunqResponseInt
"""
if custom_headers is None:
custom_headers = {}
+ request_map = {
+ cls.FIELD_OAUTH_CODE: oauth_code
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), reward_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
- return BunqResponseReward.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
)
@classmethod
@@ -33903,7 +36630,7 @@ def list(cls, params=None, custom_headers=None):
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseRewardList
+ :rtype: BunqResponseTransferwiseUserList
"""
if params is None:
@@ -33916,7 +36643,7 @@ def list(cls, params=None, custom_headers=None):
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseRewardList.cast_from_bunq_response(
+ return BunqResponseTransferwiseUserList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -33945,44 +36672,20 @@ def updated(self):
return self._updated
@property
- def status(self):
- """
- :rtype: str
- """
-
- return self._status
-
- @property
- def sub_status(self):
+ def name(self):
"""
:rtype: str
"""
- return self._sub_status
+ return self._name
@property
- def type_(self):
+ def email(self):
"""
:rtype: str
"""
- return self._type_
-
- @property
- def counterparty_alias(self):
- """
- :rtype: object_.LabelUser
- """
-
- return self._counterparty_alias
-
- @property
- def amount_reward(self):
- """
- :rtype: object_.Amount
- """
-
- return self._amount_reward
+ return self._email
def is_all_field_none(self):
"""
@@ -33998,19 +36701,10 @@ def is_all_field_none(self):
if self._updated is not None:
return False
- if self._status is not None:
- return False
-
- if self._sub_status is not None:
- return False
-
- if self._type_ is not None:
- return False
-
- if self._counterparty_alias is not None:
+ if self._name is not None:
return False
- if self._amount_reward is not None:
+ if self._email is not None:
return False
return True
@@ -34020,68 +36714,95 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: Reward
+ :rtype: TransferwiseUser
"""
- return converter.json_to_class(Reward, json_str)
+ return converter.json_to_class(TransferwiseUser, json_str)
-class SandboxUser(BunqModel):
+class TreeProgress(BunqModel):
"""
- Used to create a sandbox user.
+ See how many trees this user has planted.
- :param _api_key: The API key of the newly created sandbox user.
- :type _api_key: str
+ :param _number_of_tree: The number of trees this user and all users have
+ planted.
+ :type _number_of_tree: float
+ :param _progress_tree_next: The progress towards the next tree.
+ :type _progress_tree_next: float
+ :param _label_user: The label of the user the progress belongs to.
+ :type _label_user: core.BunqModel
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "sandbox-user"
+ _ENDPOINT_URL_LISTING = "user/{}/tree-progress"
# Object type.
- _OBJECT_TYPE_POST = "ApiKey"
+ _OBJECT_TYPE_GET = "TreeProgress"
- _api_key = None
+ _number_of_tree = None
+ _progress_tree_next = None
+ _label_user = None
@classmethod
- def create(cls, custom_headers=None):
+ def list(cls, params=None, custom_headers=None):
"""
+ :type user_id: int
+ :type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseSandboxUser
+ :rtype: BunqResponseTreeProgressList
"""
+ if params is None:
+ params = {}
+
if custom_headers is None:
custom_headers = {}
- request_map = {
-
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
-
api_client = ApiClient(cls._get_api_context())
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE
- response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseSandboxUser.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_POST)
+ return BunqResponseTreeProgressList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@property
- def api_key(self):
+ def number_of_tree(self):
"""
- :rtype: str
+ :rtype: float
"""
- return self._api_key
+ return self._number_of_tree
+
+ @property
+ def progress_tree_next(self):
+ """
+ :rtype: float
+ """
+
+ return self._progress_tree_next
+
+ @property
+ def label_user(self):
+ """
+ :rtype: core.BunqModel
+ """
+
+ return self._label_user
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._api_key is not None:
+ if self._number_of_tree is not None:
+ return False
+
+ if self._progress_tree_next is not None:
+ return False
+
+ if self._label_user is not None:
return False
return True
@@ -34091,38 +36812,39 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: SandboxUser
+ :rtype: TreeProgress
"""
- return converter.json_to_class(SandboxUser, json_str)
+ return converter.json_to_class(TreeProgress, json_str)
-class ScheduleUser(BunqModel):
+class UserCompanyName(BunqModel):
"""
- view for reading the scheduled definitions.
+ Endpoint for getting all the known (trade) names for a user company. This is
+ needed for updating the user name, as we only accept legal or trade names.
+
+ :param _name_array: All known (trade) names for a user company.
+ :type _name_array: list[str]
"""
# Endpoint constants.
- _ENDPOINT_URL_LISTING = "user/{}/schedule"
+ _ENDPOINT_URL_LISTING = "user-company/{}/name"
# Object type.
- _OBJECT_TYPE_GET = "ScheduleUser"
+ _OBJECT_TYPE_GET = "UserCompanyNameArray"
+
+ _name_array = None
@classmethod
- def list(cls, params=None, custom_headers=None):
+ def list(cls, user_company_id, params=None, custom_headers=None):
"""
- Get a collection of scheduled definition for all accessible monetary
- accounts of the user. You can add the parameter type to filter the
- response. When
- type={SCHEDULE_DEFINITION_PAYMENT,SCHEDULE_DEFINITION_PAYMENT_BATCH} is
- provided only schedule definition object that relate to these
- definitions are returned.
+ Return all the known (trade) names for a specific user company.
- :type user_id: int
+ :type user_company_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseScheduleUserList
+ :rtype: BunqResponseUserCompanyNameList
"""
if params is None:
@@ -34135,15 +36857,26 @@ def list(cls, params=None, custom_headers=None):
endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseScheduleUserList.cast_from_bunq_response(
+ return BunqResponseUserCompanyNameList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
+ @property
+ def name_array(self):
+ """
+ :rtype: list[str]
+ """
+
+ return self._name_array
+
def is_all_field_none(self):
"""
:rtype: bool
"""
+ if self._name_array is not None:
+ return False
+
return True
@staticmethod
@@ -34151,106 +36884,179 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: ScheduleUser
+ :rtype: UserCompanyName
"""
- return converter.json_to_class(ScheduleUser, json_str)
+ return converter.json_to_class(UserCompanyName, json_str)
-class Session(BunqModel):
+class UserCredentialPasswordIp(BunqModel):
"""
- Endpoint for operations over the current session.
+ Create a credential of a user for server authentication, or delete the
+ credential of a user for server authentication.
+
+ :param _id_: The id of the credential.
+ :type _id_: int
+ :param _created: The timestamp of the credential object's creation.
+ :type _created: str
+ :param _updated: The timestamp of the credential object's last update.
+ :type _updated: str
+ :param _status: The status of the credential.
+ :type _status: str
+ :param _expiry_time: When the status is PENDING_FIRST_USE: when the
+ credential expires.
+ :type _expiry_time: str
+ :param _token_value: When the status is PENDING_FIRST_USE: the value of the
+ token.
+ :type _token_value: str
+ :param _permitted_device: When the status is ACTIVE: the details of the
+ device that may use the credential.
+ :type _permitted_device: object_.PermittedDevice
"""
# Endpoint constants.
- _ENDPOINT_URL_DELETE = "session/{}"
+ _ENDPOINT_URL_READ = "user/{}/credential-password-ip/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/credential-password-ip"
+
+ # Object type.
+ _OBJECT_TYPE_GET = "CredentialPasswordIp"
+
+ _id_ = None
+ _created = None
+ _updated = None
+ _status = None
+ _expiry_time = None
+ _token_value = None
+ _permitted_device = None
@classmethod
- def delete(cls, session_id, custom_headers=None):
+ def get(cls, user_credential_password_ip_id, custom_headers=None):
"""
- Deletes the current session.
+ :type api_context: ApiContext
+ :type user_id: int
+ :type user_credential_password_ip_id: int
+ :type custom_headers: dict[str, str]|None
- :type session_id: int
+ :rtype: BunqResponseUserCredentialPasswordIp
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), user_credential_password_ip_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponseUserCredentialPasswordIp.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @classmethod
+ def list(cls, params=None, custom_headers=None):
+ """
+ :type user_id: int
+ :type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNone
+ :rtype: BunqResponseUserCredentialPasswordIpList
"""
+ if params is None:
+ params = {}
+
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_DELETE.format(session_id)
- response_raw = api_client.delete(endpoint_url, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNone.cast_from_bunq_response(
- BunqResponse(None, response_raw.headers)
+ return BunqResponseUserCredentialPasswordIpList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
- def is_all_field_none(self):
+ @property
+ def id_(self):
"""
- :rtype: bool
+ :rtype: int
"""
- return True
+ return self._id_
- @staticmethod
- def from_json(json_str):
+ @property
+ def created(self):
"""
- :type json_str: str
-
- :rtype: Session
+ :rtype: str
"""
- return converter.json_to_class(Session, json_str)
+ return self._created
+ @property
+ def updated(self):
+ """
+ :rtype: str
+ """
-class ShareInviteMonetaryAccountAmountUsed(BunqModel):
- """
- When you have connected your monetary account to a user, and given this user
- a (for example) daily budget of 10 EUR. If this users has used his entire
- budget or part of it, this call can be used to reset the amount he used to
- 0. The user can then spend the daily budget of 10 EUR again.
- """
+ return self._updated
- # Endpoint constants.
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/share-invite-monetary-account-inquiry/{}/amount-used/{}"
+ @property
+ def status(self):
+ """
+ :rtype: str
+ """
- @classmethod
- def delete(cls, share_invite_monetary_account_inquiry_id, share_invite_monetary_account_amount_used_id,
- monetary_account_id=None, custom_headers=None):
+ return self._status
+
+ @property
+ def expiry_time(self):
"""
- Reset the available budget for an account share. To be called without
- any ID at the end of the path.
-
- :type user_id: int
- :type monetary_account_id: int
- :type share_invite_monetary_account_inquiry_id: int
- :type share_invite_monetary_account_amount_used_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseNone
+ :rtype: str
"""
- if custom_headers is None:
- custom_headers = {}
+ return self._expiry_time
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- share_invite_monetary_account_inquiry_id,
- share_invite_monetary_account_amount_used_id)
- response_raw = api_client.delete(endpoint_url, custom_headers)
+ @property
+ def token_value(self):
+ """
+ :rtype: str
+ """
- return BunqResponseNone.cast_from_bunq_response(
- BunqResponse(None, response_raw.headers)
- )
+ return self._token_value
+
+ @property
+ def permitted_device(self):
+ """
+ :rtype: object_.PermittedDevice
+ """
+
+ return self._permitted_device
def is_all_field_none(self):
"""
:rtype: bool
"""
+ if self._id_ is not None:
+ return False
+
+ if self._created is not None:
+ return False
+
+ if self._updated is not None:
+ return False
+
+ if self._status is not None:
+ return False
+
+ if self._expiry_time is not None:
+ return False
+
+ if self._token_value is not None:
+ return False
+
+ if self._permitted_device is not None:
+ return False
+
return True
@staticmethod
@@ -34258,89 +37064,66 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: ShareInviteMonetaryAccountAmountUsed
+ :rtype: UserCredentialPasswordIp
"""
- return converter.json_to_class(ShareInviteMonetaryAccountAmountUsed, json_str)
+ return converter.json_to_class(UserCredentialPasswordIp, json_str)
-class TabItemShopBatch(BunqModel):
+class UserLegalName(BunqModel):
"""
- Create a batch of tab items.
+ Endpoint for getting available legal names that can be used by the user.
- :param _tab_items: The list of tab items in the batch.
- :type _tab_items: list[TabItemShop]
+ :param _legal_names: All legal names that can be used by the user
+ :type _legal_names: list[str]
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/cash-register/{}/tab/{}/tab-item-batch"
-
- # Field constants.
- FIELD_TAB_ITEMS = "tab_items"
-
- _tab_items = None
- _tab_items_field_for_request = None
+ _ENDPOINT_URL_LISTING = "user/{}/legal-name"
- def __init__(self, tab_items):
- """
- :param tab_items: The list of tab items we want to create in a single batch.
- Limited to 50 items per batch.
- :type tab_items: list[TabItemShop]
- """
+ # Object type.
+ _OBJECT_TYPE_GET = "UserLegalNameArray"
- self._tab_items_field_for_request = tab_items
+ _legal_names = None
@classmethod
- def create(cls, cash_register_id, tab_uuid, tab_items, monetary_account_id=None, custom_headers=None):
+ def list(cls, params=None, custom_headers=None):
"""
- Create tab items as a batch.
-
:type user_id: int
- :type monetary_account_id: int
- :type cash_register_id: int
- :type tab_uuid: str
- :param tab_items: The list of tab items we want to create in a single
- batch. Limited to 50 items per batch.
- :type tab_items: list[TabItemShop]
+ :type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseInt
+ :rtype: BunqResponseUserLegalNameList
"""
+ if params is None:
+ params = {}
+
if custom_headers is None:
custom_headers = {}
- request_map = {
- cls.FIELD_TAB_ITEMS: tab_items
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
-
api_client = ApiClient(cls._get_api_context())
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- cash_register_id, tab_uuid)
- response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseInt.cast_from_bunq_response(
- cls._process_for_id(response_raw)
+ return BunqResponseUserLegalNameList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@property
- def tab_items(self):
+ def legal_names(self):
"""
- :rtype: list[TabItemShop]
+ :rtype: list[str]
"""
- return self._tab_items
+ return self._legal_names
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._tab_items is not None:
+ if self._legal_names is not None:
return False
return True
@@ -34350,128 +37133,130 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: TabItemShopBatch
+ :rtype: UserLegalName
"""
- return converter.json_to_class(TabItemShopBatch, json_str)
+ return converter.json_to_class(UserLegalName, json_str)
-class TabItemShop(BunqModel):
+class WhitelistSdd(BunqModel):
"""
- After youβve created a Tab using /tab-usage-single or /tab-usage-multiple
- you can add items and attachments using tab-item. You can only add or modify
- TabItems of a Tab which status is OPEN. The amount of the TabItems will not
- influence the total_amount of the corresponding Tab. However, if you've
- created any TabItems for a Tab the sum of the amounts of these items must be
- equal to the total_amount of the Tab when you change its status to
- PAYABLE/WAITING_FOR_PAYMENT.
+ Whitelist an SDD so that when one comes in, it is automatically accepted.
- :param _description: The TabItem's brief description.
- :type _description: str
- :param _ean_code: The TabItem's EAN code.
- :type _ean_code: str
- :param _avatar_attachment_uuid: An AttachmentPublic UUID that used as an
- avatar for the TabItem.
- :type _avatar_attachment_uuid: str
- :param _tab_attachment: A list of AttachmentTab attached to the TabItem.
- :type _tab_attachment: list[object_.AttachmentTab]
- :param _quantity: The quantity of the TabItem.
- :type _quantity: float
- :param _amount: The money amount of the TabItem.
- :type _amount: object_.Amount
- :param _id_: The id of the created TabItem.
+ :param _monetary_account_paying_id: The account from which payments will be
+ deducted when a transaction is matched with this whitelist.
+ :type _monetary_account_paying_id: int
+ :param _request_id: ID of the request for which you want to whitelist the
+ originating SDD.
+ :type _request_id: int
+ :param _maximum_amount_per_month: The monthly maximum amount that can be
+ deducted from the target account.
+ :type _maximum_amount_per_month: object_.Amount
+ :param _id_: The ID of the whitelist entry.
:type _id_: int
- :param _avatar_attachment: A struct with an AttachmentPublic UUID that used
- as an avatar for the TabItem.
- :type _avatar_attachment: object_.AttachmentPublic
+ :param _monetary_account_incoming_id: The account to which payments will
+ come in before possibly being 'redirected' by the whitelist.
+ :type _monetary_account_incoming_id: int
+ :param _type_: The type of the SDD whitelist, can be CORE or B2B.
+ :type _type_: str
+ :param _status: The status of the whitelist.
+ :type _status: str
+ :param _credit_scheme_identifier: The credit scheme ID provided by the
+ counterparty.
+ :type _credit_scheme_identifier: str
+ :param _mandate_identifier: The mandate ID provided by the counterparty.
+ :type _mandate_identifier: str
+ :param _counterparty_alias: The account to which payments will be paid.
+ :type _counterparty_alias: object_.MonetaryAccountReference
+ :param _user_alias_created: The user who created the whitelist entry.
+ :type _user_alias_created: object_.LabelUser
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/monetary-account/{}/cash-register/{}/tab/{}/tab-item"
- _ENDPOINT_URL_UPDATE = "user/{}/monetary-account/{}/cash-register/{}/tab/{}/tab-item/{}"
- _ENDPOINT_URL_DELETE = "user/{}/monetary-account/{}/cash-register/{}/tab/{}/tab-item/{}"
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/cash-register/{}/tab/{}/tab-item"
- _ENDPOINT_URL_READ = "user/{}/monetary-account/{}/cash-register/{}/tab/{}/tab-item/{}"
+ _ENDPOINT_URL_READ = "user/{}/whitelist-sdd/{}"
+ _ENDPOINT_URL_CREATE = "user/{}/whitelist-sdd"
+ _ENDPOINT_URL_UPDATE = "user/{}/whitelist-sdd/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/whitelist-sdd/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/whitelist-sdd"
# Field constants.
- FIELD_DESCRIPTION = "description"
- FIELD_EAN_CODE = "ean_code"
- FIELD_AVATAR_ATTACHMENT_UUID = "avatar_attachment_uuid"
- FIELD_TAB_ATTACHMENT = "tab_attachment"
- FIELD_QUANTITY = "quantity"
- FIELD_AMOUNT = "amount"
+ FIELD_MONETARY_ACCOUNT_PAYING_ID = "monetary_account_paying_id"
+ FIELD_REQUEST_ID = "request_id"
+ FIELD_MAXIMUM_AMOUNT_PER_MONTH = "maximum_amount_per_month"
# Object type.
- _OBJECT_TYPE_GET = "TabItem"
+ _OBJECT_TYPE_GET = "WhitelistSdd"
_id_ = None
- _description = None
- _ean_code = None
- _avatar_attachment = None
- _tab_attachment = None
- _quantity = None
- _amount = None
- _description_field_for_request = None
- _ean_code_field_for_request = None
- _avatar_attachment_uuid_field_for_request = None
- _tab_attachment_field_for_request = None
- _quantity_field_for_request = None
- _amount_field_for_request = None
+ _monetary_account_incoming_id = None
+ _monetary_account_paying_id = None
+ _type_ = None
+ _status = None
+ _credit_scheme_identifier = None
+ _mandate_identifier = None
+ _counterparty_alias = None
+ _maximum_amount_per_month = None
+ _user_alias_created = None
+ _monetary_account_paying_id_field_for_request = None
+ _request_id_field_for_request = None
+ _maximum_amount_per_month_field_for_request = None
- def __init__(self, description=None, ean_code=None, avatar_attachment_uuid=None, tab_attachment=None, quantity=None,
- amount=None):
+ def __init__(self, request_id, monetary_account_paying_id=None, maximum_amount_per_month=None):
"""
- :param description: The TabItem's brief description. Can't be empty and must
- be no longer than 100 characters
- :type description: str
- :param ean_code: The TabItem's EAN code.
- :type ean_code: str
- :param avatar_attachment_uuid: An AttachmentPublic UUID that used as an
- avatar for the TabItem.
- :type avatar_attachment_uuid: str
- :param tab_attachment: A list of AttachmentTab attached to the TabItem.
- :type tab_attachment: list[int]
- :param quantity: The quantity of the TabItem. Formatted as a number
- containing up to 15 digits, up to 15 decimals and using a dot.
- :type quantity: str
- :param amount: The money amount of the TabItem. Will not change the value of
- the corresponding Tab.
- :type amount: object_.Amount
+ :param monetary_account_paying_id: ID of the monetary account of which you
+ want to pay from.
+ :type monetary_account_paying_id: int
+ :param request_id: ID of the request for which you want to whitelist the
+ originating SDD.
+ :type request_id: int
+ :param maximum_amount_per_month: The maximum amount of money that is allowed
+ to be deducted based on the whitelist.
+ :type maximum_amount_per_month: object_.Amount
+ """
+
+ self._monetary_account_paying_id_field_for_request = monetary_account_paying_id
+ self._request_id_field_for_request = request_id
+ self._maximum_amount_per_month_field_for_request = maximum_amount_per_month
+
+ @classmethod
+ def get(cls, whitelist_sdd_id, custom_headers=None):
+ """
+ Get a specific SDD whitelist entry.
+
+ :type api_context: ApiContext
+ :type user_id: int
+ :type whitelist_sdd_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseWhitelistSdd
"""
- self._description_field_for_request = description
- self._ean_code_field_for_request = ean_code
- self._avatar_attachment_uuid_field_for_request = avatar_attachment_uuid
- self._tab_attachment_field_for_request = tab_attachment
- self._quantity_field_for_request = quantity
- self._amount_field_for_request = amount
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), whitelist_sdd_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponseWhitelistSdd.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
@classmethod
- def create(cls, cash_register_id, tab_uuid, description, monetary_account_id=None, ean_code=None,
- avatar_attachment_uuid=None, tab_attachment=None, quantity=None, amount=None, custom_headers=None):
+ def create(cls, monetary_account_paying_id, request_id, maximum_amount_per_month, custom_headers=None):
"""
- Create a new TabItem for a given Tab.
+ Create a new SDD whitelist entry.
:type user_id: int
- :type monetary_account_id: int
- :type cash_register_id: int
- :type tab_uuid: str
- :param description: The TabItem's brief description. Can't be empty and
- must be no longer than 100 characters
- :type description: str
- :param ean_code: The TabItem's EAN code.
- :type ean_code: str
- :param avatar_attachment_uuid: An AttachmentPublic UUID that used as an
- avatar for the TabItem.
- :type avatar_attachment_uuid: str
- :param tab_attachment: A list of AttachmentTab attached to the TabItem.
- :type tab_attachment: list[int]
- :param quantity: The quantity of the TabItem. Formatted as a number
- containing up to 15 digits, up to 15 decimals and using a dot.
- :type quantity: str
- :param amount: The money amount of the TabItem. Will not change the
- value of the corresponding Tab.
- :type amount: object_.Amount
+ :param monetary_account_paying_id: ID of the monetary account of which
+ you want to pay from.
+ :type monetary_account_paying_id: int
+ :param request_id: ID of the request for which you want to whitelist the
+ originating SDD.
+ :type request_id: int
+ :param maximum_amount_per_month: The maximum amount of money that is
+ allowed to be deducted based on the whitelist.
+ :type maximum_amount_per_month: object_.Amount
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -34481,21 +37266,16 @@ def create(cls, cash_register_id, tab_uuid, description, monetary_account_id=Non
custom_headers = {}
request_map = {
- cls.FIELD_DESCRIPTION: description,
- cls.FIELD_EAN_CODE: ean_code,
- cls.FIELD_AVATAR_ATTACHMENT_UUID: avatar_attachment_uuid,
- cls.FIELD_TAB_ATTACHMENT: tab_attachment,
- cls.FIELD_QUANTITY: quantity,
- cls.FIELD_AMOUNT: amount
+ cls.FIELD_MONETARY_ACCOUNT_PAYING_ID: monetary_account_paying_id,
+ cls.FIELD_REQUEST_ID: request_id,
+ cls.FIELD_MAXIMUM_AMOUNT_PER_MONTH: maximum_amount_per_month
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
api_client = ApiClient(cls._get_api_context())
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- cash_register_id, tab_uuid)
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -34503,33 +37283,17 @@ def create(cls, cash_register_id, tab_uuid, description, monetary_account_id=Non
)
@classmethod
- def update(cls, cash_register_id, tab_uuid, tab_item_shop_id, monetary_account_id=None, description=None,
- ean_code=None, avatar_attachment_uuid=None, tab_attachment=None, quantity=None, amount=None,
+ def update(cls, whitelist_sdd_id, monetary_account_paying_id=None, maximum_amount_per_month=None,
custom_headers=None):
"""
- Modify a TabItem from a given Tab.
-
:type user_id: int
- :type monetary_account_id: int
- :type cash_register_id: int
- :type tab_uuid: str
- :type tab_item_shop_id: int
- :param description: The TabItem's brief description. Can't be empty and
- must be no longer than 100 characters
- :type description: str
- :param ean_code: The TabItem's EAN code.
- :type ean_code: str
- :param avatar_attachment_uuid: An AttachmentPublic UUID that used as an
- avatar for the TabItem.
- :type avatar_attachment_uuid: str
- :param tab_attachment: A list of AttachmentTab attached to the TabItem.
- :type tab_attachment: list[int]
- :param quantity: The quantity of the TabItem. Formatted as a number
- containing up to 15 digits, up to 15 decimals and using a dot.
- :type quantity: str
- :param amount: The money amount of the TabItem. Will not change the
- value of the corresponding Tab.
- :type amount: object_.Amount
+ :type whitelist_sdd_id: int
+ :param monetary_account_paying_id: ID of the monetary account of which
+ you want to pay from.
+ :type monetary_account_paying_id: int
+ :param maximum_amount_per_month: The maximum amount of money that is
+ allowed to be deducted based on the whitelist.
+ :type maximum_amount_per_month: object_.Amount
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -34541,20 +37305,14 @@ def update(cls, cash_register_id, tab_uuid, tab_item_shop_id, monetary_account_i
api_client = ApiClient(cls._get_api_context())
request_map = {
- cls.FIELD_DESCRIPTION: description,
- cls.FIELD_EAN_CODE: ean_code,
- cls.FIELD_AVATAR_ATTACHMENT_UUID: avatar_attachment_uuid,
- cls.FIELD_TAB_ATTACHMENT: tab_attachment,
- cls.FIELD_QUANTITY: quantity,
- cls.FIELD_AMOUNT: amount
+ cls.FIELD_MONETARY_ACCOUNT_PAYING_ID: monetary_account_paying_id,
+ cls.FIELD_MAXIMUM_AMOUNT_PER_MONTH: maximum_amount_per_month
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- cash_register_id, tab_uuid, tab_item_shop_id)
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(), whitelist_sdd_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -34562,15 +37320,10 @@ def update(cls, cash_register_id, tab_uuid, tab_item_shop_id, monetary_account_i
)
@classmethod
- def delete(cls, cash_register_id, tab_uuid, tab_item_shop_id, monetary_account_id=None, custom_headers=None):
+ def delete(cls, whitelist_sdd_id, custom_headers=None):
"""
- Delete a specific TabItem from a Tab.
-
:type user_id: int
- :type monetary_account_id: int
- :type cash_register_id: int
- :type tab_uuid: str
- :type tab_item_shop_id: int
+ :type whitelist_sdd_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseNone
@@ -34580,9 +37333,7 @@ def delete(cls, cash_register_id, tab_uuid, tab_item_shop_id, monetary_account_i
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- cash_register_id, tab_uuid, tab_item_shop_id)
+ endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(), whitelist_sdd_id)
response_raw = api_client.delete(endpoint_url, custom_headers)
return BunqResponseNone.cast_from_bunq_response(
@@ -34590,18 +37341,16 @@ def delete(cls, cash_register_id, tab_uuid, tab_item_shop_id, monetary_account_i
)
@classmethod
- def list(cls, cash_register_id, tab_uuid, monetary_account_id=None, params=None, custom_headers=None):
+ def list(cls, params=None, custom_headers=None):
"""
- Get a collection of TabItems from a given Tab.
+ Get a listing of all SDD whitelist entries for a target monetary
+ account.
:type user_id: int
- :type monetary_account_id: int
- :type cash_register_id: int
- :type tab_uuid: str
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseTabItemShopList
+ :rtype: BunqResponseWhitelistSddList
"""
if params is None:
@@ -34611,99 +37360,92 @@ def list(cls, cash_register_id, tab_uuid, monetary_account_id=None, params=None,
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- cash_register_id, tab_uuid)
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseTabItemShopList.cast_from_bunq_response(
+ return BunqResponseWhitelistSddList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
- @classmethod
- def get(cls, cash_register_id, tab_uuid, tab_item_shop_id, monetary_account_id=None, custom_headers=None):
+ @property
+ def id_(self):
"""
- Get a specific TabItem from a given Tab.
-
- :type api_context: ApiContext
- :type user_id: int
- :type monetary_account_id: int
- :type cash_register_id: int
- :type tab_uuid: str
- :type tab_item_shop_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseTabItemShop
+ :rtype: int
"""
- if custom_headers is None:
- custom_headers = {}
+ return self._id_
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- cash_register_id, tab_uuid, tab_item_shop_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
+ @property
+ def monetary_account_incoming_id(self):
+ """
+ :rtype: int
+ """
- return BunqResponseTabItemShop.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
- )
+ return self._monetary_account_incoming_id
@property
- def id_(self):
+ def monetary_account_paying_id(self):
"""
:rtype: int
"""
- return self._id_
+ return self._monetary_account_paying_id
@property
- def description(self):
+ def type_(self):
"""
:rtype: str
"""
- return self._description
+ return self._type_
@property
- def ean_code(self):
+ def status(self):
"""
:rtype: str
"""
- return self._ean_code
+ return self._status
@property
- def avatar_attachment(self):
+ def credit_scheme_identifier(self):
"""
- :rtype: object_.AttachmentPublic
+ :rtype: str
"""
- return self._avatar_attachment
+ return self._credit_scheme_identifier
@property
- def tab_attachment(self):
+ def mandate_identifier(self):
"""
- :rtype: list[object_.AttachmentTab]
+ :rtype: str
"""
- return self._tab_attachment
+ return self._mandate_identifier
@property
- def quantity(self):
+ def counterparty_alias(self):
"""
- :rtype: float
+ :rtype: object_.MonetaryAccountReference
"""
- return self._quantity
+ return self._counterparty_alias
@property
- def amount(self):
+ def maximum_amount_per_month(self):
"""
:rtype: object_.Amount
"""
- return self._amount
+ return self._maximum_amount_per_month
+
+ @property
+ def user_alias_created(self):
+ """
+ :rtype: object_.LabelUser
+ """
+
+ return self._user_alias_created
def is_all_field_none(self):
"""
@@ -34713,22 +37455,31 @@ def is_all_field_none(self):
if self._id_ is not None:
return False
- if self._description is not None:
+ if self._monetary_account_incoming_id is not None:
return False
- if self._ean_code is not None:
+ if self._monetary_account_paying_id is not None:
return False
- if self._avatar_attachment is not None:
+ if self._type_ is not None:
return False
- if self._tab_attachment is not None:
+ if self._status is not None:
return False
- if self._quantity is not None:
+ if self._credit_scheme_identifier is not None:
return False
- if self._amount is not None:
+ if self._mandate_identifier is not None:
+ return False
+
+ if self._counterparty_alias is not None:
+ return False
+
+ if self._maximum_amount_per_month is not None:
+ return False
+
+ if self._user_alias_created is not None:
return False
return True
@@ -34738,59 +37489,84 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: TabItemShop
+ :rtype: WhitelistSdd
"""
- return converter.json_to_class(TabItemShop, json_str)
+ return converter.json_to_class(WhitelistSdd, json_str)
-class TabQrCodeContent(BunqModel):
+class MasterCardActionGreenAggregation(BunqModel):
"""
- This call returns the raw content of the QR code that links to this Tab.
- When a bunq user scans this QR code with the bunq app the Tab will be shown
- on his/her device.
+ Aggregation of how many card payments have been done with a Green Card in
+ the current calendar month.
+
+ :param _date: The date of the aggregation.
+ :type _date: str
+ :param _percentage: The percentage of card payments that were done with a
+ Green Card.
+ :type _percentage: str
"""
# Endpoint constants.
- _ENDPOINT_URL_LISTING = "user/{}/monetary-account/{}/cash-register/{}/tab/{}/qr-code-content"
+ _ENDPOINT_URL_LISTING = "user/{}/mastercard-action-green-aggregation"
# Object type.
- _OBJECT_TYPE_GET = "TabQrCodeContent"
+ _OBJECT_TYPE_GET = "MasterCardActionGreenAggregation"
+
+ _date = None
+ _percentage = None
@classmethod
- def list(cls, cash_register_id, tab_uuid, monetary_account_id=None, custom_headers=None):
+ def list(cls, params=None, custom_headers=None):
"""
- Returns the raw content of the QR code that links to this Tab. The raw
- content is the binary representation of a file, without any JSON
- wrapping.
-
:type user_id: int
- :type monetary_account_id: int
- :type cash_register_id: int
- :type tab_uuid: str
+ :type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseBytes
+ :rtype: BunqResponseMasterCardActionGreenAggregationList
"""
+ if params is None:
+ params = {}
+
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(),
- cls._determine_monetary_account_id(monetary_account_id),
- cash_register_id, tab_uuid)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseBytes.cast_from_bunq_response(
- BunqResponse(response_raw.body_bytes, response_raw.headers)
+ return BunqResponseMasterCardActionGreenAggregationList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
+ @property
+ def date(self):
+ """
+ :rtype: str
+ """
+
+ return self._date
+
+ @property
+ def percentage(self):
+ """
+ :rtype: str
+ """
+
+ return self._percentage
+
def is_all_field_none(self):
"""
:rtype: bool
"""
+ if self._date is not None:
+ return False
+
+ if self._percentage is not None:
+ return False
+
return True
@staticmethod
@@ -34798,230 +37574,319 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: TabQrCodeContent
+ :rtype: MasterCardActionGreenAggregation
"""
- return converter.json_to_class(TabQrCodeContent, json_str)
+ return converter.json_to_class(MasterCardActionGreenAggregation, json_str)
-class TokenQrRequestIdeal(BunqModel):
+class RegistryEntry(BunqModel):
"""
- Using this call you create a request for payment from an external token
- provided with an ideal transaction. Make sure your iDEAL payments are
- compliant with the iDEAL standards, by following the following manual:
- https://www.bunq.com/terms-idealstandards. It's very important to keep these
- points in mind when you are using the endpoint to make iDEAL payments from
- your application.
+ Used to manage Slice group payment.
- :param _token: The token passed from a site or read from a QR code.
- :type _token: str
- :param _id_: The id of the RequestResponse.
- :type _id_: int
- :param _time_responded: The timestamp of when the RequestResponse was
- responded to.
- :type _time_responded: str
- :param _time_expiry: The timestamp of when the RequestResponse expired or
- will expire.
- :type _time_expiry: str
- :param _monetary_account_id: The id of the MonetaryAccount the
- RequestResponse was received on.
- :type _monetary_account_id: int
- :param _amount_inquired: The requested Amount.
- :type _amount_inquired: object_.Amount
- :param _amount_responded: The Amount the RequestResponse was accepted with.
- :type _amount_responded: object_.Amount
- :param _alias: The LabelMonetaryAccount with the public information of the
- MonetaryAccount this RequestResponse was received on.
- :type _alias: object_.MonetaryAccountReference
- :param _counterparty_alias: The LabelMonetaryAccount with the public
- information of the MonetaryAccount that is requesting money with this
- RequestResponse.
- :type _counterparty_alias: object_.MonetaryAccountReference
- :param _description: The description for the RequestResponse provided by the
- requesting party. Maximum 9000 characters.
+ :param _alias_owner: The Alias of the party we are allocating money for.
+ :type _alias_owner: object_.Pointer
+ :param _amount: The Amount of the RegistryEntry.
+ :type _amount: object_.Amount
+ :param _object_reference: The object linked to the RegistryEntry.
+ :type _object_reference: object_.RegistryEntryReference
+ :param _description: A description about the RegistryEntry.
:type _description: str
- :param _attachment: The Attachments attached to the RequestResponse.
- :type _attachment: list[object_.Attachment]
- :param _status: The status of the created RequestResponse. Can only be
- PENDING.
+ :param _allocations: An array of AllocationItems.
+ :type _allocations: list[object_.AllocationItem]
+ :param _attachment: The attachments attached to the payment.
+ :type _attachment: list[object_.RegistryEntryAttachment]
+ :param _id_: The id of the RegistryEntry.
+ :type _id_: int
+ :param _created: The timestamp of the MonetaryAccountBank's creation.
+ :type _created: str
+ :param _updated: The timestamp of the MonetaryAccountBank's last update.
+ :type _updated: str
+ :param _registry_id: The id of the Registry.
+ :type _registry_id: int
+ :param _status: The status of the RegistryEntry.
:type _status: str
- :param _minimum_age: The minimum age the user accepting the RequestResponse
- must have.
- :type _minimum_age: int
- :param _require_address: Whether or not an address must be provided on
- accept.
- :type _require_address: str
- :param _address_shipping: The shipping address provided by the accepting
- user if an address was requested.
- :type _address_shipping: object_.Address
- :param _address_billing: The billing address provided by the accepting user
- if an address was requested.
- :type _address_billing: object_.Address
- :param _geolocation: The Geolocation where the RequestResponse was created.
- :type _geolocation: object_.Geolocation
- :param _redirect_url: The URL which the user is sent to after accepting or
- rejecting the Request.
- :type _redirect_url: str
- :param _type_: The type of the RequestResponse. Can be only be IDEAL.
+ :param _type_: The RegistryEntry type. AUTO if created by Auto Slice, MANUAL
+ for manually added entries.
:type _type_: str
- :param _sub_type: The subtype of the RequestResponse. Can be only be NONE.
- :type _sub_type: str
- :param _allow_chat: Whether or not chat messages are allowed.
- :type _allow_chat: bool
- :param _eligible_whitelist_id: The whitelist id for this action or null.
- :type _eligible_whitelist_id: int
+ :param _alias: The LabelUser with the public information of the party of
+ this RegistryEntry.
+ :type _alias: object_.LabelUser
+ :param _counterparty_alias: The LabelUser with the public information of the
+ counter party of this RegistryEntry.
+ :type _counterparty_alias: object_.LabelUser
+ :param _user_alias_created: The LabelUser with the public information of the
+ User that created the RegistryEntry.
+ :type _user_alias_created: object_.LabelUser
+ :param _membership_created: The membership of the creator.
+ :type _membership_created: RegistryMembership
+ :param _membership_owned: The membership of the owner.
+ :type _membership_owned: RegistryMembership
+ :param _object_: The object that is connected to this RegistryEntry.
+ :type _object_: core.BunqModel
"""
# Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/token-qr-request-ideal"
+ _ENDPOINT_URL_CREATE = "user/{}/registry/{}/registry-entry"
+ _ENDPOINT_URL_UPDATE = "user/{}/registry/{}/registry-entry/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/registry/{}/registry-entry"
+ _ENDPOINT_URL_READ = "user/{}/registry/{}/registry-entry/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/registry/{}/registry-entry/{}"
# Field constants.
- FIELD_TOKEN = "token"
+ FIELD_ALIAS_OWNER = "alias_owner"
+ FIELD_AMOUNT = "amount"
+ FIELD_OBJECT_REFERENCE = "object_reference"
+ FIELD_DESCRIPTION = "description"
+ FIELD_ALLOCATIONS = "allocations"
+ FIELD_ATTACHMENT = "attachment"
# Object type.
- _OBJECT_TYPE_POST = "RequestResponse"
+ _OBJECT_TYPE_GET = "RegistryEntry"
_id_ = None
- _time_responded = None
- _time_expiry = None
- _monetary_account_id = None
- _amount_inquired = None
- _amount_responded = None
+ _created = None
+ _updated = None
+ _registry_id = None
+ _status = None
+ _amount = None
+ _description = None
+ _type_ = None
_alias = None
_counterparty_alias = None
- _description = None
+ _user_alias_created = None
+ _membership_created = None
+ _membership_owned = None
+ _allocations = None
+ _object_ = None
_attachment = None
- _status = None
- _minimum_age = None
- _require_address = None
- _address_shipping = None
- _address_billing = None
- _geolocation = None
- _redirect_url = None
- _type_ = None
- _sub_type = None
- _allow_chat = None
- _eligible_whitelist_id = None
- _token_field_for_request = None
+ _alias_owner_field_for_request = None
+ _amount_field_for_request = None
+ _object_reference_field_for_request = None
+ _description_field_for_request = None
+ _allocations_field_for_request = None
+ _attachment_field_for_request = None
- def __init__(self, token):
+ def __init__(self, amount, allocations=None, alias_owner=None, object_reference=None, description=None,
+ attachment=None):
"""
- :param token: The token passed from a site or read from a QR code.
- :type token: str
+ :param amount: The Amount of the RegistryEntry.
+ :type amount: object_.Amount
+ :param allocations: An array of AllocationItems.
+ :type allocations: list[object_.AllocationItem]
+ :param alias_owner: The Alias of the party we are allocating money for.
+ :type alias_owner: object_.Pointer
+ :param object_reference: The object linked to the RegistryEntry.
+ :type object_reference: object_.RegistryEntryReference
+ :param description: A description about the RegistryEntry.
+ :type description: str
+ :param attachment: The attachments attached to the payment.
+ :type attachment: list[object_.RegistryEntryAttachment]
"""
- self._token_field_for_request = token
+ self._amount_field_for_request = amount
+ self._allocations_field_for_request = allocations
+ self._alias_owner_field_for_request = alias_owner
+ self._object_reference_field_for_request = object_reference
+ self._description_field_for_request = description
+ self._attachment_field_for_request = attachment
@classmethod
- def create(cls, token, custom_headers=None):
+ def create(cls, registry_id, amount, allocations, alias_owner=None, object_reference=None, description=None,
+ attachment=None, custom_headers=None):
"""
- Create a request from an ideal transaction.
+ Create a new Slice group payment.
:type user_id: int
- :param token: The token passed from a site or read from a QR code.
- :type token: str
+ :type registry_id: int
+ :param amount: The Amount of the RegistryEntry.
+ :type amount: object_.Amount
+ :param allocations: An array of AllocationItems.
+ :type allocations: list[object_.AllocationItem]
+ :param alias_owner: The Alias of the party we are allocating money for.
+ :type alias_owner: object_.Pointer
+ :param object_reference: The object linked to the RegistryEntry.
+ :type object_reference: object_.RegistryEntryReference
+ :param description: A description about the RegistryEntry.
+ :type description: str
+ :param attachment: The attachments attached to the payment.
+ :type attachment: list[object_.RegistryEntryAttachment]
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseTokenQrRequestIdeal
+ :rtype: BunqResponseInt
"""
if custom_headers is None:
custom_headers = {}
request_map = {
- cls.FIELD_TOKEN: token
+ cls.FIELD_ALIAS_OWNER: alias_owner,
+ cls.FIELD_AMOUNT: amount,
+ cls.FIELD_OBJECT_REFERENCE: object_reference,
+ cls.FIELD_DESCRIPTION: description,
+ cls.FIELD_ALLOCATIONS: allocations,
+ cls.FIELD_ATTACHMENT: attachment
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
api_client = ApiClient(cls._get_api_context())
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(), registry_id)
response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
- return BunqResponseTokenQrRequestIdeal.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_POST)
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
)
- @property
- def id_(self):
+ @classmethod
+ def update(cls, registry_id, registry_entry_id, description=None, allocations=None, attachment=None,
+ custom_headers=None):
"""
- :rtype: int
+ Update a specific Slice group payment.
+
+ :type user_id: int
+ :type registry_id: int
+ :type registry_entry_id: int
+ :param description: A description about the RegistryEntry.
+ :type description: str
+ :param allocations: An array of AllocationItems.
+ :type allocations: list[object_.AllocationItem]
+ :param attachment: The attachments attached to the payment.
+ :type attachment: list[object_.RegistryEntryAttachment]
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
"""
- return self._id_
+ if custom_headers is None:
+ custom_headers = {}
- @property
- def time_responded(self):
- """
- :rtype: str
- """
+ api_client = ApiClient(cls._get_api_context())
- return self._time_responded
+ request_map = {
+ cls.FIELD_DESCRIPTION: description,
+ cls.FIELD_ALLOCATIONS: allocations,
+ cls.FIELD_ATTACHMENT: attachment
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
- @property
- def time_expiry(self):
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(), registry_id, registry_entry_id)
+ response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
+
+ @classmethod
+ def list(cls, registry_id, params=None, custom_headers=None):
"""
- :rtype: str
+ Get a listing of all Slice group payments.
+
+ :type user_id: int
+ :type registry_id: int
+ :type params: dict[str, str]|None
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseRegistryEntryList
"""
- return self._time_expiry
+ if params is None:
+ params = {}
- @property
- def monetary_account_id(self):
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(), registry_id)
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
+
+ return BunqResponseRegistryEntryList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @classmethod
+ def get(cls, registry_id, registry_entry_id, custom_headers=None):
"""
- :rtype: int
+ Get a specific Slice group payment.
+
+ :type api_context: ApiContext
+ :type user_id: int
+ :type registry_id: int
+ :type registry_entry_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseRegistryEntry
"""
- return self._monetary_account_id
+ if custom_headers is None:
+ custom_headers = {}
- @property
- def amount_inquired(self):
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), registry_id, registry_entry_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponseRegistryEntry.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @classmethod
+ def delete(cls, registry_id, registry_entry_id, custom_headers=None):
"""
- :rtype: object_.Amount
+ Delete a specific Slice group payment.
+
+ :type user_id: int
+ :type registry_id: int
+ :type registry_entry_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseNone
"""
- return self._amount_inquired
+ if custom_headers is None:
+ custom_headers = {}
- @property
- def amount_responded(self):
- """
- :rtype: object_.Amount
- """
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(), registry_id, registry_entry_id)
+ response_raw = api_client.delete(endpoint_url, custom_headers)
- return self._amount_responded
+ return BunqResponseNone.cast_from_bunq_response(
+ BunqResponse(None, response_raw.headers)
+ )
@property
- def alias(self):
+ def id_(self):
"""
- :rtype: object_.MonetaryAccountReference
+ :rtype: int
"""
- return self._alias
+ return self._id_
@property
- def counterparty_alias(self):
+ def created(self):
"""
- :rtype: object_.MonetaryAccountReference
+ :rtype: str
"""
- return self._counterparty_alias
+ return self._created
@property
- def description(self):
+ def updated(self):
"""
:rtype: str
"""
- return self._description
+ return self._updated
@property
- def attachment(self):
+ def registry_id(self):
"""
- :rtype: list[object_.Attachment]
+ :rtype: int
"""
- return self._attachment
+ return self._registry_id
@property
def status(self):
@@ -35032,84 +37897,92 @@ def status(self):
return self._status
@property
- def minimum_age(self):
+ def amount(self):
"""
- :rtype: int
+ :rtype: object_.Amount
"""
- return self._minimum_age
+ return self._amount
@property
- def require_address(self):
+ def description(self):
"""
:rtype: str
"""
- return self._require_address
+ return self._description
@property
- def address_shipping(self):
+ def type_(self):
"""
- :rtype: object_.Address
+ :rtype: str
"""
- return self._address_shipping
+ return self._type_
@property
- def address_billing(self):
+ def alias(self):
"""
- :rtype: object_.Address
+ :rtype: object_.LabelUser
"""
- return self._address_billing
+ return self._alias
@property
- def geolocation(self):
+ def counterparty_alias(self):
"""
- :rtype: object_.Geolocation
+ :rtype: object_.LabelUser
"""
- return self._geolocation
+ return self._counterparty_alias
@property
- def redirect_url(self):
+ def user_alias_created(self):
"""
- :rtype: str
+ :rtype: object_.LabelUser
"""
- return self._redirect_url
+ return self._user_alias_created
@property
- def type_(self):
+ def membership_created(self):
"""
- :rtype: str
+ :rtype: RegistryMembership
"""
- return self._type_
+ return self._membership_created
@property
- def sub_type(self):
+ def membership_owned(self):
"""
- :rtype: str
+ :rtype: RegistryMembership
"""
- return self._sub_type
+ return self._membership_owned
@property
- def allow_chat(self):
+ def allocations(self):
"""
- :rtype: bool
+ :rtype: list[object_.AllocationItem]
"""
- return self._allow_chat
+ return self._allocations
@property
- def eligible_whitelist_id(self):
+ def object_(self):
"""
- :rtype: int
+ :rtype: core.BunqModel
"""
- return self._eligible_whitelist_id
+ return self._object_
+
+ @property
+ def attachment(self):
+ """
+ :rtype: list[object_.RegistryEntryAttachment]
+ """
+
+ return self._attachment
def is_all_field_none(self):
"""
@@ -35119,64 +37992,49 @@ def is_all_field_none(self):
if self._id_ is not None:
return False
- if self._time_responded is not None:
- return False
-
- if self._time_expiry is not None:
- return False
-
- if self._monetary_account_id is not None:
+ if self._created is not None:
return False
- if self._amount_inquired is not None:
+ if self._updated is not None:
return False
- if self._amount_responded is not None:
+ if self._registry_id is not None:
return False
- if self._alias is not None:
+ if self._status is not None:
return False
- if self._counterparty_alias is not None:
+ if self._amount is not None:
return False
if self._description is not None:
return False
- if self._attachment is not None:
- return False
-
- if self._status is not None:
- return False
-
- if self._minimum_age is not None:
- return False
-
- if self._require_address is not None:
+ if self._type_ is not None:
return False
- if self._address_shipping is not None:
+ if self._alias is not None:
return False
- if self._address_billing is not None:
+ if self._counterparty_alias is not None:
return False
- if self._geolocation is not None:
+ if self._user_alias_created is not None:
return False
- if self._redirect_url is not None:
+ if self._membership_created is not None:
return False
- if self._type_ is not None:
+ if self._membership_owned is not None:
return False
- if self._sub_type is not None:
+ if self._allocations is not None:
return False
- if self._allow_chat is not None:
+ if self._object_ is not None:
return False
- if self._eligible_whitelist_id is not None:
+ if self._attachment is not None:
return False
return True
@@ -35186,76 +38044,99 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: TokenQrRequestIdeal
+ :rtype: RegistryEntry
"""
- return converter.json_to_class(TokenQrRequestIdeal, json_str)
+ return converter.json_to_class(RegistryEntry, json_str)
-class TokenQrRequestSofort(BunqModel):
+class RegistryMembership(BunqModel):
"""
- Using this call you can create a SOFORT Request assigned to your User by
- providing the Token of the request.
+ View for RegistryMembership.
- :param _token: The token passed from a site or read from a QR code.
- :type _token: str
+ :param _alias: The LabelMonetaryAccount of the user who belongs to this
+ RegistryMembership.
+ :type _alias: object_.MonetaryAccountReference
+ :param _status: The status of the RegistryMembership.
+ :type _status: str
+ :param _balance: The balance of this RegistryMembership.
+ :type _balance: object_.Amount
+ :param _total_amount_spent: The total amount spent of this
+ RegistryMembership.
+ :type _total_amount_spent: object_.Amount
"""
- # Endpoint constants.
- _ENDPOINT_URL_CREATE = "user/{}/token-qr-request-sofort"
-
# Field constants.
- FIELD_TOKEN = "token"
+ FIELD_ALIAS = "alias"
+ FIELD_STATUS = "status"
- # Object type.
- _OBJECT_TYPE_POST = "RequestResponse"
+ _alias = None
+ _balance = None
+ _total_amount_spent = None
+ _status = None
+ _alias_field_for_request = None
+ _status_field_for_request = None
- _token_field_for_request = None
+ def __init__(self, alias=None, status=None):
+ """
+ :param alias: The Alias of the party we are inviting to the Registry.
+ :type alias: object_.Pointer
+ :param status: The status of the RegistryMembership.
+ :type status: str
+ """
- def __init__(self, token):
+ self._alias_field_for_request = alias
+ self._status_field_for_request = status
+
+ @property
+ def alias(self):
"""
- :param token: The token passed from a site or read from a QR code.
- :type token: str
+ :rtype: object_.MonetaryAccountReference
"""
- self._token_field_for_request = token
+ return self._alias
- @classmethod
- def create(cls, token, custom_headers=None):
+ @property
+ def balance(self):
"""
- Create a request from an SOFORT transaction.
-
- :type user_id: int
- :param token: The token passed from a site or read from a QR code.
- :type token: str
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseTokenQrRequestSofort
+ :rtype: object_.Amount
"""
- if custom_headers is None:
- custom_headers = {}
+ return self._balance
- request_map = {
- cls.FIELD_TOKEN: token
- }
- request_map_string = converter.class_to_json(request_map)
- request_map_string = cls._remove_field_for_request(request_map_string)
+ @property
+ def total_amount_spent(self):
+ """
+ :rtype: object_.Amount
+ """
- api_client = ApiClient(cls._get_api_context())
- request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id())
- response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+ return self._total_amount_spent
- return BunqResponseTokenQrRequestSofort.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_POST)
- )
+ @property
+ def status(self):
+ """
+ :rtype: str
+ """
+
+ return self._status
def is_all_field_none(self):
"""
:rtype: bool
"""
+ if self._alias is not None:
+ return False
+
+ if self._balance is not None:
+ return False
+
+ if self._total_amount_spent is not None:
+ return False
+
+ if self._status is not None:
+ return False
+
return True
@staticmethod
@@ -35263,81 +38144,117 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: TokenQrRequestSofort
+ :rtype: RegistryMembership
"""
- return converter.json_to_class(TokenQrRequestSofort, json_str)
+ return converter.json_to_class(RegistryMembership, json_str)
-class TreeProgress(BunqModel):
+class RegistrySetting(BunqModel):
"""
- See how many trees this user has planted.
+ Used to manage Slice group settings.
- :param _number_of_tree: The number of trees this user and all users have
- planted.
- :type _number_of_tree: float
- :param _progress_tree_next: The progress towards the next tree.
- :type _progress_tree_next: float
+ :param _auto_add_card_transaction: The setting for for adding automatically
+ card transactions to the registry.
+ :type _auto_add_card_transaction: str
"""
# Endpoint constants.
- _ENDPOINT_URL_LISTING = "user/{}/tree-progress"
+ _ENDPOINT_URL_UPDATE = "user/{}/registry/{}/registry-setting/{}"
+ _ENDPOINT_URL_READ = "user/{}/registry/{}/registry-setting/{}"
+
+ # Field constants.
+ FIELD_AUTO_ADD_CARD_TRANSACTION = "auto_add_card_transaction"
# Object type.
- _OBJECT_TYPE_GET = "TreeProgress"
+ _OBJECT_TYPE_GET = "RegistrySetting"
- _number_of_tree = None
- _progress_tree_next = None
+ _auto_add_card_transaction = None
+ _auto_add_card_transaction_field_for_request = None
+
+ def __init__(self, auto_add_card_transaction=None):
+ """
+ :param auto_add_card_transaction: The setting for for adding automatically
+ card transactions to the registry.
+ :type auto_add_card_transaction: str
+ """
+
+ self._auto_add_card_transaction_field_for_request = auto_add_card_transaction
@classmethod
- def list(cls, params=None, custom_headers=None):
+ def update(cls, registry_id, registry_setting_id, auto_add_card_transaction=None, custom_headers=None):
"""
+ Update a specific Slice group setting.
+
:type user_id: int
- :type params: dict[str, str]|None
+ :type registry_id: int
+ :type registry_setting_id: int
+ :param auto_add_card_transaction: The setting for for adding
+ automatically card transactions to the registry.
+ :type auto_add_card_transaction: str
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseTreeProgressList
+ :rtype: BunqResponseInt
"""
- if params is None:
- params = {}
-
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
- response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseTreeProgressList.cast_from_bunq_response(
- cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ request_map = {
+ cls.FIELD_AUTO_ADD_CARD_TRANSACTION: auto_add_card_transaction
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(), registry_id, registry_setting_id)
+ response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
)
- @property
- def number_of_tree(self):
+ @classmethod
+ def get(cls, registry_id, registry_setting_id, custom_headers=None):
"""
- :rtype: float
+ Get a specific Slice group setting.
+
+ :type api_context: ApiContext
+ :type user_id: int
+ :type registry_id: int
+ :type registry_setting_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseRegistrySetting
"""
- return self._number_of_tree
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), registry_id, registry_setting_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponseRegistrySetting.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
@property
- def progress_tree_next(self):
+ def auto_add_card_transaction(self):
"""
- :rtype: float
+ :rtype: str
"""
- return self._progress_tree_next
+ return self._auto_add_card_transaction
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._number_of_tree is not None:
- return False
-
- if self._progress_tree_next is not None:
+ if self._auto_add_card_transaction is not None:
return False
return True
@@ -35347,39 +38264,39 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: TreeProgress
+ :rtype: RegistrySetting
"""
- return converter.json_to_class(TreeProgress, json_str)
+ return converter.json_to_class(RegistrySetting, json_str)
-class UserCompanyName(BunqModel):
+class RegistrySettlementPending(BunqModel):
"""
- Endpoint for getting all the known (trade) names for a user company. This is
- needed for updating the user name, as we only accept legal or trade names.
+ Used to manage pending Slice group settlements.
- :param _name_array: All known (trade) names for a user company.
- :type _name_array: list[str]
+ :param _items: List of RegistrySettlementItems
+ :type _items: list[object_.RegistrySettlementItem]
"""
# Endpoint constants.
- _ENDPOINT_URL_LISTING = "user-company/{}/name"
+ _ENDPOINT_URL_LISTING = "user/{}/registry/{}/registry-settlement-pending"
# Object type.
- _OBJECT_TYPE_GET = "UserCompanyNameArray"
+ _OBJECT_TYPE_GET = "RegistrySettlementPending"
- _name_array = None
+ _items = None
@classmethod
- def list(cls, user_company_id, params=None, custom_headers=None):
+ def list(cls, registry_id, params=None, custom_headers=None):
"""
- Return all the known (trade) names for a specific user company.
+ Get a listing of all pending Slice group settlements.
- :type user_company_id: int
+ :type user_id: int
+ :type registry_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseUserCompanyNameList
+ :rtype: BunqResponseRegistrySettlementPendingList
"""
if params is None:
@@ -35389,27 +38306,27 @@ def list(cls, user_company_id, params=None, custom_headers=None):
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(), registry_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseUserCompanyNameList.cast_from_bunq_response(
+ return BunqResponseRegistrySettlementPendingList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@property
- def name_array(self):
+ def items(self):
"""
- :rtype: list[str]
+ :rtype: list[object_.RegistrySettlementItem]
"""
- return self._name_array
+ return self._items
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._name_array is not None:
+ if self._items is not None:
return False
return True
@@ -35419,81 +38336,124 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: UserCompanyName
+ :rtype: RegistrySettlementPending
"""
- return converter.json_to_class(UserCompanyName, json_str)
+ return converter.json_to_class(RegistrySettlementPending, json_str)
-class UserCredentialPasswordIp(BunqModel):
+class RegistrySettlement(BunqModel):
"""
- Create a credential of a user for server authentication, or delete the
- credential of a user for server authentication.
+ Used to settle a Slice group.
- :param _id_: The id of the credential.
+ :param _id_: The id of the RegistrySettlement.
:type _id_: int
- :param _created: The timestamp of the credential object's creation.
+ :param _created: The timestamp of the RegistrySettlement's creation.
:type _created: str
- :param _updated: The timestamp of the credential object's last update.
+ :param _updated: The timestamp of the RegistrySettlement's last update.
:type _updated: str
- :param _status: The status of the credential.
- :type _status: str
- :param _expiry_time: When the status is PENDING_FIRST_USE: when the
- credential expires.
- :type _expiry_time: str
- :param _token_value: When the status is PENDING_FIRST_USE: the value of the
- token.
- :type _token_value: str
- :param _permitted_device: When the status is ACTIVE: the details of the
- device that may use the credential.
- :type _permitted_device: object_.PermittedDevice
+ :param _settlement_time: The timestamp of the Registry's settlement.
+ :type _settlement_time: str
+ :param _total_amount_spent: The total amount spent for the
+ RegistrySettlement.
+ :type _total_amount_spent: object_.Amount
+ :param _number_of_entries: The number of RegistryEntry's associated with
+ this RegistrySettlement.
+ :type _number_of_entries: int
+ :param _settled_by_alias: The membership of the user that settled the
+ Registry.
+ :type _settled_by_alias: RegistryMembership
+ :param _membership_settled: The membership of the user that has settled the
+ registry.
+ :type _membership_settled: RegistryMembership
+ :param _items: List of RegistrySettlementItems
+ :type _items: list[object_.RegistrySettlementItem]
"""
# Endpoint constants.
- _ENDPOINT_URL_READ = "user/{}/credential-password-ip/{}"
- _ENDPOINT_URL_LISTING = "user/{}/credential-password-ip"
+ _ENDPOINT_URL_CREATE = "user/{}/registry/{}/registry-settlement"
+ _ENDPOINT_URL_READ = "user/{}/registry/{}/registry-settlement/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/registry/{}/registry-settlement"
# Object type.
- _OBJECT_TYPE_GET = "CredentialPasswordIp"
+ _OBJECT_TYPE_GET = "RegistrySettlement"
_id_ = None
_created = None
_updated = None
- _status = None
- _expiry_time = None
- _token_value = None
- _permitted_device = None
+ _settlement_time = None
+ _total_amount_spent = None
+ _number_of_entries = None
+ _settled_by_alias = None
+ _membership_settled = None
+ _items = None
@classmethod
- def get(cls, user_credential_password_ip_id, custom_headers=None):
+ def create(cls, registry_id, custom_headers=None):
+ """
+ Create a new Slice group settlement.
+
+ :type user_id: int
+ :type registry_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseInt
+ """
+
+ if custom_headers is None:
+ custom_headers = {}
+
+ request_map = {
+
+ }
+ request_map_string = converter.class_to_json(request_map)
+ request_map_string = cls._remove_field_for_request(request_map_string)
+
+ api_client = ApiClient(cls._get_api_context())
+ request_bytes = request_map_string.encode()
+ endpoint_url = cls._ENDPOINT_URL_CREATE.format(cls._determine_user_id(), registry_id)
+ response_raw = api_client.post(endpoint_url, request_bytes, custom_headers)
+
+ return BunqResponseInt.cast_from_bunq_response(
+ cls._process_for_id(response_raw)
+ )
+
+ @classmethod
+ def get(cls, registry_id, registry_settlement_id, custom_headers=None):
"""
+ Get a specific Slice group settlement.
+
:type api_context: ApiContext
:type user_id: int
- :type user_credential_password_ip_id: int
+ :type registry_id: int
+ :type registry_settlement_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseUserCredentialPasswordIp
+ :rtype: BunqResponseRegistrySettlement
"""
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), user_credential_password_ip_id)
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), registry_id, registry_settlement_id)
response_raw = api_client.get(endpoint_url, {}, custom_headers)
- return BunqResponseUserCredentialPasswordIp.cast_from_bunq_response(
+ return BunqResponseRegistrySettlement.cast_from_bunq_response(
cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def list(cls, params=None, custom_headers=None):
+ def list(cls, registry_id, params=None, custom_headers=None):
"""
+ Get a listing of all Slice group settlements.
+
:type user_id: int
+ :type registry_id: int
:type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseUserCredentialPasswordIpList
+ :rtype: BunqResponseRegistrySettlementList
"""
if params is None:
@@ -35503,10 +38463,10 @@ def list(cls, params=None, custom_headers=None):
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id(), registry_id)
response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseUserCredentialPasswordIpList.cast_from_bunq_response(
+ return BunqResponseRegistrySettlementList.cast_from_bunq_response(
cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@@ -35535,36 +38495,52 @@ def updated(self):
return self._updated
@property
- def status(self):
+ def settlement_time(self):
"""
:rtype: str
"""
- return self._status
+ return self._settlement_time
@property
- def expiry_time(self):
+ def total_amount_spent(self):
"""
- :rtype: str
+ :rtype: object_.Amount
"""
- return self._expiry_time
+ return self._total_amount_spent
@property
- def token_value(self):
+ def number_of_entries(self):
"""
- :rtype: str
+ :rtype: int
"""
- return self._token_value
+ return self._number_of_entries
@property
- def permitted_device(self):
+ def settled_by_alias(self):
"""
- :rtype: object_.PermittedDevice
+ :rtype: RegistryMembership
"""
- return self._permitted_device
+ return self._settled_by_alias
+
+ @property
+ def membership_settled(self):
+ """
+ :rtype: RegistryMembership
+ """
+
+ return self._membership_settled
+
+ @property
+ def items(self):
+ """
+ :rtype: list[object_.RegistrySettlementItem]
+ """
+
+ return self._items
def is_all_field_none(self):
"""
@@ -35580,85 +38556,22 @@ def is_all_field_none(self):
if self._updated is not None:
return False
- if self._status is not None:
+ if self._settlement_time is not None:
return False
- if self._expiry_time is not None:
+ if self._total_amount_spent is not None:
return False
- if self._token_value is not None:
+ if self._number_of_entries is not None:
return False
- if self._permitted_device is not None:
+ if self._settled_by_alias is not None:
return False
- return True
-
- @staticmethod
- def from_json(json_str):
- """
- :type json_str: str
-
- :rtype: UserCredentialPasswordIp
- """
-
- return converter.json_to_class(UserCredentialPasswordIp, json_str)
-
-
-class UserLegalName(BunqModel):
- """
- Endpoint for getting available legal names that can be used by the user.
-
- :param _legal_names: All legal names that can be used by the user
- :type _legal_names: list[str]
- """
-
- # Endpoint constants.
- _ENDPOINT_URL_LISTING = "user/{}/legal-name"
-
- # Object type.
- _OBJECT_TYPE_GET = "UserLegalNameArray"
-
- _legal_names = None
-
- @classmethod
- def list(cls, params=None, custom_headers=None):
- """
- :type user_id: int
- :type params: dict[str, str]|None
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseUserLegalNameList
- """
-
- if params is None:
- params = {}
-
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
- response_raw = api_client.get(endpoint_url, params, custom_headers)
-
- return BunqResponseUserLegalNameList.cast_from_bunq_response(
- cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
- )
-
- @property
- def legal_names(self):
- """
- :rtype: list[str]
- """
-
- return self._legal_names
-
- def is_all_field_none(self):
- """
- :rtype: bool
- """
+ if self._membership_settled is not None:
+ return False
- if self._legal_names is not None:
+ if self._items is not None:
return False
return True
@@ -35668,130 +38581,157 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: UserLegalName
+ :rtype: RegistrySettlement
"""
- return converter.json_to_class(UserLegalName, json_str)
+ return converter.json_to_class(RegistrySettlement, json_str)
-class WhitelistSdd(BunqModel):
+class Registry(BunqModel):
"""
- Whitelist an SDD so that when one comes in, it is automatically accepted.
+ Used to manage Slice groups.
- :param _monetary_account_paying_id: The account from which payments will be
- deducted when a transaction is matched with this whitelist.
- :type _monetary_account_paying_id: int
- :param _request_id: ID of the request for which you want to whitelist the
- originating SDD.
- :type _request_id: int
- :param _maximum_amount_per_month: The monthly maximum amount that can be
- deducted from the target account.
- :type _maximum_amount_per_month: object_.Amount
- :param _id_: The ID of the whitelist entry.
- :type _id_: int
- :param _monetary_account_incoming_id: The account to which payments will
- come in before possibly being 'redirected' by the whitelist.
- :type _monetary_account_incoming_id: int
- :param _type_: The type of the SDD whitelist, can be CORE or B2B.
- :type _type_: str
- :param _status: The status of the whitelist.
+ :param _currency: The currency for the Registry as an ISO 4217 formatted
+ currency code.
+ :type _currency: str
+ :param _title: The title of the Registry.
+ :type _title: str
+ :param _description: A description about the Registry.
+ :type _description: str
+ :param _status: The status of the Registry.
:type _status: str
- :param _credit_scheme_identifier: The credit scheme ID provided by the
- counterparty.
- :type _credit_scheme_identifier: str
- :param _mandate_identifier: The mandate ID provided by the counterparty.
- :type _mandate_identifier: str
- :param _counterparty_alias: The account to which payments will be paid.
- :type _counterparty_alias: object_.MonetaryAccountReference
- :param _user_alias_created: The user who created the whitelist entry.
- :type _user_alias_created: object_.LabelUser
+ :param _last_registry_entry_seen_id: The id of the last RegistryEntry that
+ the user has seen.
+ :type _last_registry_entry_seen_id: int
+ :param _previous_updated_timestamp: The previous updated timestamp that you
+ received for this Registry.
+ :type _previous_updated_timestamp: str
+ :param _memberships: List of memberships to replace the current one.
+ :type _memberships: list[RegistryMembership]
+ :param _memberships_previous: Previous list of memberships.
+ :type _memberships_previous: list[RegistryMembership]
+ :param _id_: The id of the Registry.
+ :type _id_: int
+ :param _created: The timestamp of the Registry's creation.
+ :type _created: str
+ :param _updated: The timestamp of the Registry's last update.
+ :type _updated: str
+ :param _unseen_entries_count: The number of RegistryEntries in this Registry
+ that the user has not seen.
+ :type _unseen_entries_count: int
+ :param _total_amount_spent: The total amount spent in this Registry since
+ the last settlement.
+ :type _total_amount_spent: object_.Amount
+ :param _is_previously_settled: Whether the Registry has previously been
+ settled.
+ :type _is_previously_settled: bool
+ :param _setting: The settings for this Registry.
+ :type _setting: RegistrySetting
+ :param _registry_auto_add_card_transaction_enabled_id: The ID of the
+ registry that currently has auto_add_card_transaction set to ALL.
+ :type _registry_auto_add_card_transaction_enabled_id: int
"""
# Endpoint constants.
- _ENDPOINT_URL_READ = "user/{}/whitelist-sdd/{}"
- _ENDPOINT_URL_CREATE = "user/{}/whitelist-sdd"
- _ENDPOINT_URL_UPDATE = "user/{}/whitelist-sdd/{}"
- _ENDPOINT_URL_DELETE = "user/{}/whitelist-sdd/{}"
- _ENDPOINT_URL_LISTING = "user/{}/whitelist-sdd"
+ _ENDPOINT_URL_CREATE = "user/{}/registry"
+ _ENDPOINT_URL_UPDATE = "user/{}/registry/{}"
+ _ENDPOINT_URL_LISTING = "user/{}/registry"
+ _ENDPOINT_URL_READ = "user/{}/registry/{}"
+ _ENDPOINT_URL_DELETE = "user/{}/registry/{}"
# Field constants.
- FIELD_MONETARY_ACCOUNT_PAYING_ID = "monetary_account_paying_id"
- FIELD_REQUEST_ID = "request_id"
- FIELD_MAXIMUM_AMOUNT_PER_MONTH = "maximum_amount_per_month"
+ FIELD_CURRENCY = "currency"
+ FIELD_TITLE = "title"
+ FIELD_DESCRIPTION = "description"
+ FIELD_STATUS = "status"
+ FIELD_LAST_REGISTRY_ENTRY_SEEN_ID = "last_registry_entry_seen_id"
+ FIELD_PREVIOUS_UPDATED_TIMESTAMP = "previous_updated_timestamp"
+ FIELD_MEMBERSHIPS = "memberships"
+ FIELD_MEMBERSHIPS_PREVIOUS = "memberships_previous"
# Object type.
- _OBJECT_TYPE_GET = "WhitelistSdd"
+ _OBJECT_TYPE_GET = "Registry"
_id_ = None
- _monetary_account_incoming_id = None
- _monetary_account_paying_id = None
- _type_ = None
+ _created = None
+ _updated = None
+ _currency = None
+ _title = None
_status = None
- _credit_scheme_identifier = None
- _mandate_identifier = None
- _counterparty_alias = None
- _maximum_amount_per_month = None
- _user_alias_created = None
- _monetary_account_paying_id_field_for_request = None
- _request_id_field_for_request = None
- _maximum_amount_per_month_field_for_request = None
-
- def __init__(self, request_id, monetary_account_paying_id=None, maximum_amount_per_month=None):
- """
- :param monetary_account_paying_id: ID of the monetary account of which you
- want to pay from.
- :type monetary_account_paying_id: int
- :param request_id: ID of the request for which you want to whitelist the
- originating SDD.
- :type request_id: int
- :param maximum_amount_per_month: The maximum amount of money that is allowed
- to be deducted based on the whitelist.
- :type maximum_amount_per_month: object_.Amount
- """
-
- self._monetary_account_paying_id_field_for_request = monetary_account_paying_id
- self._request_id_field_for_request = request_id
- self._maximum_amount_per_month_field_for_request = maximum_amount_per_month
+ _unseen_entries_count = None
+ _total_amount_spent = None
+ _is_previously_settled = None
+ _memberships = None
+ _setting = None
+ _registry_auto_add_card_transaction_enabled_id = None
+ _currency_field_for_request = None
+ _title_field_for_request = None
+ _description_field_for_request = None
+ _status_field_for_request = None
+ _last_registry_entry_seen_id_field_for_request = None
+ _previous_updated_timestamp_field_for_request = None
+ _memberships_field_for_request = None
+ _memberships_previous_field_for_request = None
- @classmethod
- def get(cls, whitelist_sdd_id, custom_headers=None):
+ def __init__(self, currency, title=None, description=None, status=None, last_registry_entry_seen_id=None,
+ previous_updated_timestamp=None, memberships=None, memberships_previous=None):
"""
- Get a specific SDD whitelist entry.
-
- :type api_context: ApiContext
- :type user_id: int
- :type whitelist_sdd_id: int
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseWhitelistSdd
+ :param currency: The currency for the Registry as an ISO 4217 formatted
+ currency code.
+ :type currency: str
+ :param title: The title of the Registry.
+ :type title: str
+ :param description: A description about the Registry.
+ :type description: str
+ :param status: The status of the Registry.
+ :type status: str
+ :param last_registry_entry_seen_id: The id of the last RegistryEntry that
+ the user has seen.
+ :type last_registry_entry_seen_id: int
+ :param previous_updated_timestamp: The previous updated timestamp that you
+ received for this Registry.
+ :type previous_updated_timestamp: str
+ :param memberships: New list of memberships.
+ :type memberships: list[RegistryMembership]
+ :param memberships_previous: Previous list of memberships.
+ :type memberships_previous: list[RegistryMembership]
"""
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), whitelist_sdd_id)
- response_raw = api_client.get(endpoint_url, {}, custom_headers)
-
- return BunqResponseWhitelistSdd.cast_from_bunq_response(
- cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
- )
+ self._currency_field_for_request = currency
+ self._title_field_for_request = title
+ self._description_field_for_request = description
+ self._status_field_for_request = status
+ self._last_registry_entry_seen_id_field_for_request = last_registry_entry_seen_id
+ self._previous_updated_timestamp_field_for_request = previous_updated_timestamp
+ self._memberships_field_for_request = memberships
+ self._memberships_previous_field_for_request = memberships_previous
@classmethod
- def create(cls, monetary_account_paying_id, request_id, maximum_amount_per_month, custom_headers=None):
+ def create(cls, currency, title=None, description=None, status=None, last_registry_entry_seen_id=None,
+ previous_updated_timestamp=None, memberships=None, memberships_previous=None, custom_headers=None):
"""
- Create a new SDD whitelist entry.
+ Create a new Slice group.
:type user_id: int
- :param monetary_account_paying_id: ID of the monetary account of which
- you want to pay from.
- :type monetary_account_paying_id: int
- :param request_id: ID of the request for which you want to whitelist the
- originating SDD.
- :type request_id: int
- :param maximum_amount_per_month: The maximum amount of money that is
- allowed to be deducted based on the whitelist.
- :type maximum_amount_per_month: object_.Amount
+ :param currency: The currency for the Registry as an ISO 4217 formatted
+ currency code.
+ :type currency: str
+ :param title: The title of the Registry.
+ :type title: str
+ :param description: A description about the Registry.
+ :type description: str
+ :param status: The status of the Registry.
+ :type status: str
+ :param last_registry_entry_seen_id: The id of the last RegistryEntry
+ that the user has seen.
+ :type last_registry_entry_seen_id: int
+ :param previous_updated_timestamp: The previous updated timestamp that
+ you received for this Registry.
+ :type previous_updated_timestamp: str
+ :param memberships: New list of memberships.
+ :type memberships: list[RegistryMembership]
+ :param memberships_previous: Previous list of memberships.
+ :type memberships_previous: list[RegistryMembership]
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -35801,9 +38741,14 @@ def create(cls, monetary_account_paying_id, request_id, maximum_amount_per_month
custom_headers = {}
request_map = {
- cls.FIELD_MONETARY_ACCOUNT_PAYING_ID: monetary_account_paying_id,
- cls.FIELD_REQUEST_ID: request_id,
- cls.FIELD_MAXIMUM_AMOUNT_PER_MONTH: maximum_amount_per_month
+ cls.FIELD_CURRENCY: currency,
+ cls.FIELD_TITLE: title,
+ cls.FIELD_DESCRIPTION: description,
+ cls.FIELD_STATUS: status,
+ cls.FIELD_LAST_REGISTRY_ENTRY_SEEN_ID: last_registry_entry_seen_id,
+ cls.FIELD_PREVIOUS_UPDATED_TIMESTAMP: previous_updated_timestamp,
+ cls.FIELD_MEMBERSHIPS: memberships,
+ cls.FIELD_MEMBERSHIPS_PREVIOUS: memberships_previous
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
@@ -35818,17 +38763,29 @@ def create(cls, monetary_account_paying_id, request_id, maximum_amount_per_month
)
@classmethod
- def update(cls, whitelist_sdd_id, monetary_account_paying_id=None, maximum_amount_per_month=None,
- custom_headers=None):
+ def update(cls, registry_id, title=None, description=None, status=None, last_registry_entry_seen_id=None,
+ previous_updated_timestamp=None, memberships=None, memberships_previous=None, custom_headers=None):
"""
+ Update a specific Slice group.
+
:type user_id: int
- :type whitelist_sdd_id: int
- :param monetary_account_paying_id: ID of the monetary account of which
- you want to pay from.
- :type monetary_account_paying_id: int
- :param maximum_amount_per_month: The maximum amount of money that is
- allowed to be deducted based on the whitelist.
- :type maximum_amount_per_month: object_.Amount
+ :type registry_id: int
+ :param title: The title of the Registry.
+ :type title: str
+ :param description: A description about the Registry.
+ :type description: str
+ :param status: The status of the Registry.
+ :type status: str
+ :param last_registry_entry_seen_id: The id of the last RegistryEntry
+ that the user has seen.
+ :type last_registry_entry_seen_id: int
+ :param previous_updated_timestamp: The previous updated timestamp that
+ you received for this Registry.
+ :type previous_updated_timestamp: str
+ :param memberships: New list of memberships.
+ :type memberships: list[RegistryMembership]
+ :param memberships_previous: Previous list of memberships.
+ :type memberships_previous: list[RegistryMembership]
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseInt
@@ -35840,14 +38797,19 @@ def update(cls, whitelist_sdd_id, monetary_account_paying_id=None, maximum_amoun
api_client = ApiClient(cls._get_api_context())
request_map = {
- cls.FIELD_MONETARY_ACCOUNT_PAYING_ID: monetary_account_paying_id,
- cls.FIELD_MAXIMUM_AMOUNT_PER_MONTH: maximum_amount_per_month
+ cls.FIELD_TITLE: title,
+ cls.FIELD_DESCRIPTION: description,
+ cls.FIELD_STATUS: status,
+ cls.FIELD_LAST_REGISTRY_ENTRY_SEEN_ID: last_registry_entry_seen_id,
+ cls.FIELD_PREVIOUS_UPDATED_TIMESTAMP: previous_updated_timestamp,
+ cls.FIELD_MEMBERSHIPS: memberships,
+ cls.FIELD_MEMBERSHIPS_PREVIOUS: memberships_previous
}
request_map_string = converter.class_to_json(request_map)
request_map_string = cls._remove_field_for_request(request_map_string)
request_bytes = request_map_string.encode()
- endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(), whitelist_sdd_id)
+ endpoint_url = cls._ENDPOINT_URL_UPDATE.format(cls._determine_user_id(), registry_id)
response_raw = api_client.put(endpoint_url, request_bytes, custom_headers)
return BunqResponseInt.cast_from_bunq_response(
@@ -35855,51 +38817,76 @@ def update(cls, whitelist_sdd_id, monetary_account_paying_id=None, maximum_amoun
)
@classmethod
- def delete(cls, whitelist_sdd_id, custom_headers=None):
+ def list(cls, params=None, custom_headers=None):
"""
+ Get a listing of all Slice groups.
+
:type user_id: int
- :type whitelist_sdd_id: int
+ :type params: dict[str, str]|None
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseNone
+ :rtype: BunqResponseRegistryList
"""
+ if params is None:
+ params = {}
+
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(), whitelist_sdd_id)
- response_raw = api_client.delete(endpoint_url, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
+ response_raw = api_client.get(endpoint_url, params, custom_headers)
- return BunqResponseNone.cast_from_bunq_response(
- BunqResponse(None, response_raw.headers)
+ return BunqResponseRegistryList.cast_from_bunq_response(
+ cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
)
@classmethod
- def list(cls, params=None, custom_headers=None):
+ def get(cls, registry_id, custom_headers=None):
"""
- Get a listing of all SDD whitelist entries for a target monetary
- account.
+ Get a specific Slice group.
+ :type api_context: ApiContext
:type user_id: int
- :type params: dict[str, str]|None
+ :type registry_id: int
:type custom_headers: dict[str, str]|None
- :rtype: BunqResponseWhitelistSddList
+ :rtype: BunqResponseRegistry
"""
- if params is None:
- params = {}
+ if custom_headers is None:
+ custom_headers = {}
+
+ api_client = ApiClient(cls._get_api_context())
+ endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(), registry_id)
+ response_raw = api_client.get(endpoint_url, {}, custom_headers)
+
+ return BunqResponseRegistry.cast_from_bunq_response(
+ cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
+ )
+
+ @classmethod
+ def delete(cls, registry_id, custom_headers=None):
+ """
+ Delete a specific Slice group.
+
+ :type user_id: int
+ :type registry_id: int
+ :type custom_headers: dict[str, str]|None
+
+ :rtype: BunqResponseNone
+ """
if custom_headers is None:
custom_headers = {}
api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
- response_raw = api_client.get(endpoint_url, params, custom_headers)
+ endpoint_url = cls._ENDPOINT_URL_DELETE.format(cls._determine_user_id(), registry_id)
+ response_raw = api_client.delete(endpoint_url, custom_headers)
- return BunqResponseWhitelistSddList.cast_from_bunq_response(
- cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
+ return BunqResponseNone.cast_from_bunq_response(
+ BunqResponse(None, response_raw.headers)
)
@property
@@ -35911,28 +38898,36 @@ def id_(self):
return self._id_
@property
- def monetary_account_incoming_id(self):
+ def created(self):
"""
- :rtype: int
+ :rtype: str
"""
- return self._monetary_account_incoming_id
+ return self._created
@property
- def monetary_account_paying_id(self):
+ def updated(self):
"""
- :rtype: int
+ :rtype: str
"""
- return self._monetary_account_paying_id
+ return self._updated
@property
- def type_(self):
+ def currency(self):
"""
:rtype: str
"""
- return self._type_
+ return self._currency
+
+ @property
+ def title(self):
+ """
+ :rtype: str
+ """
+
+ return self._title
@property
def status(self):
@@ -35943,44 +38938,52 @@ def status(self):
return self._status
@property
- def credit_scheme_identifier(self):
+ def unseen_entries_count(self):
"""
- :rtype: str
+ :rtype: int
"""
- return self._credit_scheme_identifier
+ return self._unseen_entries_count
@property
- def mandate_identifier(self):
+ def total_amount_spent(self):
"""
- :rtype: str
+ :rtype: object_.Amount
"""
- return self._mandate_identifier
+ return self._total_amount_spent
@property
- def counterparty_alias(self):
+ def is_previously_settled(self):
"""
- :rtype: object_.MonetaryAccountReference
+ :rtype: bool
"""
- return self._counterparty_alias
+ return self._is_previously_settled
@property
- def maximum_amount_per_month(self):
+ def memberships(self):
"""
- :rtype: object_.Amount
+ :rtype: list[RegistryMembership]
"""
- return self._maximum_amount_per_month
+ return self._memberships
@property
- def user_alias_created(self):
+ def setting(self):
"""
- :rtype: object_.LabelUser
+ :rtype: RegistrySetting
"""
- return self._user_alias_created
+ return self._setting
+
+ @property
+ def registry_auto_add_card_transaction_enabled_id(self):
+ """
+ :rtype: int
+ """
+
+ return self._registry_auto_add_card_transaction_enabled_id
def is_all_field_none(self):
"""
@@ -35990,116 +38993,37 @@ def is_all_field_none(self):
if self._id_ is not None:
return False
- if self._monetary_account_incoming_id is not None:
+ if self._created is not None:
return False
- if self._monetary_account_paying_id is not None:
+ if self._updated is not None:
return False
- if self._type_ is not None:
+ if self._currency is not None:
return False
- if self._status is not None:
+ if self._title is not None:
return False
- if self._credit_scheme_identifier is not None:
+ if self._status is not None:
return False
- if self._mandate_identifier is not None:
+ if self._unseen_entries_count is not None:
return False
- if self._counterparty_alias is not None:
+ if self._total_amount_spent is not None:
return False
- if self._maximum_amount_per_month is not None:
+ if self._is_previously_settled is not None:
return False
- if self._user_alias_created is not None:
+ if self._memberships is not None:
return False
- return True
-
- @staticmethod
- def from_json(json_str):
- """
- :type json_str: str
-
- :rtype: WhitelistSdd
- """
-
- return converter.json_to_class(WhitelistSdd, json_str)
-
-
-class MasterCardActionGreenAggregation(BunqModel):
- """
- Aggregation of how many card payments have been done with a Green Card in
- the current calendar month.
-
- :param _date: The date of the aggregation.
- :type _date: str
- :param _percentage: The percentage of card payments that were done with a
- Green Card.
- :type _percentage: str
- """
-
- # Endpoint constants.
- _ENDPOINT_URL_LISTING = "user/{}/mastercard-action-green-aggregation"
-
- # Object type.
- _OBJECT_TYPE_GET = "MasterCardActionGreenAggregation"
-
- _date = None
- _percentage = None
-
- @classmethod
- def list(cls, params=None, custom_headers=None):
- """
- :type user_id: int
- :type params: dict[str, str]|None
- :type custom_headers: dict[str, str]|None
-
- :rtype: BunqResponseMasterCardActionGreenAggregationList
- """
-
- if params is None:
- params = {}
-
- if custom_headers is None:
- custom_headers = {}
-
- api_client = ApiClient(cls._get_api_context())
- endpoint_url = cls._ENDPOINT_URL_LISTING.format(cls._determine_user_id())
- response_raw = api_client.get(endpoint_url, params, custom_headers)
-
- return BunqResponseMasterCardActionGreenAggregationList.cast_from_bunq_response(
- cls._from_json_list(response_raw, cls._OBJECT_TYPE_GET)
- )
-
- @property
- def date(self):
- """
- :rtype: str
- """
-
- return self._date
-
- @property
- def percentage(self):
- """
- :rtype: str
- """
-
- return self._percentage
-
- def is_all_field_none(self):
- """
- :rtype: bool
- """
-
- if self._date is not None:
+ if self._setting is not None:
return False
- if self._percentage is not None:
+ if self._registry_auto_add_card_transaction_enabled_id is not None:
return False
return True
@@ -36109,10 +39033,10 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: MasterCardActionGreenAggregation
+ :rtype: Registry
"""
- return converter.json_to_class(MasterCardActionGreenAggregation, json_str)
+ return converter.json_to_class(Registry, json_str)
class BunqResponseBillingContractSubscriptionList(BunqResponse):
@@ -36255,26 +39179,6 @@ def value(self):
return super().value
-class BunqResponseBancontactMerchantTransaction(BunqResponse):
- @property
- def value(self):
- """
- :rtype: BancontactMerchantTransaction
- """
-
- return super().value
-
-
-class BunqResponseBancontactMerchantTransactionList(BunqResponse):
- @property
- def value(self):
- """
- :rtype: list[BancontactMerchantTransaction]
- """
-
- return super().value
-
-
class BunqResponseBankSwitchServiceNetherlandsIncomingPayment(BunqResponse):
@property
def value(self):
@@ -36615,6 +39519,36 @@ def value(self):
return super().value
+class BunqResponseCompany(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: Company
+ """
+
+ return super().value
+
+
+class BunqResponseCompanyList(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: list[Company]
+ """
+
+ return super().value
+
+
+class BunqResponseUserCompany(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: UserCompany
+ """
+
+ return super().value
+
+
class BunqResponseConfirmationOfFunds(BunqResponse):
@property
def value(self):
@@ -36915,6 +39849,36 @@ def value(self):
return super().value
+class BunqResponseTransferwiseTransfer(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: TransferwiseTransfer
+ """
+
+ return super().value
+
+
+class BunqResponseTransferwiseTransferList(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: list[TransferwiseTransfer]
+ """
+
+ return super().value
+
+
+class BunqResponseTransferwiseQuote(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: TransferwiseQuote
+ """
+
+ return super().value
+
+
class BunqResponseRewardRecipient(BunqResponse):
@property
def value(self):
@@ -37885,16 +40849,6 @@ def value(self):
return super().value
-class BunqResponseUserCompany(BunqResponse):
- @property
- def value(self):
- """
- :rtype: UserCompany
- """
-
- return super().value
-
-
class BunqResponseUserPaymentServiceProvider(BunqResponse):
@property
def value(self):
@@ -38055,6 +41009,26 @@ def value(self):
return super().value
+class BunqResponseSandboxUserCompany(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: SandboxUserCompany
+ """
+
+ return super().value
+
+
+class BunqResponseSandboxUserPerson(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: SandboxUserPerson
+ """
+
+ return super().value
+
+
class BunqResponseSandboxUser(BunqResponse):
@property
def value(self):
@@ -38115,6 +41089,66 @@ def value(self):
return super().value
+class BunqResponseTransferwiseAccountQuote(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: TransferwiseAccountQuote
+ """
+
+ return super().value
+
+
+class BunqResponseTransferwiseAccountQuoteList(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: list[TransferwiseAccountQuote]
+ """
+
+ return super().value
+
+
+class BunqResponseTransferwiseAccountRequirementList(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: list[TransferwiseAccountRequirement]
+ """
+
+ return super().value
+
+
+class BunqResponseTransferwiseCurrencyList(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: list[TransferwiseCurrency]
+ """
+
+ return super().value
+
+
+class BunqResponseTransferwiseQuoteTemporary(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: TransferwiseQuoteTemporary
+ """
+
+ return super().value
+
+
+class BunqResponseTransferwiseUserList(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: list[TransferwiseUser]
+ """
+
+ return super().value
+
+
class BunqResponseTreeProgressList(BunqResponse):
@property
def value(self):
@@ -38193,3 +41227,83 @@ def value(self):
"""
return super().value
+
+
+class BunqResponseRegistryEntryList(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: list[RegistryEntry]
+ """
+
+ return super().value
+
+
+class BunqResponseRegistryEntry(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: RegistryEntry
+ """
+
+ return super().value
+
+
+class BunqResponseRegistrySetting(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: RegistrySetting
+ """
+
+ return super().value
+
+
+class BunqResponseRegistrySettlementPendingList(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: list[RegistrySettlementPending]
+ """
+
+ return super().value
+
+
+class BunqResponseRegistrySettlement(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: RegistrySettlement
+ """
+
+ return super().value
+
+
+class BunqResponseRegistrySettlementList(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: list[RegistrySettlement]
+ """
+
+ return super().value
+
+
+class BunqResponseRegistryList(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: list[Registry]
+ """
+
+ return super().value
+
+
+class BunqResponseRegistry(BunqResponse):
+ @property
+ def value(self):
+ """
+ :rtype: Registry
+ """
+
+ return super().value
diff --git a/bunq/sdk/model/generated/object_.py b/bunq/sdk/model/generated/object_.py
index d039ebd..917e8f5 100644
--- a/bunq/sdk/model/generated/object_.py
+++ b/bunq/sdk/model/generated/object_.py
@@ -900,9 +900,9 @@ class Address(BunqModel):
:type _postal_code: str
:param _city: The city.
:type _city: str
- :param _country: The country as an ISO 3166-1 alpha-2 country code..
+ :param _country: The country as an ISO 3166-1 alpha-2 country code.
:type _country: str
- :param _extra: The appartment, building or other extra information for
+ :param _extra: The apartment, building or other extra information for
addresses.
:type _extra: str
:param _mailbox_name: The name on the mailbox (only used for Postal
@@ -945,7 +945,7 @@ def __init__(self, street=None, house_number=None, postal_code=None, city=None,
:type country: str
:param po_box: The PO box.
:type po_box: str
- :param extra: The appartment, building or other extra information for
+ :param extra: The apartment, building or other extra information for
addresses.
:type extra: str
:param mailbox_name: The name on the mailbox (only used for Postal
@@ -2227,6 +2227,192 @@ def from_json(json_str):
return converter.json_to_class(Certificate, json_str)
+class Ubo(BunqModel):
+ """
+ :param _name: The name of the ultimate beneficiary owner.
+ :type _name: str
+ :param _date_of_birth: The date of birth of the ultimate beneficiary owner.
+ :type _date_of_birth: str
+ :param _nationality: The nationality of the ultimate beneficiary owner.
+ :type _nationality: str
+ """
+
+ _name = None
+ _date_of_birth = None
+ _nationality = None
+ _name_field_for_request = None
+ _date_of_birth_field_for_request = None
+ _nationality_field_for_request = None
+
+ def __init__(self, name=None, date_of_birth=None, nationality=None):
+ """
+ :param name: The name of the ultimate beneficiary owner.
+ :type name: str
+ :param date_of_birth: The date of birth of the ultimate beneficiary owner.
+ Accepts ISO8601 date formats.
+ :type date_of_birth: str
+ :param nationality: The nationality of the ultimate beneficiary owner.
+ Accepts ISO8601 date formats.
+ :type nationality: str
+ """
+
+ self._name_field_for_request = name
+ self._date_of_birth_field_for_request = date_of_birth
+ self._nationality_field_for_request = nationality
+
+ @property
+ def name(self):
+ """
+ :rtype: str
+ """
+
+ return self._name
+
+ @property
+ def date_of_birth(self):
+ """
+ :rtype: str
+ """
+
+ return self._date_of_birth
+
+ @property
+ def nationality(self):
+ """
+ :rtype: str
+ """
+
+ return self._nationality
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._name is not None:
+ return False
+
+ if self._date_of_birth is not None:
+ return False
+
+ if self._nationality is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: Ubo
+ """
+
+ return converter.json_to_class(Ubo, json_str)
+
+
+class NotificationFilter(BunqModel):
+ """
+ :param _notification_delivery_method: The delivery method via which
+ notifications that match this notification filter will be delivered.
+ Possible choices are PUSH for delivery via push notification and URL for
+ delivery via URL callback.
+ :type _notification_delivery_method: str
+ :param _notification_target: The target of notifications that match this
+ notification filter. For URL notification filters this is the URL to which
+ the callback will be made. For PUSH notifications filters this should always
+ be null.
+ :type _notification_target: str
+ :param _category: The notification category that will match this
+ notification filter. Possible choices are BILLING, CARD_TRANSACTION_FAILED,
+ CARD_TRANSACTION_SUCCESSFUL, CHAT, DRAFT_PAYMENT, IDEAL, SOFORT,
+ MONETARY_ACCOUNT_PROFILE, MUTATION, PAYMENT, PROMOTION, REQUEST,
+ SCHEDULE_RESULT, SCHEDULE_STATUS, SHARE, SUPPORT, TAB_RESULT, USER_APPROVAL.
+ :type _category: str
+ """
+
+ _notification_delivery_method = None
+ _notification_target = None
+ _category = None
+ _notification_delivery_method_field_for_request = None
+ _notification_target_field_for_request = None
+ _category_field_for_request = None
+
+ def __init__(self, notification_delivery_method=None, notification_target=None, category=None):
+ """
+ :param notification_delivery_method: The delivery method via which
+ notifications that match this notification filter will be delivered.
+ Possible choices are PUSH for delivery via push notification and URL for
+ delivery via URL callback.
+ :type notification_delivery_method: str
+ :param notification_target: The target of notifications that match this
+ notification filter. For URL notification filters this is the URL to which
+ the callback will be made. For PUSH notifications filters this should always
+ be null.
+ :type notification_target: str
+ :param category: The notification category that will match this notification
+ filter. Possible choices are BILLING, CARD_TRANSACTION_FAILED,
+ CARD_TRANSACTION_SUCCESSFUL, CHAT, DRAFT_PAYMENT, IDEAL, SOFORT,
+ MONETARY_ACCOUNT_PROFILE, MUTATION, PAYMENT, PROMOTION, REQUEST,
+ SCHEDULE_RESULT, SCHEDULE_STATUS, SHARE, SUPPORT, TAB_RESULT, USER_APPROVAL.
+ :type category: str
+ """
+
+ self._notification_delivery_method_field_for_request = notification_delivery_method
+ self._notification_target_field_for_request = notification_target
+ self._category_field_for_request = category
+
+ @property
+ def notification_delivery_method(self):
+ """
+ :rtype: str
+ """
+
+ return self._notification_delivery_method
+
+ @property
+ def notification_target(self):
+ """
+ :rtype: str
+ """
+
+ return self._notification_target
+
+ @property
+ def category(self):
+ """
+ :rtype: str
+ """
+
+ return self._category
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._notification_delivery_method is not None:
+ return False
+
+ if self._notification_target is not None:
+ return False
+
+ if self._category is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: NotificationFilter
+ """
+
+ return converter.json_to_class(NotificationFilter, json_str)
+
+
class DraftPaymentResponse(BunqModel):
"""
:param _status: The status with which was responded.
@@ -5453,93 +5639,76 @@ def from_json(json_str):
return converter.json_to_class(TaxResident, json_str)
-class NotificationFilter(BunqModel):
+class UserApiKeyAnchoredUser(BunqModel, AnchorObjectInterface):
"""
- :param _notification_delivery_method: The delivery method via which
- notifications that match this notification filter will be delivered.
- Possible choices are PUSH for delivery via push notification and URL for
- delivery via URL callback.
- :type _notification_delivery_method: str
- :param _notification_target: The target of notifications that match this
- notification filter. For URL notification filters this is the URL to which
- the callback will be made. For PUSH notifications filters this should always
- be null.
- :type _notification_target: str
- :param _category: The notification category that will match this
- notification filter. Possible choices are BILLING, CARD_TRANSACTION_FAILED,
- CARD_TRANSACTION_SUCCESSFUL, CHAT, DRAFT_PAYMENT, IDEAL, SOFORT,
- MONETARY_ACCOUNT_PROFILE, MUTATION, PAYMENT, PROMOTION, REQUEST,
- SCHEDULE_RESULT, SCHEDULE_STATUS, SHARE, SUPPORT, TAB_RESULT, USER_APPROVAL.
- :type _category: str
+ :param _UserPerson:
+ :type _UserPerson: endpoint.UserPerson
+ :param _UserCompany:
+ :type _UserCompany: endpoint.UserCompany
+ :param _UserPaymentServiceProvider:
+ :type _UserPaymentServiceProvider: endpoint.UserPaymentServiceProvider
"""
- _notification_delivery_method = None
- _notification_target = None
- _category = None
- _notification_delivery_method_field_for_request = None
- _notification_target_field_for_request = None
- _category_field_for_request = None
+ # Error constants.
+ _ERROR_NULL_FIELDS = "All fields of an extended model or object are null."
- def __init__(self, notification_delivery_method=None, notification_target=None, category=None):
+ _UserPerson = None
+ _UserCompany = None
+ _UserPaymentServiceProvider = None
+
+ @property
+ def UserPerson(self):
"""
- :param notification_delivery_method: The delivery method via which
- notifications that match this notification filter will be delivered.
- Possible choices are PUSH for delivery via push notification and URL for
- delivery via URL callback.
- :type notification_delivery_method: str
- :param notification_target: The target of notifications that match this
- notification filter. For URL notification filters this is the URL to which
- the callback will be made. For PUSH notifications filters this should always
- be null.
- :type notification_target: str
- :param category: The notification category that will match this notification
- filter. Possible choices are BILLING, CARD_TRANSACTION_FAILED,
- CARD_TRANSACTION_SUCCESSFUL, CHAT, DRAFT_PAYMENT, IDEAL, SOFORT,
- MONETARY_ACCOUNT_PROFILE, MUTATION, PAYMENT, PROMOTION, REQUEST,
- SCHEDULE_RESULT, SCHEDULE_STATUS, SHARE, SUPPORT, TAB_RESULT, USER_APPROVAL.
- :type category: str
+ :rtype: endpoint.UserPerson
"""
- self._notification_delivery_method_field_for_request = notification_delivery_method
- self._notification_target_field_for_request = notification_target
- self._category_field_for_request = category
+ return self._UserPerson
@property
- def notification_delivery_method(self):
+ def UserCompany(self):
"""
- :rtype: str
+ :rtype: endpoint.UserCompany
"""
- return self._notification_delivery_method
+ return self._UserCompany
@property
- def notification_target(self):
+ def UserPaymentServiceProvider(self):
"""
- :rtype: str
+ :rtype: endpoint.UserPaymentServiceProvider
"""
- return self._notification_target
+ return self._UserPaymentServiceProvider
- @property
- def category(self):
+ def get_referenced_object(self):
"""
- :rtype: str
+ :rtype: BunqModel
+ :raise: BunqException
"""
- return self._category
+ if self._UserPerson is not None:
+ return self._UserPerson
+
+ if self._UserCompany is not None:
+ return self._UserCompany
+
+ if self._UserPaymentServiceProvider is not None:
+ return self._UserPaymentServiceProvider
+
+ raise BunqException(self._ERROR_NULL_FIELDS)
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._notification_delivery_method is not None:
+ if self._UserPerson is not None:
return False
- if self._notification_target is not None:
+ if self._UserCompany is not None:
return False
- if self._category is not None:
+ if self._UserPaymentServiceProvider is not None:
return False
return True
@@ -5549,81 +5718,76 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: NotificationFilter
+ :rtype: UserApiKeyAnchoredUser
"""
- return converter.json_to_class(NotificationFilter, json_str)
+ return converter.json_to_class(UserApiKeyAnchoredUser, json_str)
-class Ubo(BunqModel):
+class OauthCallbackUrl(BunqModel):
"""
- :param _name: The name of the ultimate beneficiary owner.
- :type _name: str
- :param _date_of_birth: The date of birth of the ultimate beneficiary owner.
- :type _date_of_birth: str
- :param _nationality: The nationality of the ultimate beneficiary owner.
- :type _nationality: str
+ :param _id_: The id of the callback URL.
+ :type _id_: int
+ :param _created: The timestamp of the callback URL's creation.
+ :type _created: str
+ :param _updated: The timestamp of the callback URL's last update.
+ :type _updated: str
+ :param _url: The Callback URL.
+ :type _url: str
"""
- _name = None
- _date_of_birth = None
- _nationality = None
- _name_field_for_request = None
- _date_of_birth_field_for_request = None
- _nationality_field_for_request = None
+ _id_ = None
+ _created = None
+ _updated = None
+ _url = None
- def __init__(self, name=None, date_of_birth=None, nationality=None):
+ @property
+ def id_(self):
"""
- :param name: The name of the ultimate beneficiary owner.
- :type name: str
- :param date_of_birth: The date of birth of the ultimate beneficiary owner.
- Accepts ISO8601 date formats.
- :type date_of_birth: str
- :param nationality: The nationality of the ultimate beneficiary owner.
- Accepts ISO8601 date formats.
- :type nationality: str
+ :rtype: int
"""
- self._name_field_for_request = name
- self._date_of_birth_field_for_request = date_of_birth
- self._nationality_field_for_request = nationality
+ return self._id_
@property
- def name(self):
+ def created(self):
"""
:rtype: str
"""
- return self._name
+ return self._created
@property
- def date_of_birth(self):
+ def updated(self):
"""
:rtype: str
"""
- return self._date_of_birth
+ return self._updated
@property
- def nationality(self):
+ def url(self):
"""
:rtype: str
"""
- return self._nationality
+ return self._url
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._name is not None:
+ if self._id_ is not None:
return False
- if self._date_of_birth is not None:
+ if self._created is not None:
return False
- if self._nationality is not None:
+ if self._updated is not None:
+ return False
+
+ if self._url is not None:
return False
return True
@@ -5633,82 +5797,117 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: Ubo
+ :rtype: OauthCallbackUrl
"""
- return converter.json_to_class(Ubo, json_str)
+ return converter.json_to_class(OauthCallbackUrl, json_str)
-class UserApiKeyAnchoredUser(BunqModel, AnchorObjectInterface):
+class PermittedDevice(BunqModel):
"""
- :param _UserPerson:
- :type _UserPerson: endpoint.UserPerson
- :param _UserCompany:
- :type _UserCompany: endpoint.UserCompany
- :param _UserPaymentServiceProvider:
- :type _UserPaymentServiceProvider: endpoint.UserPaymentServiceProvider
+ :param _description: The description of the device that may use the
+ credential.
+ :type _description: str
+ :param _ip: The IP address of the device that may use the credential.
+ :type _ip: str
"""
- # Error constants.
- _ERROR_NULL_FIELDS = "All fields of an extended model or object are null."
-
- _UserPerson = None
- _UserCompany = None
- _UserPaymentServiceProvider = None
+ _description = None
+ _ip = None
@property
- def UserPerson(self):
+ def description(self):
"""
- :rtype: endpoint.UserPerson
+ :rtype: str
"""
- return self._UserPerson
+ return self._description
@property
- def UserCompany(self):
+ def ip(self):
"""
- :rtype: endpoint.UserCompany
+ :rtype: str
"""
- return self._UserCompany
+ return self._ip
- @property
- def UserPaymentServiceProvider(self):
+ def is_all_field_none(self):
"""
- :rtype: endpoint.UserPaymentServiceProvider
+ :rtype: bool
"""
- return self._UserPaymentServiceProvider
+ if self._description is not None:
+ return False
- def get_referenced_object(self):
+ if self._ip is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
"""
- :rtype: BunqModel
- :raise: BunqException
+ :type json_str: str
+
+ :rtype: PermittedDevice
"""
- if self._UserPerson is not None:
- return self._UserPerson
+ return converter.json_to_class(PermittedDevice, json_str)
- if self._UserCompany is not None:
- return self._UserCompany
- if self._UserPaymentServiceProvider is not None:
- return self._UserPaymentServiceProvider
+class TransferwiseRequirementField(BunqModel):
+ """
+ :param _key: The name of the required field.
+ :type _key: str
+ :param _value: The value of the required field.
+ :type _value: str
+ :param _name: The descriptive label of the field.
+ :type _name: str
+ :param _group: The field group.
+ :type _group: core.BunqModel
+ """
- raise BunqException(self._ERROR_NULL_FIELDS)
+ _name = None
+ _group = None
+ _key_field_for_request = None
+ _value_field_for_request = None
+
+ def __init__(self, key=None, value=None):
+ """
+ :param key: The name of the required field.
+ :type key: str
+ :param value: The value of the required field.
+ :type value: str
+ """
+
+ self._key_field_for_request = key
+ self._value_field_for_request = value
+
+ @property
+ def name(self):
+ """
+ :rtype: str
+ """
+
+ return self._name
+
+ @property
+ def group(self):
+ """
+ :rtype: core.BunqModel
+ """
+
+ return self._group
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._UserPerson is not None:
- return False
-
- if self._UserCompany is not None:
+ if self._name is not None:
return False
- if self._UserPaymentServiceProvider is not None:
+ if self._group is not None:
return False
return True
@@ -5718,76 +5917,99 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: UserApiKeyAnchoredUser
+ :rtype: TransferwiseRequirementField
"""
- return converter.json_to_class(UserApiKeyAnchoredUser, json_str)
+ return converter.json_to_class(TransferwiseRequirementField, json_str)
-class OauthCallbackUrl(BunqModel):
+class AllocationItem(BunqModel):
"""
- :param _id_: The id of the callback URL.
- :type _id_: int
- :param _created: The timestamp of the callback URL's creation.
- :type _created: str
- :param _updated: The timestamp of the callback URL's last update.
- :type _updated: str
- :param _url: The Callback URL.
- :type _url: str
+ :param _alias: The Alias of the party we are allocating money for.
+ :type _alias: Pointer
+ :param _type_: The type of the AllocationItem.
+ :type _type_: str
+ :param _amount: The Amount of the AllocationItem.
+ :type _amount: Amount
+ :param _share_ratio: The share ratio of the AllocationItem.
+ :type _share_ratio: int
+ :param _membership: The membership.
+ :type _membership: endpoint.RegistryMembership
"""
- _id_ = None
- _created = None
- _updated = None
- _url = None
+ _type_ = None
+ _membership = None
+ _amount = None
+ _share_ratio = None
+ _alias_field_for_request = None
+ _type__field_for_request = None
+ _amount_field_for_request = None
+ _share_ratio_field_for_request = None
- @property
- def id_(self):
+ def __init__(self, alias=None, type_=None, amount=None, share_ratio=None):
"""
- :rtype: int
+ :param alias: The Alias of the party we are allocating money for.
+ :type alias: Pointer
+ :param type_: The type of the AllocationItem.
+ :type type_: str
+ :param amount: The Amount of the AllocationItem.
+ :type amount: Amount
+ :param share_ratio: The share ratio of the AllocationItem.
+ :type share_ratio: int
"""
- return self._id_
+ self._alias_field_for_request = alias
+ self._type__field_for_request = type_
+ self._amount_field_for_request = amount
+ self._share_ratio_field_for_request = share_ratio
@property
- def created(self):
+ def type_(self):
"""
:rtype: str
"""
- return self._created
+ return self._type_
@property
- def updated(self):
+ def membership(self):
"""
- :rtype: str
+ :rtype: endpoint.RegistryMembership
"""
- return self._updated
+ return self._membership
@property
- def url(self):
+ def amount(self):
"""
- :rtype: str
+ :rtype: Amount
"""
- return self._url
+ return self._amount
+
+ @property
+ def share_ratio(self):
+ """
+ :rtype: int
+ """
+
+ return self._share_ratio
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._id_ is not None:
+ if self._type_ is not None:
return False
- if self._created is not None:
+ if self._membership is not None:
return False
- if self._updated is not None:
+ if self._amount is not None:
return False
- if self._url is not None:
+ if self._share_ratio is not None:
return False
return True
@@ -5797,49 +6019,58 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: OauthCallbackUrl
+ :rtype: AllocationItem
"""
- return converter.json_to_class(OauthCallbackUrl, json_str)
+ return converter.json_to_class(AllocationItem, json_str)
-class PermittedDevice(BunqModel):
+class RegistryEntryAttachment(BunqModel):
"""
- :param _description: The description of the device that may use the
- credential.
- :type _description: str
- :param _ip: The IP address of the device that may use the credential.
- :type _ip: str
+ :param _id_: The id of the attachment.
+ :type _id_: int
+ :param _monetary_account_id: The id of the monetary account to which the
+ attachment belongs.
+ :type _monetary_account_id: int
"""
- _description = None
- _ip = None
+ _id_ = None
+ _monetary_account_id = None
+ _id__field_for_request = None
+
+ def __init__(self, id_=None):
+ """
+ :param id_: The id of the attachment we are attaching.
+ :type id_: int
+ """
+
+ self._id__field_for_request = id_
@property
- def description(self):
+ def id_(self):
"""
- :rtype: str
+ :rtype: int
"""
- return self._description
+ return self._id_
@property
- def ip(self):
+ def monetary_account_id(self):
"""
- :rtype: str
+ :rtype: int
"""
- return self._ip
+ return self._monetary_account_id
def is_all_field_none(self):
"""
:rtype: bool
"""
- if self._description is not None:
+ if self._id_ is not None:
return False
- if self._ip is not None:
+ if self._monetary_account_id is not None:
return False
return True
@@ -5849,10 +6080,146 @@ def from_json(json_str):
"""
:type json_str: str
- :rtype: PermittedDevice
+ :rtype: RegistryEntryAttachment
"""
- return converter.json_to_class(PermittedDevice, json_str)
+ return converter.json_to_class(RegistryEntryAttachment, json_str)
+
+
+class RegistryEntryReference(BunqModel):
+ """
+ :param _type_: The object type that will be linked to the RegistryEntry.
+ :type _type_: str
+ :param _id_: The ID of the object that will be used for the RegistryEntry.
+ :type _id_: int
+ """
+
+ _type__field_for_request = None
+ _id__field_for_request = None
+
+ def __init__(self, type_=None, id_=None):
+ """
+ :param type_: The object type that will be linked to the RegistryEntry.
+ :type type_: str
+ :param id_: The ID of the object that will be used for the RegistryEntry.
+ :type id_: int
+ """
+
+ self._type__field_for_request = type_
+ self._id__field_for_request = id_
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: RegistryEntryReference
+ """
+
+ return converter.json_to_class(RegistryEntryReference, json_str)
+
+
+class RegistrySettlementItem(BunqModel):
+ """
+ :param _amount: The amount of the RegistrySettlementItem.
+ :type _amount: Amount
+ :param _membership_paying: The membership of the user that has to pay.
+ :type _membership_paying: endpoint.RegistryMembership
+ :param _membership_receiving: The membership of the user that will receive
+ money.
+ :type _membership_receiving: endpoint.RegistryMembership
+ :param _paying_user_alias: The LabelMonetaryAccount of the user that has to
+ pay the request.
+ :type _paying_user_alias: MonetaryAccountReference
+ :param _receiving_user_alias: The LabelMonetaryAccount of the user that will
+ receive the amount.
+ :type _receiving_user_alias: MonetaryAccountReference
+ """
+
+ _amount = None
+ _membership_paying = None
+ _membership_receiving = None
+ _paying_user_alias = None
+ _receiving_user_alias = None
+
+ @property
+ def amount(self):
+ """
+ :rtype: Amount
+ """
+
+ return self._amount
+
+ @property
+ def membership_paying(self):
+ """
+ :rtype: endpoint.RegistryMembership
+ """
+
+ return self._membership_paying
+
+ @property
+ def membership_receiving(self):
+ """
+ :rtype: endpoint.RegistryMembership
+ """
+
+ return self._membership_receiving
+
+ @property
+ def paying_user_alias(self):
+ """
+ :rtype: MonetaryAccountReference
+ """
+
+ return self._paying_user_alias
+
+ @property
+ def receiving_user_alias(self):
+ """
+ :rtype: MonetaryAccountReference
+ """
+
+ return self._receiving_user_alias
+
+ def is_all_field_none(self):
+ """
+ :rtype: bool
+ """
+
+ if self._amount is not None:
+ return False
+
+ if self._membership_paying is not None:
+ return False
+
+ if self._membership_receiving is not None:
+ return False
+
+ if self._paying_user_alias is not None:
+ return False
+
+ if self._receiving_user_alias is not None:
+ return False
+
+ return True
+
+ @staticmethod
+ def from_json(json_str):
+ """
+ :type json_str: str
+
+ :rtype: RegistrySettlementItem
+ """
+
+ return converter.json_to_class(RegistrySettlementItem, json_str)
class MonetaryAccountReference(BunqModel):
diff --git a/examples b/examples
index f37e987..67f623f 160000
--- a/examples
+++ b/examples
@@ -1 +1 @@
-Subproject commit f37e987cf4812cbef6f4e635783734415e5c2320
+Subproject commit 67f623fba4375a3360750821417bb5e9e028ec64
diff --git a/run.py b/run.py
index 7cdc347..820c6a8 100755
--- a/run.py
+++ b/run.py
@@ -2,8 +2,7 @@
import sys
if len(sys.argv) != 2:
- print('Invalid argument count. Usage: python3 run.py '
- 'examples/example_name.py')
+ print('Invalid argument count. Usage: python3 run.py examples/example_name.py')
path = sys.argv[1]
module_ = path.rstrip('.py').replace('/', '.')
diff --git a/setup.py b/setup.py
index eb519a6..1cc23ec 100644
--- a/setup.py
+++ b/setup.py
@@ -25,7 +25,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
- version='1.13.1',
+ version='1.14.0',
description='bunq Python SDK',
long_description=long_description,
diff --git a/tests/assets/bunq_App_Icon_Square@4x.png b/tests/assets/bunq_App_Icon_Square@4x.png
deleted file mode 100644
index 1eebc9a..0000000
Binary files a/tests/assets/bunq_App_Icon_Square@4x.png and /dev/null differ
diff --git a/tests/assets/vader.png b/tests/assets/vader.png
new file mode 100644
index 0000000..7d4b2d6
Binary files /dev/null and b/tests/assets/vader.png differ
diff --git a/tests/bunq_test.py b/tests/bunq_test.py
index e70b590..9dc99b8 100644
--- a/tests/bunq_test.py
+++ b/tests/bunq_test.py
@@ -27,7 +27,7 @@ class BunqSdkTestCase(unittest.TestCase):
_PATH_ATTACHMENT = 'tests/assets/'
_READ_BYTES = "rb"
- _ATTACHMENT_PATH_IN = 'bunq_App_Icon_Square@4x.png'
+ _ATTACHMENT_PATH_IN = 'vader.png'
_CONTENT_TYPE = 'image/png'
_ATTACHMENT_DESCRIPTION = 'SDK python test'
_FIRST_INDEX = 0