From 2b84e2e0a04cb06781db6835d33d7a16ba9c3351 Mon Sep 17 00:00:00 2001 From: Daniil Belyakov Date: Tue, 8 Aug 2017 16:15:52 +0200 Subject: [PATCH 1/4] #9 move to BunqResponse --- README.md | 3 +- bunq/sdk/client.py | 56 +- bunq/sdk/context.py | 13 +- bunq/sdk/model/generated/endpoint.py | 988 +++++++++--------- bunq/sdk/model/model.py | 151 ++- examples/api_context_save_example.py | 2 +- examples/attachment_public_example.py | 4 +- examples/card_debit_example.py | 2 +- examples/customer_statement_export_example.py | 10 +- examples/payment_batch_example.py | 4 +- examples/payment_example.py | 4 +- examples/payment_list_example.py | 2 +- examples/request_example.py | 6 +- examples/user_list_example.py | 2 +- 14 files changed, 671 insertions(+), 576 deletions(-) diff --git a/README.md b/README.md index dc59ac2..01e5e99 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ # bunq Python SDK -Version 0.9.0 **BETA** ## Introduction Hi developers! @@ -183,4 +182,4 @@ Please do not forget to set the `_API_KEY` constant in ## Running Tests Information regarding the test cases can be found in the [README.md](./tests/README.md) -located in [test](/tests) \ No newline at end of file +located in [test](/tests) diff --git a/bunq/sdk/client.py b/bunq/sdk/client.py index 4166b50..8b03392 100644 --- a/bunq/sdk/client.py +++ b/bunq/sdk/client.py @@ -32,7 +32,7 @@ class ApiClient(object): HEADER_AUTHENTICATION = 'X-Bunq-Client-Authentication' # Default header values - _USER_AGENT_BUNQ = 'bunq-sdk-python/0.9' + _USER_AGENT_BUNQ = 'bunq-sdk-python/0.9.1' _GEOLOCATION_ZERO = '0 0 0 0 NL' _LANGUAGE_EN_US = 'en_US' _REGION_NL_NL = 'nl_NL' @@ -66,7 +66,7 @@ def post(self, uri_relative, request_bytes, custom_headers): :type request_bytes: bytes :type custom_headers: dict[str, str] - :return: requests.Response + :return: BunqResponseRaw """ return self._request( @@ -83,7 +83,7 @@ def _request(self, method, uri_relative, request_bytes, custom_headers): :type request_bytes: bytes :type custom_headers: dict[str, str] - :return: requests.Response + :return: BunqResponseRaw """ self._api_context.ensure_session_active() @@ -111,7 +111,7 @@ def _request(self, method, uri_relative, request_bytes, custom_headers): response.headers ) - return response + return self._create_bunq_response_raw(response) def _get_all_headers(self, method, endpoint, request_bytes, custom_headers): """ @@ -184,6 +184,16 @@ def _assert_response_success(self, response): self._fetch_error_messages(response) ) + @classmethod + def _create_bunq_response_raw(cls, response): + """ + :type response: requests.Response + + :rtype: BunqResponseRaw + """ + + return BunqResponseRaw(response.content, response.headers) + def _fetch_error_messages(self, response): """ :type response: requests.Response @@ -221,7 +231,7 @@ def put(self, uri_relative, request_bytes, custom_headers): :type request_bytes: bytes :type custom_headers: dict[str, str] - :rtype: requests.Response + :rtype: BunqResponseRaw """ return self._request( @@ -236,7 +246,7 @@ def get(self, uri_relative, custom_headers): :type uri_relative: str :type custom_headers: dict[str, str] - :rtype: requests.Response + :rtype: BunqResponseRaw """ return self._request( @@ -251,7 +261,7 @@ def delete(self, uri_relative, custom_headers): :type uri_relative: str :type custom_headers: dict[str, str] - :rtype: requests.Response + :rtype: BunqResponseRaw """ return self._request( @@ -260,3 +270,35 @@ def delete(self, uri_relative, custom_headers): self._BYTES_EMPTY, custom_headers ) + + +class BunqResponseRaw(object): + """ + :type _body_bytes: bytes + :type _headers: dict[str, str] + """ + + def __init__(self, body_bytes, headers): + """ + :type body_bytes: bytes + :type headers: dict[str, str] + """ + + self._body_bytes = body_bytes + self._headers = headers + + @property + def body_bytes(self): + """ + :rtype: bytes + """ + + return self._body_bytes + + @property + def headers(self): + """ + :rtype: dict[str, str] + """ + + return self._headers diff --git a/bunq/sdk/context.py b/bunq/sdk/context.py index 6dcf7c3..f2778dd 100644 --- a/bunq/sdk/context.py +++ b/bunq/sdk/context.py @@ -95,7 +95,7 @@ def _initialize_installation(self): installation = model.Installation.create( self, security.public_key_to_string(private_key_client.publickey()) - ) + ).value token = installation.token.token public_key_server_string = \ installation.server_public_key.server_public_key @@ -116,14 +116,21 @@ def _register_device(self, device_description, :rtype: None """ - model.DeviceServer.create(self, device_description, permitted_ips) + generated.DeviceServer.create( + self, + { + generated.DeviceServer.FIELD_DESCRIPTION: device_description, + generated.DeviceServer.FIELD_SECRET: self.api_key, + generated.DeviceServer.FIELD_PERMITTED_IPS: permitted_ips, + } + ) def _initialize_session(self): """ :rtype: None """ - session_server = model.SessionServer.create(self) + session_server = model.SessionServer.create(self).value token = session_server.token.token expiry_time = self._get_expiry_timestamp(session_server) diff --git a/bunq/sdk/model/generated/endpoint.py b/bunq/sdk/model/generated/endpoint.py index 6882181..6032503 100644 --- a/bunq/sdk/model/generated/endpoint.py +++ b/bunq/sdk/model/generated/endpoint.py @@ -68,7 +68,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: list[Invoice] + :rtype: model.BunqResponse[list[Invoice]] """ if custom_headers is None: @@ -77,9 +77,9 @@ def list(cls, api_context, user_id, monetary_account_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @classmethod def get(cls, api_context, user_id, monetary_account_id, invoice_id, @@ -91,7 +91,7 @@ def get(cls, api_context, user_id, monetary_account_id, invoice_id, :type invoice_id: int :type custom_headers: dict[str, str]|None - :rtype: Invoice + :rtype: model.BunqResponse[Invoice] """ if custom_headers is None: @@ -101,9 +101,9 @@ def get(cls, api_context, user_id, monetary_account_id, invoice_id, endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, monetary_account_id, invoice_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @property def id_(self): @@ -288,7 +288,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: list[InvoiceByUser] + :rtype: model.BunqResponse[list[InvoiceByUser]] """ if custom_headers is None: @@ -296,9 +296,9 @@ def list(cls, api_context, user_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @classmethod def get(cls, api_context, user_id, invoice_by_user_id, custom_headers=None): @@ -308,7 +308,7 @@ def get(cls, api_context, user_id, invoice_by_user_id, custom_headers=None): :type invoice_by_user_id: int :type custom_headers: dict[str, str]|None - :rtype: InvoiceByUser + :rtype: model.BunqResponse[InvoiceByUser] """ if custom_headers is None: @@ -317,9 +317,9 @@ def get(cls, api_context, user_id, invoice_by_user_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, invoice_by_user_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @property def id_(self): @@ -469,7 +469,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: list[ChatConversation] + :rtype: model.BunqResponse[list[ChatConversation]] """ if custom_headers is None: @@ -477,9 +477,9 @@ def list(cls, api_context, user_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @classmethod def get(cls, api_context, user_id, chat_conversation_id, @@ -490,7 +490,7 @@ def get(cls, api_context, user_id, chat_conversation_id, :type chat_conversation_id: int :type custom_headers: dict[str, str]|None - :rtype: ChatConversation + :rtype: model.BunqResponse[ChatConversation] """ if custom_headers is None: @@ -499,9 +499,9 @@ def get(cls, api_context, user_id, chat_conversation_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, chat_conversation_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) class ChatMessageAttachment(model.BunqModel): @@ -537,7 +537,7 @@ def create(cls, api_context, request_map, user_id, chat_conversation_id, :type chat_conversation_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -547,9 +547,10 @@ def create(cls, api_context, request_map, user_id, chat_conversation_id, request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id, chat_conversation_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @property def id_(self): @@ -592,7 +593,7 @@ def create(cls, api_context, request_map, user_id, chat_conversation_id, :type chat_conversation_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -602,9 +603,10 @@ def create(cls, api_context, request_map, user_id, chat_conversation_id, request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id, chat_conversation_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @property def id_(self): @@ -656,7 +658,7 @@ def list(cls, api_context, user_id, chat_conversation_id, :type chat_conversation_id: int :type custom_headers: dict[str, str]|None - :rtype: list[ChatMessage] + :rtype: model.BunqResponse[list[ChatMessage]] """ if custom_headers is None: @@ -665,9 +667,9 @@ def list(cls, api_context, user_id, chat_conversation_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, chat_conversation_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def id_(self): @@ -758,7 +760,7 @@ def list(cls, api_context, user_id, chat_conversation_id, attachment_id, :type attachment_id: int :type custom_headers: dict[str, str]|None - :rtype: bytes + :rtype: model.BunqResponse[bytes] """ if custom_headers is None: @@ -768,8 +770,9 @@ def list(cls, api_context, user_id, chat_conversation_id, attachment_id, endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, chat_conversation_id, attachment_id) + response_raw = api_client.get(endpoint_url, custom_headers) - return api_client.get(endpoint_url, custom_headers).content + return model.BunqResponse(response_raw.body_bytes, response_raw.headers) class AttachmentPublicContent(model.BunqModel): @@ -793,7 +796,7 @@ def list(cls, api_context, attachment_public_uuid, custom_headers=None): :type attachment_public_uuid: str :type custom_headers: dict[str, str]|None - :rtype: bytes + :rtype: model.BunqResponse[bytes] """ if custom_headers is None: @@ -801,8 +804,9 @@ def list(cls, api_context, attachment_public_uuid, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(attachment_public_uuid) + response_raw = api_client.get(endpoint_url, custom_headers) - return api_client.get(endpoint_url, custom_headers).content + return model.BunqResponse(response_raw.body_bytes, response_raw.headers) class AttachmentTabContent(model.BunqModel): @@ -830,7 +834,7 @@ def list(cls, api_context, user_id, monetary_account_id, attachment_tab_id, :type attachment_tab_id: int :type custom_headers: dict[str, str]|None - :rtype: bytes + :rtype: model.BunqResponse[bytes] """ if custom_headers is None: @@ -840,8 +844,9 @@ def list(cls, api_context, user_id, monetary_account_id, attachment_tab_id, endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id, attachment_tab_id) + response_raw = api_client.get(endpoint_url, custom_headers) - return api_client.get(endpoint_url, custom_headers).content + return model.BunqResponse(response_raw.body_bytes, response_raw.headers) class TabAttachmentTabContent(model.BunqModel): @@ -866,7 +871,7 @@ def list(cls, api_context, tab_uuid, attachment_id, custom_headers=None): :type attachment_id: int :type custom_headers: dict[str, str]|None - :rtype: bytes + :rtype: model.BunqResponse[bytes] """ if custom_headers is None: @@ -874,8 +879,9 @@ def list(cls, api_context, tab_uuid, attachment_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(tab_uuid, attachment_id) + response_raw = api_client.get(endpoint_url, custom_headers) - return api_client.get(endpoint_url, custom_headers).content + return model.BunqResponse(response_raw.body_bytes, response_raw.headers) class AttachmentMonetaryAccount(model.BunqModel): @@ -914,7 +920,7 @@ def create(cls, api_context, request_bytes, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -923,9 +929,10 @@ def create(cls, api_context, request_bytes, user_id, monetary_account_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id, monetary_account_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @property def attachment(self): @@ -983,7 +990,7 @@ def create(cls, api_context, request_bytes, custom_headers=None): :type request_bytes: bytes :type custom_headers: dict[str, str]|None - :rtype: str + :rtype: model.BunqResponse[str] """ if custom_headers is None: @@ -991,9 +998,10 @@ def create(cls, api_context, request_bytes, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_CREATE - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_uuid(response.text) + return cls._process_for_uuid(response_raw) @classmethod def get(cls, api_context, attachment_public_uuid, custom_headers=None): @@ -1006,7 +1014,7 @@ def get(cls, api_context, attachment_public_uuid, custom_headers=None): :type attachment_public_uuid: str :type custom_headers: dict[str, str]|None - :rtype: AttachmentPublic + :rtype: model.BunqResponse[AttachmentPublic] """ if custom_headers is None: @@ -1014,9 +1022,9 @@ def get(cls, api_context, attachment_public_uuid, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_READ.format(attachment_public_uuid) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @property def uuid(self): @@ -1093,7 +1101,7 @@ def create(cls, api_context, request_bytes, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -1102,9 +1110,10 @@ def create(cls, api_context, request_bytes, user_id, monetary_account_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id, monetary_account_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def get(cls, api_context, user_id, monetary_account_id, attachment_tab_id, @@ -1119,7 +1128,7 @@ def get(cls, api_context, user_id, monetary_account_id, attachment_tab_id, :type attachment_tab_id: int :type custom_headers: dict[str, str]|None - :rtype: AttachmentTab + :rtype: model.BunqResponse[AttachmentTab] """ if custom_headers is None: @@ -1129,9 +1138,9 @@ def get(cls, api_context, user_id, monetary_account_id, attachment_tab_id, endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, monetary_account_id, attachment_tab_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @property def id_(self): @@ -1200,7 +1209,7 @@ def get(cls, api_context, tab_uuid, tab_attachment_tab_id, :type tab_attachment_tab_id: int :type custom_headers: dict[str, str]|None - :rtype: TabAttachmentTab + :rtype: model.BunqResponse[TabAttachmentTab] """ if custom_headers is None: @@ -1209,9 +1218,9 @@ def get(cls, api_context, tab_uuid, tab_attachment_tab_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_READ.format(tab_uuid, tab_attachment_tab_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @property def id_(self): @@ -1280,7 +1289,7 @@ def create(cls, api_context, request_map, custom_headers=None): :type request_map: dict[str, object] :type custom_headers: dict[str, str]|None - :rtype: str + :rtype: model.BunqResponse[str] """ if custom_headers is None: @@ -1289,9 +1298,10 @@ def create(cls, api_context, request_map, custom_headers=None): api_client = client.ApiClient(api_context) request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_CREATE - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_uuid(response.text) + return cls._process_for_uuid(response_raw) @classmethod def get(cls, api_context, avatar_uuid, custom_headers=None): @@ -1300,7 +1310,7 @@ def get(cls, api_context, avatar_uuid, custom_headers=None): :type avatar_uuid: str :type custom_headers: dict[str, str]|None - :rtype: Avatar + :rtype: model.BunqResponse[Avatar] """ if custom_headers is None: @@ -1308,9 +1318,9 @@ def get(cls, api_context, avatar_uuid, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_READ.format(avatar_uuid) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @property def uuid(self): @@ -1384,7 +1394,7 @@ def create(cls, api_context, request_map, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: CardDebit + :rtype: model.BunqResponse[CardDebit] """ if custom_headers is None: @@ -1395,9 +1405,10 @@ def create(cls, api_context, request_map, user_id, custom_headers=None): request_bytes = security.encrypt(api_context, request_bytes, custom_headers) endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @property def id_(self): @@ -1516,7 +1527,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: list[CardName] + :rtype: model.BunqResponse[list[CardName]] """ if custom_headers is None: @@ -1524,9 +1535,9 @@ def list(cls, api_context, user_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def possible_card_name_array(self): @@ -1607,7 +1618,7 @@ def update(cls, api_context, request_map, user_id, card_id, :type card_id: int :type custom_headers: dict[str, str]|None - :rtype: Card + :rtype: model.BunqResponse[Card] """ if custom_headers is None: @@ -1618,9 +1629,10 @@ def update(cls, api_context, request_map, user_id, card_id, request_bytes = security.encrypt(api_context, request_bytes, custom_headers) endpoint_url = cls._ENDPOINT_URL_UPDATE.format(user_id, card_id) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def get(cls, api_context, user_id, card_id, custom_headers=None): @@ -1632,7 +1644,7 @@ def get(cls, api_context, user_id, card_id, custom_headers=None): :type card_id: int :type custom_headers: dict[str, str]|None - :rtype: Card + :rtype: model.BunqResponse[Card] """ if custom_headers is None: @@ -1640,9 +1652,9 @@ def get(cls, api_context, user_id, card_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, card_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, custom_headers=None): @@ -1653,7 +1665,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: list[Card] + :rtype: model.BunqResponse[list[Card]] """ if custom_headers is None: @@ -1661,9 +1673,9 @@ def list(cls, api_context, user_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def id_(self): @@ -1812,7 +1824,7 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, :type qr_code_id: int :type custom_headers: dict[str, str]|None - :rtype: bytes + :rtype: model.BunqResponse[bytes] """ if custom_headers is None: @@ -1823,8 +1835,9 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, monetary_account_id, cash_register_id, qr_code_id) + response_raw = api_client.get(endpoint_url, custom_headers) - return api_client.get(endpoint_url, custom_headers).content + return model.BunqResponse(response_raw.body_bytes, response_raw.headers) class CashRegisterQrCode(model.BunqModel): @@ -1880,7 +1893,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type cash_register_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -1891,9 +1904,10 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id, monetary_account_id, cash_register_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def update(cls, api_context, request_map, user_id, monetary_account_id, @@ -1910,7 +1924,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type cash_register_qr_code_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -1922,9 +1936,10 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, monetary_account_id, cash_register_id, cash_register_qr_code_id) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def get(cls, api_context, user_id, monetary_account_id, cash_register_id, @@ -1940,7 +1955,7 @@ def get(cls, api_context, user_id, monetary_account_id, cash_register_id, :type cash_register_qr_code_id: int :type custom_headers: dict[str, str]|None - :rtype: CashRegisterQrCode + :rtype: model.BunqResponse[CashRegisterQrCode] """ if custom_headers is None: @@ -1951,9 +1966,9 @@ def get(cls, api_context, user_id, monetary_account_id, cash_register_id, monetary_account_id, cash_register_id, cash_register_qr_code_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, monetary_account_id, cash_register_id, @@ -1967,7 +1982,7 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, :type cash_register_id: int :type custom_headers: dict[str, str]|None - :rtype: list[CashRegisterQrCode] + :rtype: model.BunqResponse[list[CashRegisterQrCode]] """ if custom_headers is None: @@ -1977,9 +1992,9 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id, cash_register_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def id_(self): @@ -2091,7 +2106,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -2101,9 +2116,10 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id, monetary_account_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def get(cls, api_context, user_id, monetary_account_id, cash_register_id, @@ -2117,7 +2133,7 @@ def get(cls, api_context, user_id, monetary_account_id, cash_register_id, :type cash_register_id: int :type custom_headers: dict[str, str]|None - :rtype: CashRegister + :rtype: model.BunqResponse[CashRegister] """ if custom_headers is None: @@ -2127,9 +2143,9 @@ def get(cls, api_context, user_id, monetary_account_id, cash_register_id, endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, monetary_account_id, cash_register_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def update(cls, api_context, request_map, user_id, monetary_account_id, @@ -2146,7 +2162,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type cash_register_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -2157,9 +2173,10 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_UPDATE.format(user_id, monetary_account_id, cash_register_id) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def list(cls, api_context, user_id, monetary_account_id, @@ -2172,7 +2189,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: list[CashRegister] + :rtype: model.BunqResponse[list[CashRegister]] """ if custom_headers is None: @@ -2181,9 +2198,9 @@ def list(cls, api_context, user_id, monetary_account_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def id_(self): @@ -2296,7 +2313,7 @@ def get(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_uuid: str :type custom_headers: dict[str, str]|None - :rtype: Tab + :rtype: model.BunqResponse[Tab] """ if custom_headers is None: @@ -2306,9 +2323,9 @@ def get(cls, api_context, user_id, monetary_account_id, cash_register_id, endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, monetary_account_id, cash_register_id, tab_uuid) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text) + return cls._from_json(response_raw) @classmethod def list(cls, api_context, user_id, monetary_account_id, cash_register_id, @@ -2322,7 +2339,7 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, :type cash_register_id: int :type custom_headers: dict[str, str]|None - :rtype: list[Tab] + :rtype: model.BunqResponse[list[Tab]] """ if custom_headers is None: @@ -2332,9 +2349,9 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id, cash_register_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text) + return cls._from_json_list(response_raw) @property def TabUsageSingle(self): @@ -2450,7 +2467,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type cash_register_id: int :type custom_headers: dict[str, str]|None - :rtype: str + :rtype: model.BunqResponse[str] """ if custom_headers is None: @@ -2461,9 +2478,10 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id, monetary_account_id, cash_register_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_uuid(response.text) + return cls._process_for_uuid(response_raw) @classmethod def update(cls, api_context, request_map, user_id, monetary_account_id, @@ -2482,7 +2500,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type tab_usage_single_uuid: str :type custom_headers: dict[str, str]|None - :rtype: str + :rtype: model.BunqResponse[str] """ if custom_headers is None: @@ -2494,9 +2512,10 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, monetary_account_id, cash_register_id, tab_usage_single_uuid) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_uuid(response.text) + return cls._process_for_uuid(response_raw) @classmethod def delete(cls, api_context, user_id, monetary_account_id, cash_register_id, @@ -2512,7 +2531,7 @@ def delete(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_usage_single_uuid: str :type custom_headers: dict[str, str]|None - :rtype None: + :rtype model.BunqResponse[None]: """ if custom_headers is None: @@ -2523,7 +2542,9 @@ def delete(cls, api_context, user_id, monetary_account_id, cash_register_id, monetary_account_id, cash_register_id, tab_usage_single_uuid) - api_client.delete(endpoint_url, custom_headers) + response_raw = api_client.delete(endpoint_url, custom_headers) + + return model.BunqResponse(None, response_raw.headers) @classmethod def get(cls, api_context, user_id, monetary_account_id, cash_register_id, @@ -2538,7 +2559,7 @@ def get(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_usage_single_uuid: str :type custom_headers: dict[str, str]|None - :rtype: TabUsageSingle + :rtype: model.BunqResponse[TabUsageSingle] """ if custom_headers is None: @@ -2549,9 +2570,9 @@ def get(cls, api_context, user_id, monetary_account_id, cash_register_id, monetary_account_id, cash_register_id, tab_usage_single_uuid) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, monetary_account_id, cash_register_id, @@ -2565,7 +2586,7 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, :type cash_register_id: int :type custom_headers: dict[str, str]|None - :rtype: list[TabUsageSingle] + :rtype: model.BunqResponse[list[TabUsageSingle]] """ if custom_headers is None: @@ -2575,9 +2596,9 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id, cash_register_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def uuid(self): @@ -2906,7 +2927,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type cash_register_id: int :type custom_headers: dict[str, str]|None - :rtype: str + :rtype: model.BunqResponse[str] """ if custom_headers is None: @@ -2917,9 +2938,10 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id, monetary_account_id, cash_register_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_uuid(response.text) + return cls._process_for_uuid(response_raw) @classmethod def update(cls, api_context, request_map, user_id, monetary_account_id, @@ -2940,7 +2962,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type tab_usage_multiple_uuid: str :type custom_headers: dict[str, str]|None - :rtype: str + :rtype: model.BunqResponse[str] """ if custom_headers is None: @@ -2952,9 +2974,10 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, monetary_account_id, cash_register_id, tab_usage_multiple_uuid) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_uuid(response.text) + return cls._process_for_uuid(response_raw) @classmethod def delete(cls, api_context, user_id, monetary_account_id, cash_register_id, @@ -2970,7 +2993,7 @@ def delete(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_usage_multiple_uuid: str :type custom_headers: dict[str, str]|None - :rtype None: + :rtype model.BunqResponse[None]: """ if custom_headers is None: @@ -2981,7 +3004,9 @@ def delete(cls, api_context, user_id, monetary_account_id, cash_register_id, monetary_account_id, cash_register_id, tab_usage_multiple_uuid) - api_client.delete(endpoint_url, custom_headers) + response_raw = api_client.delete(endpoint_url, custom_headers) + + return model.BunqResponse(None, response_raw.headers) @classmethod def get(cls, api_context, user_id, monetary_account_id, cash_register_id, @@ -2996,7 +3021,7 @@ def get(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_usage_multiple_uuid: str :type custom_headers: dict[str, str]|None - :rtype: TabUsageMultiple + :rtype: model.BunqResponse[TabUsageMultiple] """ if custom_headers is None: @@ -3007,9 +3032,9 @@ def get(cls, api_context, user_id, monetary_account_id, cash_register_id, monetary_account_id, cash_register_id, tab_usage_multiple_uuid) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, monetary_account_id, cash_register_id, @@ -3023,7 +3048,7 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, :type cash_register_id: int :type custom_headers: dict[str, str]|None - :rtype: list[TabUsageMultiple] + :rtype: model.BunqResponse[list[TabUsageMultiple]] """ if custom_headers is None: @@ -3033,9 +3058,9 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id, cash_register_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def uuid(self): @@ -3210,7 +3235,7 @@ def create(cls, api_context, request_map, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -3219,9 +3244,10 @@ def create(cls, api_context, request_map, user_id, custom_headers=None): api_client = client.ApiClient(api_context) request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def delete(cls, api_context, user_id, certificate_pinned_id, @@ -3234,7 +3260,7 @@ def delete(cls, api_context, user_id, certificate_pinned_id, :type certificate_pinned_id: int :type custom_headers: dict[str, str]|None - :rtype None: + :rtype model.BunqResponse[None]: """ if custom_headers is None: @@ -3243,7 +3269,9 @@ def delete(cls, api_context, user_id, certificate_pinned_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_DELETE.format(user_id, certificate_pinned_id) - api_client.delete(endpoint_url, custom_headers) + response_raw = api_client.delete(endpoint_url, custom_headers) + + return model.BunqResponse(None, response_raw.headers) @classmethod def list(cls, api_context, user_id, custom_headers=None): @@ -3254,7 +3282,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: list[CertificatePinned] + :rtype: model.BunqResponse[list[CertificatePinned]] """ if custom_headers is None: @@ -3262,9 +3290,9 @@ def list(cls, api_context, user_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @classmethod def get(cls, api_context, user_id, certificate_pinned_id, @@ -3277,7 +3305,7 @@ def get(cls, api_context, user_id, certificate_pinned_id, :type certificate_pinned_id: int :type custom_headers: dict[str, str]|None - :rtype: CertificatePinned + :rtype: model.BunqResponse[CertificatePinned] """ if custom_headers is None: @@ -3286,9 +3314,9 @@ def get(cls, api_context, user_id, certificate_pinned_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, certificate_pinned_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @property def certificate_chain(self): @@ -3353,7 +3381,7 @@ def create(cls, api_context, request_map, custom_headers=None): :type request_map: dict[str, object] :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -3362,9 +3390,10 @@ def create(cls, api_context, request_map, custom_headers=None): api_client = client.ApiClient(api_context) request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_CREATE - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def get(cls, api_context, device_server_id, custom_headers=None): @@ -3375,7 +3404,7 @@ def get(cls, api_context, device_server_id, custom_headers=None): :type device_server_id: int :type custom_headers: dict[str, str]|None - :rtype: DeviceServer + :rtype: model.BunqResponse[DeviceServer] """ if custom_headers is None: @@ -3383,9 +3412,9 @@ def get(cls, api_context, device_server_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_READ.format(device_server_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, custom_headers=None): @@ -3395,7 +3424,7 @@ def list(cls, api_context, custom_headers=None): :type api_context: context.ApiContext :type custom_headers: dict[str, str]|None - :rtype: list[DeviceServer] + :rtype: model.BunqResponse[list[DeviceServer]] """ if custom_headers is None: @@ -3403,9 +3432,9 @@ def list(cls, api_context, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def id_(self): @@ -3485,7 +3514,7 @@ def get(cls, api_context, device_id, custom_headers=None): :type device_id: int :type custom_headers: dict[str, str]|None - :rtype: Device + :rtype: model.BunqResponse[Device] """ if custom_headers is None: @@ -3493,9 +3522,9 @@ def get(cls, api_context, device_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_READ.format(device_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text) + return cls._from_json(response_raw) @classmethod def list(cls, api_context, custom_headers=None): @@ -3506,7 +3535,7 @@ def list(cls, api_context, custom_headers=None): :type api_context: context.ApiContext :type custom_headers: dict[str, str]|None - :rtype: list[Device] + :rtype: model.BunqResponse[list[Device]] """ if custom_headers is None: @@ -3514,9 +3543,9 @@ def list(cls, api_context, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text) + return cls._from_json_list(response_raw) @property def DevicePhone(self): @@ -3551,6 +3580,7 @@ class DevicePhone(model.BunqModel): # Field constants. FIELD_DESCRIPTION = "description" FIELD_PHONE_NUMBER = "phone_number" + FIELD_REMOVE_OLD_DEVICES = "remove_old_devices" # Object type. _OBJECT_TYPE = "DevicePhone" @@ -3647,7 +3677,7 @@ def list(cls, api_context, user_id, draft_share_invite_bank_id, :type draft_share_invite_bank_id: int :type custom_headers: dict[str, str]|None - :rtype: bytes + :rtype: model.BunqResponse[bytes] """ if custom_headers is None: @@ -3656,8 +3686,9 @@ def list(cls, api_context, user_id, draft_share_invite_bank_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, draft_share_invite_bank_id) + response_raw = api_client.get(endpoint_url, custom_headers) - return api_client.get(endpoint_url, custom_headers).content + return model.BunqResponse(response_raw.body_bytes, response_raw.headers) class DraftShareInviteBank(model.BunqModel): @@ -3707,7 +3738,7 @@ def create(cls, api_context, request_map, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -3716,9 +3747,10 @@ def create(cls, api_context, request_map, user_id, custom_headers=None): api_client = client.ApiClient(api_context) request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def get(cls, api_context, user_id, draft_share_invite_bank_id, @@ -3731,7 +3763,7 @@ def get(cls, api_context, user_id, draft_share_invite_bank_id, :type draft_share_invite_bank_id: int :type custom_headers: dict[str, str]|None - :rtype: DraftShareInviteBank + :rtype: model.BunqResponse[DraftShareInviteBank] """ if custom_headers is None: @@ -3740,9 +3772,9 @@ def get(cls, api_context, user_id, draft_share_invite_bank_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, draft_share_invite_bank_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def update(cls, api_context, request_map, user_id, @@ -3757,7 +3789,7 @@ def update(cls, api_context, request_map, user_id, :type draft_share_invite_bank_id: int :type custom_headers: dict[str, str]|None - :rtype: DraftShareInviteBank + :rtype: model.BunqResponse[DraftShareInviteBank] """ if custom_headers is None: @@ -3767,9 +3799,10 @@ def update(cls, api_context, request_map, user_id, request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_UPDATE.format(user_id, draft_share_invite_bank_id) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, custom_headers=None): @@ -3778,7 +3811,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: list[DraftShareInviteBank] + :rtype: model.BunqResponse[list[DraftShareInviteBank]] """ if custom_headers is None: @@ -3786,9 +3819,9 @@ def list(cls, api_context, user_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def user_alias_created(self): @@ -3871,7 +3904,7 @@ def list(cls, api_context, user_id, export_annual_overview_id, :type export_annual_overview_id: int :type custom_headers: dict[str, str]|None - :rtype: bytes + :rtype: model.BunqResponse[bytes] """ if custom_headers is None: @@ -3880,8 +3913,9 @@ def list(cls, api_context, user_id, export_annual_overview_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, export_annual_overview_id) + response_raw = api_client.get(endpoint_url, custom_headers) - return api_client.get(endpoint_url, custom_headers).content + return model.BunqResponse(response_raw.body_bytes, response_raw.headers) class ExportAnnualOverview(model.BunqModel): @@ -3926,7 +3960,7 @@ def create(cls, api_context, request_map, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -3935,9 +3969,10 @@ def create(cls, api_context, request_map, user_id, custom_headers=None): api_client = client.ApiClient(api_context) request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def get(cls, api_context, user_id, export_annual_overview_id, @@ -3950,7 +3985,7 @@ def get(cls, api_context, user_id, export_annual_overview_id, :type export_annual_overview_id: int :type custom_headers: dict[str, str]|None - :rtype: ExportAnnualOverview + :rtype: model.BunqResponse[ExportAnnualOverview] """ if custom_headers is None: @@ -3959,9 +3994,9 @@ def get(cls, api_context, user_id, export_annual_overview_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, export_annual_overview_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, custom_headers=None): @@ -3972,7 +4007,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: list[ExportAnnualOverview] + :rtype: model.BunqResponse[list[ExportAnnualOverview]] """ if custom_headers is None: @@ -3980,9 +4015,9 @@ def list(cls, api_context, user_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def id_(self): @@ -4050,7 +4085,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type customer_statement_id: int :type custom_headers: dict[str, str]|None - :rtype: bytes + :rtype: model.BunqResponse[bytes] """ if custom_headers is None: @@ -4060,8 +4095,9 @@ def list(cls, api_context, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id, customer_statement_id) + response_raw = api_client.get(endpoint_url, custom_headers) - return api_client.get(endpoint_url, custom_headers).content + return model.BunqResponse(response_raw.body_bytes, response_raw.headers) class CustomerStatementExport(model.BunqModel): @@ -4118,7 +4154,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -4128,9 +4164,10 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id, monetary_account_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def get(cls, api_context, user_id, monetary_account_id, @@ -4142,7 +4179,7 @@ def get(cls, api_context, user_id, monetary_account_id, :type customer_statement_export_id: int :type custom_headers: dict[str, str]|None - :rtype: CustomerStatementExport + :rtype: model.BunqResponse[CustomerStatementExport] """ if custom_headers is None: @@ -4152,9 +4189,9 @@ def get(cls, api_context, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, monetary_account_id, customer_statement_export_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, monetary_account_id, @@ -4165,7 +4202,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: list[CustomerStatementExport] + :rtype: model.BunqResponse[list[CustomerStatementExport]] """ if custom_headers is None: @@ -4174,9 +4211,9 @@ def list(cls, api_context, user_id, monetary_account_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @classmethod def delete(cls, api_context, user_id, monetary_account_id, @@ -4188,7 +4225,7 @@ def delete(cls, api_context, user_id, monetary_account_id, :type customer_statement_export_id: int :type custom_headers: dict[str, str]|None - :rtype None: + :rtype model.BunqResponse[None]: """ if custom_headers is None: @@ -4198,7 +4235,9 @@ def delete(cls, api_context, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_DELETE.format(user_id, monetary_account_id, customer_statement_export_id) - api_client.delete(endpoint_url, custom_headers) + response_raw = api_client.delete(endpoint_url, custom_headers) + + return model.BunqResponse(None, response_raw.headers) @property def id_(self): @@ -4307,7 +4346,7 @@ def list(cls, api_context, installation_id, custom_headers=None): :type installation_id: int :type custom_headers: dict[str, str]|None - :rtype: list[InstallationServerPublicKey] + :rtype: model.BunqResponse[list[InstallationServerPublicKey]] """ if custom_headers is None: @@ -4315,9 +4354,9 @@ def list(cls, api_context, installation_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(installation_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def server_public_key(self): @@ -4358,7 +4397,7 @@ def delete(cls, api_context, user_id, monetary_account_id, :type share_invite_bank_amount_used_id: int :type custom_headers: dict[str, str]|None - :rtype None: + :rtype model.BunqResponse[None]: """ if custom_headers is None: @@ -4369,7 +4408,9 @@ def delete(cls, api_context, user_id, monetary_account_id, monetary_account_id, share_invite_bank_inquiry_id, share_invite_bank_amount_used_id) - api_client.delete(endpoint_url, custom_headers) + response_raw = api_client.delete(endpoint_url, custom_headers) + + return model.BunqResponse(None, response_raw.headers) class ShareInviteBankInquiry(model.BunqModel): @@ -4439,7 +4480,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -4449,9 +4490,10 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id, monetary_account_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def get(cls, api_context, user_id, monetary_account_id, @@ -4465,7 +4507,7 @@ def get(cls, api_context, user_id, monetary_account_id, :type share_invite_bank_inquiry_id: int :type custom_headers: dict[str, str]|None - :rtype: ShareInviteBankInquiry + :rtype: model.BunqResponse[ShareInviteBankInquiry] """ if custom_headers is None: @@ -4475,9 +4517,9 @@ def get(cls, api_context, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, monetary_account_id, share_invite_bank_inquiry_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def update(cls, api_context, request_map, user_id, monetary_account_id, @@ -4493,7 +4535,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type share_invite_bank_inquiry_id: int :type custom_headers: dict[str, str]|None - :rtype: ShareInviteBankInquiry + :rtype: model.BunqResponse[ShareInviteBankInquiry] """ if custom_headers is None: @@ -4504,9 +4546,10 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_UPDATE.format(user_id, monetary_account_id, share_invite_bank_inquiry_id) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, monetary_account_id, @@ -4521,7 +4564,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: list[ShareInviteBankInquiry] + :rtype: model.BunqResponse[list[ShareInviteBankInquiry]] """ if custom_headers is None: @@ -4530,9 +4573,9 @@ def list(cls, api_context, user_id, monetary_account_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def alias(self): @@ -4673,7 +4716,7 @@ def get(cls, api_context, user_id, share_invite_bank_response_id, :type share_invite_bank_response_id: int :type custom_headers: dict[str, str]|None - :rtype: ShareInviteBankResponse + :rtype: model.BunqResponse[ShareInviteBankResponse] """ if custom_headers is None: @@ -4682,9 +4725,9 @@ def get(cls, api_context, user_id, share_invite_bank_response_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, share_invite_bank_response_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def update(cls, api_context, request_map, user_id, @@ -4698,7 +4741,7 @@ def update(cls, api_context, request_map, user_id, :type share_invite_bank_response_id: int :type custom_headers: dict[str, str]|None - :rtype: ShareInviteBankResponse + :rtype: model.BunqResponse[ShareInviteBankResponse] """ if custom_headers is None: @@ -4708,9 +4751,10 @@ def update(cls, api_context, request_map, user_id, request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_UPDATE.format(user_id, share_invite_bank_response_id) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, custom_headers=None): @@ -4721,7 +4765,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: list[ShareInviteBankResponse] + :rtype: model.BunqResponse[list[ShareInviteBankResponse]] """ if custom_headers is None: @@ -4729,9 +4773,9 @@ def list(cls, api_context, user_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def counter_alias(self): @@ -4894,7 +4938,7 @@ def create(cls, api_context, request_map, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -4903,9 +4947,10 @@ def create(cls, api_context, request_map, user_id, custom_headers=None): api_client = client.ApiClient(api_context) request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def get(cls, api_context, user_id, monetary_account_bank_id, @@ -4918,7 +4963,7 @@ def get(cls, api_context, user_id, monetary_account_bank_id, :type monetary_account_bank_id: int :type custom_headers: dict[str, str]|None - :rtype: MonetaryAccountBank + :rtype: model.BunqResponse[MonetaryAccountBank] """ if custom_headers is None: @@ -4927,9 +4972,9 @@ def get(cls, api_context, user_id, monetary_account_bank_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, monetary_account_bank_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def update(cls, api_context, request_map, user_id, monetary_account_bank_id, @@ -4943,7 +4988,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_bank_id, :type monetary_account_bank_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -4953,9 +4998,10 @@ def update(cls, api_context, request_map, user_id, monetary_account_bank_id, request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_UPDATE.format(user_id, monetary_account_bank_id) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def list(cls, api_context, user_id, custom_headers=None): @@ -4966,7 +5012,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: list[MonetaryAccountBank] + :rtype: model.BunqResponse[list[MonetaryAccountBank]] """ if custom_headers is None: @@ -4974,9 +5020,9 @@ def list(cls, api_context, user_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def id_(self): @@ -5208,7 +5254,7 @@ def get(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: MonetaryAccount + :rtype: model.BunqResponse[MonetaryAccount] """ if custom_headers is None: @@ -5217,9 +5263,9 @@ def get(cls, api_context, user_id, monetary_account_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, monetary_account_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text) + return cls._from_json(response_raw) @classmethod def list(cls, api_context, user_id, custom_headers=None): @@ -5230,7 +5276,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: list[MonetaryAccount] + :rtype: model.BunqResponse[list[MonetaryAccount]] """ if custom_headers is None: @@ -5238,9 +5284,9 @@ def list(cls, api_context, user_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text) + return cls._from_json_list(response_raw) @property def MonetaryAccountBank(self): @@ -5287,7 +5333,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -5297,9 +5343,10 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id, monetary_account_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def update(cls, api_context, request_map, user_id, monetary_account_id, @@ -5315,7 +5362,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type payment_batch_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -5326,9 +5373,10 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_UPDATE.format(user_id, monetary_account_id, payment_batch_id) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def get(cls, api_context, user_id, monetary_account_id, payment_batch_id, @@ -5342,7 +5390,7 @@ def get(cls, api_context, user_id, monetary_account_id, payment_batch_id, :type payment_batch_id: int :type custom_headers: dict[str, str]|None - :rtype: PaymentBatch + :rtype: model.BunqResponse[PaymentBatch] """ if custom_headers is None: @@ -5352,9 +5400,9 @@ def get(cls, api_context, user_id, monetary_account_id, payment_batch_id, endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, monetary_account_id, payment_batch_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, monetary_account_id, @@ -5367,7 +5415,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: list[PaymentBatch] + :rtype: model.BunqResponse[list[PaymentBatch]] """ if custom_headers is None: @@ -5376,9 +5424,9 @@ def list(cls, api_context, user_id, monetary_account_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def payments(self): @@ -5477,7 +5525,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -5487,9 +5535,10 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id, monetary_account_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def get(cls, api_context, user_id, monetary_account_id, payment_id, @@ -5503,7 +5552,7 @@ def get(cls, api_context, user_id, monetary_account_id, payment_id, :type payment_id: int :type custom_headers: dict[str, str]|None - :rtype: Payment + :rtype: model.BunqResponse[Payment] """ if custom_headers is None: @@ -5513,9 +5562,9 @@ def get(cls, api_context, user_id, monetary_account_id, payment_id, endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, monetary_account_id, payment_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, monetary_account_id, @@ -5529,7 +5578,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: list[Payment] + :rtype: model.BunqResponse[list[Payment]] """ if custom_headers is None: @@ -5538,9 +5587,9 @@ def list(cls, api_context, user_id, monetary_account_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def id_(self): @@ -5767,7 +5816,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type payment_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -5778,9 +5827,10 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id, monetary_account_id, payment_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def update(cls, api_context, request_map, user_id, monetary_account_id, @@ -5796,7 +5846,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type payment_chat_id: int :type custom_headers: dict[str, str]|None - :rtype: PaymentChat + :rtype: model.BunqResponse[PaymentChat] """ if custom_headers is None: @@ -5808,9 +5858,10 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, monetary_account_id, payment_id, payment_chat_id) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, monetary_account_id, payment_id, @@ -5824,7 +5875,7 @@ def list(cls, api_context, user_id, monetary_account_id, payment_id, :type payment_id: int :type custom_headers: dict[str, str]|None - :rtype: list[PaymentChat] + :rtype: model.BunqResponse[list[PaymentChat]] """ if custom_headers is None: @@ -5834,9 +5885,9 @@ def list(cls, api_context, user_id, monetary_account_id, payment_id, endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id, payment_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def id_(self): @@ -5907,7 +5958,7 @@ def get(cls, api_context, user_id, credential_password_ip_id, :type permitted_ip_id: int :type custom_headers: dict[str, str]|None - :rtype: PermittedIp + :rtype: model.BunqResponse[PermittedIp] """ if custom_headers is None: @@ -5917,9 +5968,9 @@ def get(cls, api_context, user_id, credential_password_ip_id, endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, credential_password_ip_id, permitted_ip_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def create(cls, api_context, request_map, user_id, @@ -5931,7 +5982,7 @@ def create(cls, api_context, request_map, user_id, :type credential_password_ip_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -5941,9 +5992,10 @@ def create(cls, api_context, request_map, user_id, request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id, credential_password_ip_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def list(cls, api_context, user_id, credential_password_ip_id, @@ -5954,7 +6006,7 @@ def list(cls, api_context, user_id, credential_password_ip_id, :type credential_password_ip_id: int :type custom_headers: dict[str, str]|None - :rtype: list[PermittedIp] + :rtype: model.BunqResponse[list[PermittedIp]] """ if custom_headers is None: @@ -5963,9 +6015,9 @@ def list(cls, api_context, user_id, credential_password_ip_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, credential_password_ip_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @classmethod def update(cls, api_context, request_map, user_id, @@ -5978,7 +6030,7 @@ def update(cls, api_context, request_map, user_id, :type permitted_ip_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -5989,9 +6041,10 @@ def update(cls, api_context, request_map, user_id, endpoint_url = cls._ENDPOINT_URL_UPDATE.format(user_id, credential_password_ip_id, permitted_ip_id) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @property def ip(self): @@ -6051,7 +6104,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -6061,9 +6114,10 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id, monetary_account_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def update(cls, api_context, request_map, user_id, monetary_account_id, @@ -6079,7 +6133,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type request_inquiry_batch_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -6090,9 +6144,10 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_UPDATE.format(user_id, monetary_account_id, request_inquiry_batch_id) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def get(cls, api_context, user_id, monetary_account_id, @@ -6106,7 +6161,7 @@ def get(cls, api_context, user_id, monetary_account_id, :type request_inquiry_batch_id: int :type custom_headers: dict[str, str]|None - :rtype: RequestInquiryBatch + :rtype: model.BunqResponse[RequestInquiryBatch] """ if custom_headers is None: @@ -6116,9 +6171,9 @@ def get(cls, api_context, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, monetary_account_id, request_inquiry_batch_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, monetary_account_id, @@ -6131,7 +6186,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: list[RequestInquiryBatch] + :rtype: model.BunqResponse[list[RequestInquiryBatch]] """ if custom_headers is None: @@ -6140,9 +6195,9 @@ def list(cls, api_context, user_id, monetary_account_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def request_inquiries(self): @@ -6260,7 +6315,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -6270,9 +6325,10 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id, monetary_account_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def update(cls, api_context, request_map, user_id, monetary_account_id, @@ -6287,7 +6343,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type request_inquiry_id: int :type custom_headers: dict[str, str]|None - :rtype: RequestInquiry + :rtype: model.BunqResponse[RequestInquiry] """ if custom_headers is None: @@ -6298,9 +6354,10 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_UPDATE.format(user_id, monetary_account_id, request_inquiry_id) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, monetary_account_id, @@ -6313,7 +6370,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: list[RequestInquiry] + :rtype: model.BunqResponse[list[RequestInquiry]] """ if custom_headers is None: @@ -6322,9 +6379,9 @@ def list(cls, api_context, user_id, monetary_account_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @classmethod def get(cls, api_context, user_id, monetary_account_id, request_inquiry_id, @@ -6338,7 +6395,7 @@ def get(cls, api_context, user_id, monetary_account_id, request_inquiry_id, :type request_inquiry_id: int :type custom_headers: dict[str, str]|None - :rtype: RequestInquiry + :rtype: model.BunqResponse[RequestInquiry] """ if custom_headers is None: @@ -6348,9 +6405,9 @@ def get(cls, api_context, user_id, monetary_account_id, request_inquiry_id, endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, monetary_account_id, request_inquiry_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @property def id_(self): @@ -6599,7 +6656,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type request_inquiry_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -6610,9 +6667,10 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id, monetary_account_id, request_inquiry_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def update(cls, api_context, request_map, user_id, monetary_account_id, @@ -6629,7 +6687,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type request_inquiry_chat_id: int :type custom_headers: dict[str, str]|None - :rtype: RequestInquiryChat + :rtype: model.BunqResponse[RequestInquiryChat] """ if custom_headers is None: @@ -6641,9 +6699,10 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, monetary_account_id, request_inquiry_id, request_inquiry_chat_id) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, monetary_account_id, request_inquiry_id, @@ -6657,7 +6716,7 @@ def list(cls, api_context, user_id, monetary_account_id, request_inquiry_id, :type request_inquiry_id: int :type custom_headers: dict[str, str]|None - :rtype: list[RequestInquiryChat] + :rtype: model.BunqResponse[list[RequestInquiryChat]] """ if custom_headers is None: @@ -6667,9 +6726,9 @@ def list(cls, api_context, user_id, monetary_account_id, request_inquiry_id, endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id, request_inquiry_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def id_(self): @@ -6751,7 +6810,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type request_response_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -6762,9 +6821,10 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id, monetary_account_id, request_response_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def update(cls, api_context, request_map, user_id, monetary_account_id, @@ -6781,7 +6841,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type request_response_chat_id: int :type custom_headers: dict[str, str]|None - :rtype: RequestResponseChat + :rtype: model.BunqResponse[RequestResponseChat] """ if custom_headers is None: @@ -6793,9 +6853,10 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, monetary_account_id, request_response_id, request_response_chat_id) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, monetary_account_id, @@ -6809,7 +6870,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type request_response_id: int :type custom_headers: dict[str, str]|None - :rtype: list[RequestResponseChat] + :rtype: model.BunqResponse[list[RequestResponseChat]] """ if custom_headers is None: @@ -6819,9 +6880,9 @@ def list(cls, api_context, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id, request_response_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def id_(self): @@ -6941,7 +7002,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type request_response_id: int :type custom_headers: dict[str, str]|None - :rtype: RequestResponse + :rtype: model.BunqResponse[RequestResponse] """ if custom_headers is None: @@ -6952,9 +7013,10 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_UPDATE.format(user_id, monetary_account_id, request_response_id) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, monetary_account_id, @@ -6967,7 +7029,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: list[RequestResponse] + :rtype: model.BunqResponse[list[RequestResponse]] """ if custom_headers is None: @@ -6976,9 +7038,9 @@ def list(cls, api_context, user_id, monetary_account_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @classmethod def get(cls, api_context, user_id, monetary_account_id, request_response_id, @@ -6992,7 +7054,7 @@ def get(cls, api_context, user_id, monetary_account_id, request_response_id, :type request_response_id: int :type custom_headers: dict[str, str]|None - :rtype: RequestResponse + :rtype: model.BunqResponse[RequestResponse] """ if custom_headers is None: @@ -7002,9 +7064,9 @@ def get(cls, api_context, user_id, monetary_account_id, request_response_id, endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, monetary_account_id, request_response_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @property def id_(self): @@ -7236,7 +7298,7 @@ def get(cls, api_context, user_id, monetary_account_id, schedule_id, :type schedule_instance_id: int :type custom_headers: dict[str, str]|None - :rtype: ScheduleInstance + :rtype: model.BunqResponse[ScheduleInstance] """ if custom_headers is None: @@ -7247,9 +7309,9 @@ def get(cls, api_context, user_id, monetary_account_id, schedule_id, monetary_account_id, schedule_id, schedule_instance_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def update(cls, api_context, request_map, user_id, monetary_account_id, @@ -7263,7 +7325,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type schedule_instance_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -7275,9 +7337,10 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, monetary_account_id, schedule_id, schedule_instance_id) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def list(cls, api_context, user_id, monetary_account_id, schedule_id, @@ -7289,7 +7352,7 @@ def list(cls, api_context, user_id, monetary_account_id, schedule_id, :type schedule_id: int :type custom_headers: dict[str, str]|None - :rtype: list[ScheduleInstance] + :rtype: model.BunqResponse[list[ScheduleInstance]] """ if custom_headers is None: @@ -7299,9 +7362,9 @@ def list(cls, api_context, user_id, monetary_account_id, schedule_id, endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id, schedule_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def state(self): @@ -7388,7 +7451,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -7398,9 +7461,10 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id, monetary_account_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def update(cls, api_context, request_map, user_id, monetary_account_id, @@ -7413,7 +7477,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type schedule_payment_batch_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -7424,9 +7488,10 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_UPDATE.format(user_id, monetary_account_id, schedule_payment_batch_id) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def delete(cls, api_context, user_id, monetary_account_id, @@ -7438,7 +7503,7 @@ def delete(cls, api_context, user_id, monetary_account_id, :type schedule_payment_batch_id: int :type custom_headers: dict[str, str]|None - :rtype None: + :rtype model.BunqResponse[None]: """ if custom_headers is None: @@ -7448,7 +7513,9 @@ def delete(cls, api_context, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_DELETE.format(user_id, monetary_account_id, schedule_payment_batch_id) - api_client.delete(endpoint_url, custom_headers) + response_raw = api_client.delete(endpoint_url, custom_headers) + + return model.BunqResponse(None, response_raw.headers) @property def payments(self): @@ -7503,7 +7570,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -7513,9 +7580,10 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id, monetary_account_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def delete(cls, api_context, user_id, monetary_account_id, @@ -7527,7 +7595,7 @@ def delete(cls, api_context, user_id, monetary_account_id, :type schedule_payment_id: int :type custom_headers: dict[str, str]|None - :rtype None: + :rtype model.BunqResponse[None]: """ if custom_headers is None: @@ -7537,7 +7605,9 @@ def delete(cls, api_context, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_DELETE.format(user_id, monetary_account_id, schedule_payment_id) - api_client.delete(endpoint_url, custom_headers) + response_raw = api_client.delete(endpoint_url, custom_headers) + + return model.BunqResponse(None, response_raw.headers) @classmethod def get(cls, api_context, user_id, monetary_account_id, schedule_payment_id, @@ -7549,7 +7619,7 @@ def get(cls, api_context, user_id, monetary_account_id, schedule_payment_id, :type schedule_payment_id: int :type custom_headers: dict[str, str]|None - :rtype: SchedulePayment + :rtype: model.BunqResponse[SchedulePayment] """ if custom_headers is None: @@ -7559,9 +7629,9 @@ def get(cls, api_context, user_id, monetary_account_id, schedule_payment_id, endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, monetary_account_id, schedule_payment_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, monetary_account_id, @@ -7572,7 +7642,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: list[SchedulePayment] + :rtype: model.BunqResponse[list[SchedulePayment]] """ if custom_headers is None: @@ -7581,9 +7651,9 @@ def list(cls, api_context, user_id, monetary_account_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @classmethod def update(cls, api_context, request_map, user_id, monetary_account_id, @@ -7596,7 +7666,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type schedule_payment_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -7607,9 +7677,10 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_UPDATE.format(user_id, monetary_account_id, schedule_payment_id) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @property def payment(self): @@ -7652,7 +7723,7 @@ def get(cls, api_context, user_id, monetary_account_id, schedule_id, :type schedule_id: int :type custom_headers: dict[str, str]|None - :rtype: Schedule + :rtype: model.BunqResponse[Schedule] """ if custom_headers is None: @@ -7662,9 +7733,9 @@ def get(cls, api_context, user_id, monetary_account_id, schedule_id, endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, monetary_account_id, schedule_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, monetary_account_id, @@ -7681,7 +7752,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: list[Schedule] + :rtype: model.BunqResponse[list[Schedule]] """ if custom_headers is None: @@ -7690,9 +7761,9 @@ def list(cls, api_context, user_id, monetary_account_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) class ScheduleUser(model.BunqModel): @@ -7720,7 +7791,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: list[ScheduleUser] + :rtype: model.BunqResponse[list[ScheduleUser]] """ if custom_headers is None: @@ -7728,9 +7799,9 @@ def list(cls, api_context, user_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) class Session(model.BunqModel): @@ -7753,7 +7824,7 @@ def delete(cls, api_context, session_id, custom_headers=None): :type session_id: int :type custom_headers: dict[str, str]|None - :rtype None: + :rtype model.BunqResponse[None]: """ if custom_headers is None: @@ -7761,7 +7832,9 @@ def delete(cls, api_context, session_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_DELETE.format(session_id) - api_client.delete(endpoint_url, custom_headers) + response_raw = api_client.delete(endpoint_url, custom_headers) + + return model.BunqResponse(None, response_raw.headers) class TabItemShopBatch(model.BunqModel): @@ -7798,7 +7871,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type tab_uuid: str :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -7810,9 +7883,10 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, monetary_account_id, cash_register_id, tab_uuid) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @property def tab_items(self): @@ -7888,7 +7962,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type tab_uuid: str :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -7900,9 +7974,10 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, monetary_account_id, cash_register_id, tab_uuid) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def update(cls, api_context, request_map, user_id, monetary_account_id, @@ -7920,7 +7995,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type tab_item_shop_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -7933,9 +8008,10 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, cash_register_id, tab_uuid, tab_item_shop_id) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @classmethod def delete(cls, api_context, user_id, monetary_account_id, cash_register_id, @@ -7952,7 +8028,7 @@ def delete(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_item_shop_id: int :type custom_headers: dict[str, str]|None - :rtype None: + :rtype model.BunqResponse[None]: """ if custom_headers is None: @@ -7964,7 +8040,9 @@ def delete(cls, api_context, user_id, monetary_account_id, cash_register_id, cash_register_id, tab_uuid, tab_item_shop_id) - api_client.delete(endpoint_url, custom_headers) + response_raw = api_client.delete(endpoint_url, custom_headers) + + return model.BunqResponse(None, response_raw.headers) @classmethod def list(cls, api_context, user_id, monetary_account_id, cash_register_id, @@ -7979,7 +8057,7 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_uuid: str :type custom_headers: dict[str, str]|None - :rtype: list[TabItemShop] + :rtype: model.BunqResponse[list[TabItemShop]] """ if custom_headers is None: @@ -7990,9 +8068,9 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, monetary_account_id, cash_register_id, tab_uuid) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @classmethod def get(cls, api_context, user_id, monetary_account_id, cash_register_id, @@ -8008,7 +8086,7 @@ def get(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_item_shop_id: int :type custom_headers: dict[str, str]|None - :rtype: TabItemShop + :rtype: model.BunqResponse[TabItemShop] """ if custom_headers is None: @@ -8019,9 +8097,9 @@ def get(cls, api_context, user_id, monetary_account_id, cash_register_id, monetary_account_id, cash_register_id, tab_uuid, tab_item_shop_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @property def id_(self): @@ -8117,7 +8195,7 @@ def get(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_result_inquiry_id: int :type custom_headers: dict[str, str]|None - :rtype: TabResultInquiry + :rtype: model.BunqResponse[TabResultInquiry] """ if custom_headers is None: @@ -8128,9 +8206,9 @@ def get(cls, api_context, user_id, monetary_account_id, cash_register_id, monetary_account_id, cash_register_id, tab_uuid, tab_result_inquiry_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, monetary_account_id, cash_register_id, @@ -8145,7 +8223,7 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_uuid: str :type custom_headers: dict[str, str]|None - :rtype: list[TabResultInquiry] + :rtype: model.BunqResponse[list[TabResultInquiry]] """ if custom_headers is None: @@ -8156,9 +8234,9 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, monetary_account_id, cash_register_id, tab_uuid) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def tab(self): @@ -8210,7 +8288,7 @@ def get(cls, api_context, user_id, monetary_account_id, :type tab_result_response_id: int :type custom_headers: dict[str, str]|None - :rtype: TabResultResponse + :rtype: model.BunqResponse[TabResultResponse] """ if custom_headers is None: @@ -8220,9 +8298,9 @@ def get(cls, api_context, user_id, monetary_account_id, endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, monetary_account_id, tab_result_response_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, monetary_account_id, @@ -8235,7 +8313,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: list[TabResultResponse] + :rtype: model.BunqResponse[list[TabResultResponse]] """ if custom_headers is None: @@ -8244,9 +8322,9 @@ def list(cls, api_context, user_id, monetary_account_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id, monetary_account_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def tab(self): @@ -8294,7 +8372,7 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_uuid: str :type custom_headers: dict[str, str]|None - :rtype: bytes + :rtype: model.BunqResponse[bytes] """ if custom_headers is None: @@ -8305,8 +8383,9 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, monetary_account_id, cash_register_id, tab_uuid) + response_raw = api_client.get(endpoint_url, custom_headers) - return api_client.get(endpoint_url, custom_headers).content + return model.BunqResponse(response_raw.body_bytes, response_raw.headers) class TokenQrRequestIdeal(model.BunqModel): @@ -8383,7 +8462,7 @@ def create(cls, api_context, request_map, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: TokenQrRequestIdeal + :rtype: model.BunqResponse[TokenQrRequestIdeal] """ if custom_headers is None: @@ -8392,9 +8471,10 @@ def create(cls, api_context, request_map, user_id, custom_headers=None): api_client = client.ApiClient(api_context) request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_CREATE.format(user_id) - response = api_client.post(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.post(endpoint_url, request_bytes, + custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @property def time_responded(self): @@ -8651,7 +8731,7 @@ def get(cls, api_context, user_company_id, custom_headers=None): :type user_company_id: int :type custom_headers: dict[str, str]|None - :rtype: UserCompany + :rtype: model.BunqResponse[UserCompany] """ if custom_headers is None: @@ -8659,9 +8739,9 @@ def get(cls, api_context, user_company_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_READ.format(user_company_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def update(cls, api_context, request_map, user_company_id, @@ -8674,7 +8754,7 @@ def update(cls, api_context, request_map, user_company_id, :type user_company_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -8683,9 +8763,10 @@ def update(cls, api_context, request_map, user_company_id, api_client = client.ApiClient(api_context) request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_UPDATE.format(user_company_id) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @property def id_(self): @@ -8893,9 +8974,6 @@ class UserCredentialPasswordIp(model.BunqModel): Create a credential of a user for server authentication, or delete the credential of a user for server authentication. - :type _id_: int - :type _created: str - :type _updated: str :type _status: str :type _expiry_time: str :type _token_value: str @@ -8910,9 +8988,6 @@ class UserCredentialPasswordIp(model.BunqModel): _OBJECT_TYPE = "CredentialPasswordIp" def __init__(self): - self._id_ = None - self._created = None - self._updated = None self._status = None self._expiry_time = None self._token_value = None @@ -8927,7 +9002,7 @@ def get(cls, api_context, user_id, user_credential_password_ip_id, :type user_credential_password_ip_id: int :type custom_headers: dict[str, str]|None - :rtype: UserCredentialPasswordIp + :rtype: model.BunqResponse[UserCredentialPasswordIp] """ if custom_headers is None: @@ -8936,9 +9011,9 @@ def get(cls, api_context, user_id, user_credential_password_ip_id, api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_READ.format(user_id, user_credential_password_ip_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def list(cls, api_context, user_id, custom_headers=None): @@ -8947,7 +9022,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: list[UserCredentialPasswordIp] + :rtype: model.BunqResponse[list[UserCredentialPasswordIp]] """ if custom_headers is None: @@ -8955,33 +9030,9 @@ def list(cls, api_context, user_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING.format(user_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text, cls._OBJECT_TYPE) - - @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 + return cls._from_json_list(response_raw, cls._OBJECT_TYPE) @property def status(self): @@ -9133,7 +9184,7 @@ def get(cls, api_context, user_person_id, custom_headers=None): :type user_person_id: int :type custom_headers: dict[str, str]|None - :rtype: UserPerson + :rtype: model.BunqResponse[UserPerson] """ if custom_headers is None: @@ -9141,9 +9192,9 @@ def get(cls, api_context, user_person_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_READ.format(user_person_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @classmethod def update(cls, api_context, request_map, user_person_id, @@ -9156,7 +9207,7 @@ def update(cls, api_context, request_map, user_person_id, :type user_person_id: int :type custom_headers: dict[str, str]|None - :rtype: int + :rtype: model.BunqResponse[int] """ if custom_headers is None: @@ -9165,9 +9216,10 @@ def update(cls, api_context, request_map, user_person_id, api_client = client.ApiClient(api_context) request_bytes = converter.class_to_json(request_map).encode() endpoint_url = cls._ENDPOINT_URL_UPDATE.format(user_person_id) - response = api_client.put(endpoint_url, request_bytes, custom_headers) + response_raw = api_client.put(endpoint_url, request_bytes, + custom_headers) - return cls._process_for_id(response.text) + return cls._process_for_id(response_raw) @property def id_(self): @@ -9449,7 +9501,7 @@ def get(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: User + :rtype: model.BunqResponse[User] """ if custom_headers is None: @@ -9457,9 +9509,9 @@ def get(cls, api_context, user_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_READ.format(user_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text) + return cls._from_json(response_raw) @classmethod def list(cls, api_context, custom_headers=None): @@ -9469,7 +9521,7 @@ def list(cls, api_context, custom_headers=None): :type api_context: context.ApiContext :type custom_headers: dict[str, str]|None - :rtype: list[User] + :rtype: model.BunqResponse[list[User]] """ if custom_headers is None: @@ -9477,9 +9529,9 @@ def list(cls, api_context, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_LISTING - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json_list(response.text) + return cls._from_json_list(response_raw) @property def UserLight(self): @@ -9625,7 +9677,7 @@ def get(cls, api_context, user_light_id, custom_headers=None): :type user_light_id: int :type custom_headers: dict[str, str]|None - :rtype: UserLight + :rtype: model.BunqResponse[UserLight] """ if custom_headers is None: @@ -9633,9 +9685,9 @@ def get(cls, api_context, user_light_id, custom_headers=None): api_client = client.ApiClient(api_context) endpoint_url = cls._ENDPOINT_URL_READ.format(user_light_id) - response = api_client.get(endpoint_url, custom_headers) + response_raw = api_client.get(endpoint_url, custom_headers) - return cls._from_json(response.text, cls._OBJECT_TYPE) + return cls._from_json(response_raw, cls._OBJECT_TYPE) @property def id_(self): diff --git a/bunq/sdk/model/model.py b/bunq/sdk/model/model.py index f04b922..3a0a4fb 100644 --- a/bunq/sdk/model/model.py +++ b/bunq/sdk/model/model.py @@ -20,33 +20,37 @@ def to_json(self): return converter.class_to_json(self) @classmethod - def _from_json_array_nested(cls, response_json): + def _from_json_array_nested(cls, response_raw): """ - :type response_json: str + :type response_raw: client.BunqResponseRaw - :rtype: cls + :rtype: BunqResponse[cls] """ - obj = converter.json_to_class(dict, response_json) + json = response_raw.body_bytes.decode() + obj = converter.json_to_class(dict, json) + value = converter.deserialize(cls, obj[cls._FIELD_RESPONSE]) - return converter.deserialize(cls, obj[cls._FIELD_RESPONSE]) + return BunqResponse(value, response_raw.headers) @classmethod - def _from_json(cls, response_json, wrapper=None): + def _from_json(cls, response_raw, wrapper=None): """ - :type response_json: str + :type response_raw: client.BunqResponseRaw :type wrapper: str|None - :rtype: cls + :rtype: BunqResponse[cls] """ - obj = converter.json_to_class(dict, response_json) - - return converter.deserialize( + json = response_raw.body_bytes.decode() + obj = converter.json_to_class(dict, json) + value = converter.deserialize( cls, cls._unwrap_response_single(obj, wrapper) ) + return BunqResponse(value, response_raw.headers) + @classmethod def _unwrap_response_single(cls, obj, wrapper=None): """ @@ -62,47 +66,50 @@ def _unwrap_response_single(cls, obj, wrapper=None): return obj[cls._FIELD_RESPONSE][cls._INDEX_FIRST] @classmethod - def _process_for_id(cls, response_json): + def _process_for_id(cls, response_raw): """ - :type response_json: str + :type response_raw: client.BunqResponseRaw - :rtype: Id + :rtype: BunqResponse[int] """ - obj = converter.json_to_class(dict, response_json) + json = response_raw.body_bytes.decode() + obj = converter.json_to_class(dict, json) id_ = converter.deserialize( Id, cls._unwrap_response_single(obj, cls._FIELD_ID) ) - return id_.id_ + return BunqResponse(id_.id_, response_raw.headers) @classmethod - def _process_for_uuid(cls, response_json): + def _process_for_uuid(cls, response_raw): """ - :type response_json: str + :type response_raw: client.BunqResponseRaw - :rtype: Uuid + :rtype: BunqResponse[str] """ - obj = converter.json_to_class(dict, response_json) + json = response_raw.body_bytes.decode() + obj = converter.json_to_class(dict, json) uuid = converter.deserialize( Uuid, cls._unwrap_response_single(obj, cls._FIELD_UUID) ) - return uuid.uuid + return BunqResponse(uuid.uuid, response_raw.headers) @classmethod - def _from_json_list(cls, response_json, wrapper=None): + def _from_json_list(cls, response_raw, wrapper=None): """ - :type response_json: str + :type response_raw: client.BunqResponseRaw :type wrapper: str|None - :rtype: list[cls] + :rtype: BunqResponse[list[cls]] """ - obj = converter.json_to_class(dict, response_json) + json = response_raw.body_bytes.decode() + obj = converter.json_to_class(dict, json) array = obj[cls._FIELD_RESPONSE] array_deserialized = [] @@ -111,7 +118,7 @@ def _from_json_list(cls, response_json, wrapper=None): item_deserialized = converter.deserialize(cls, item_unwrapped) array_deserialized.append(item_deserialized) - return array_deserialized + return BunqResponse(array_deserialized, response_raw.headers) class Id(BunqModel): @@ -230,16 +237,16 @@ def create(cls, api_context, public_key_string): :type api_context: context.ApiContext :type public_key_string: str - :rtype: Installation + :rtype: BunqResponse[Installation] """ api_client = client.ApiClient(api_context) body_bytes = cls.generate_request_body_bytes( public_key_string ) - response = api_client.post(cls._ENDPOINT_URL_POST, body_bytes, {}) + response_raw = api_client.post(cls._ENDPOINT_URL_POST, body_bytes, {}) - return cls._from_json_array_nested(response.text) + return cls._from_json_array_nested(response_raw) @classmethod def generate_request_body_bytes(cls, public_key_string): @@ -256,54 +263,6 @@ def generate_request_body_bytes(cls, public_key_string): ).encode() -class DeviceServer(BunqModel): - # Endpoint name. - _ENDPOINT_URL_POST = "device-server" - - # Field constants - FIELD_DESCRIPTION = "description" - FIELD_SECRET = "secret" - FIELD_PERMITTED_IPS = "permitted_ips" - - @classmethod - def create(cls, api_context, description, permitted_ips): - """ - :type api_context: context.ApiContext - :type description: str - :type permitted_ips: list[str] - - :rtype: int - """ - - api_client = client.ApiClient(api_context) - body_bytes = cls.generate_request_body_bytes( - description, - api_context.api_key, - permitted_ips - ) - response = api_client.post(cls._ENDPOINT_URL_POST, body_bytes, {}) - - return cls._process_for_id(response.text) - - @classmethod - def generate_request_body_bytes(cls, description, secret, permitted_ips): - """ - :type description: str - :type secret: str - :type permitted_ips: list[str] - - :rtype: bytes - """ - - return converter.class_to_json( - { - cls.FIELD_DESCRIPTION: description, - cls.FIELD_SECRET: secret, - cls.FIELD_PERMITTED_IPS: permitted_ips, - } - ).encode() - - class SessionServer(BunqModel): """ :type _id_: Id @@ -361,14 +320,14 @@ def create(cls, api_context): """ :type api_context: context.ApiContext - :rtype: SessionServer + :rtype: BunqResponse[SessionServer] """ api_client = client.ApiClient(api_context) body_bytes = cls.generate_request_body_bytes(api_context.api_key) - response = api_client.post(cls._ENDPOINT_URL_POST, body_bytes, {}) + response_raw = api_client.post(cls._ENDPOINT_URL_POST, body_bytes, {}) - return cls._from_json_array_nested(response.text) + return cls._from_json_array_nested(response_raw) @classmethod def generate_request_body_bytes(cls, secret): @@ -379,3 +338,35 @@ def generate_request_body_bytes(cls, secret): """ return converter.class_to_json({cls.FIELD_SECRET: secret}).encode() + + +class BunqResponse(object): + """ + :type _value: T + :type _headers: dict[str, str] + """ + + def __init__(self, value, headers): + """ + :type value: T + :type headers: dict[str, str] + """ + + self._value = value + self._headers = headers + + @property + def value(self): + """ + :rtype: T + """ + + return self._value + + @property + def headers(self): + """ + :rtype: dict[str, str] + """ + + return self._headers diff --git a/examples/api_context_save_example.py b/examples/api_context_save_example.py index 1153195..4528bea 100644 --- a/examples/api_context_save_example.py +++ b/examples/api_context_save_example.py @@ -7,7 +7,7 @@ def run(): ctx = context.ApiContext( context.ApiEnvironmentType.SANDBOX, - '###YOUR_API_KEY###', # Put your API key here + '### YOUR_API_KEY ###', # Put your API key here 'test device python' ) diff --git a/examples/attachment_public_example.py b/examples/attachment_public_example.py index 5dbbc42..bb06d72 100644 --- a/examples/attachment_public_example.py +++ b/examples/attachment_public_example.py @@ -28,11 +28,11 @@ def run(): api_context, attachment_bytes, custom_headers - ) + ).value attachment_bytes2 = generated.AttachmentPublicContent.list( api_context, attachment_uuid - ) + ).value if not os.path.exists(os.path.dirname(_PATH_ATTACHMENT_OUT)): try: diff --git a/examples/card_debit_example.py b/examples/card_debit_example.py index 16b9aec..b67b41f 100644 --- a/examples/card_debit_example.py +++ b/examples/card_debit_example.py @@ -32,7 +32,7 @@ def run(): } print(generated.CardDebit.create(api_context, request_map, - _USER_ITEM_ID).to_json()) + _USER_ITEM_ID).value.to_json()) def _make_second_line(): diff --git a/examples/customer_statement_export_example.py b/examples/customer_statement_export_example.py index ae2cf1a..e0e8612 100644 --- a/examples/customer_statement_export_example.py +++ b/examples/customer_statement_export_example.py @@ -13,14 +13,18 @@ # Date format required for customer statement export endpoint _FORMAT_DATE = '%Y-%m-%d' +# Index of the very first item in an array +_INDEX_FIRST = 0 + def run(): api_context = context.ApiContext.restore() - user_id = generated.User.list(api_context)[0].UserCompany.id_ + user_id = generated.User.list(api_context).value[_INDEX_FIRST]\ + .UserCompany.id_ monetary_account_id = generated.MonetaryAccountBank.list( api_context, user_id - )[0].id_ + ).value[_INDEX_FIRST].id_ date_start = datetime.datetime.now() date_start -= datetime.timedelta(_DAYS_IN_WEEK) @@ -40,7 +44,7 @@ def run(): customer_statement_map, user_id, monetary_account_id - ) + ).value generated.CustomerStatementExport.delete( api_context, user_id, diff --git a/examples/payment_batch_example.py b/examples/payment_batch_example.py index ed92f81..528ca7d 100644 --- a/examples/payment_batch_example.py +++ b/examples/payment_batch_example.py @@ -35,7 +35,7 @@ def run(): request_map, _USER_ITEM_ID, _MONETARY_ACCOUNT_ITEM_ID - ) + ).value print( generated.PaymentBatch.get( @@ -43,5 +43,5 @@ def run(): _USER_ITEM_ID, _MONETARY_ACCOUNT_ITEM_ID, payment_id - ).to_json() + ).value.to_json() ) diff --git a/examples/payment_example.py b/examples/payment_example.py index fabd328..8b760c9 100644 --- a/examples/payment_example.py +++ b/examples/payment_example.py @@ -32,7 +32,7 @@ def run(): request_map, _USER_ITEM_ID, _MONETARY_ACCOUNT_ITEM_ID - ) + ).value print( generated.Payment.get( @@ -40,5 +40,5 @@ def run(): _USER_ITEM_ID, _MONETARY_ACCOUNT_ITEM_ID, payment_id - ).to_json() + ).value.to_json() ) diff --git a/examples/payment_list_example.py b/examples/payment_list_example.py index 58da525..d7070bd 100644 --- a/examples/payment_list_example.py +++ b/examples/payment_list_example.py @@ -13,7 +13,7 @@ def run(): api_context, _USER_ITEM_ID, _MONETARY_ACCOUNT_ITEM_ID, - ) + ).value for payment in payments: print(payment.id_) diff --git a/examples/request_example.py b/examples/request_example.py index 529b745..71b44f0 100644 --- a/examples/request_example.py +++ b/examples/request_example.py @@ -33,14 +33,14 @@ def run(): request_map, _USER_ITEM_ID, _MONETARY_ACCOUNT_ITEM_ID - ) + ).value print( generated.RequestInquiry.get( api_context, _USER_ITEM_ID, _MONETARY_ACCOUNT_ITEM_ID, request_id - ).to_json() + ).value.to_json() ) request_update_map = { @@ -53,5 +53,5 @@ def run(): _USER_ITEM_ID, _MONETARY_ACCOUNT_ITEM_ID, request_id - ).to_json() + ).value.to_json() ) diff --git a/examples/user_list_example.py b/examples/user_list_example.py index 68bb992..f58f7de 100644 --- a/examples/user_list_example.py +++ b/examples/user_list_example.py @@ -6,7 +6,7 @@ def run(): api_context = context.ApiContext.restore() - users = generated.User.list(api_context) + users = generated.User.list(api_context).value api_context.save() for user in users: From b498d2ecba383c5163c448d3ace5741593c0837a Mon Sep 17 00:00:00 2001 From: Daniil Belyakov Date: Tue, 8 Aug 2017 16:41:00 +0200 Subject: [PATCH 2/4] #9 switch tests to BunqResponse --- tests/model/generated/test_attachment_public.py | 8 +++++--- tests/model/generated/test_avatar.py | 13 ++++++++----- tests/model/generated/test_card_debit.py | 10 +++++----- .../generated/test_draft_share_invite_bank.py | 4 ++-- .../generated/test_monetary_account_bank.py | 2 +- tests/model/generated/test_payment.py | 17 +++++++++++++---- tests/model/generated/test_request_inquiry.py | 9 +++++---- tests/model/generated/test_tab_usage_single.py | 2 +- 8 files changed, 40 insertions(+), 25 deletions(-) diff --git a/tests/model/generated/test_attachment_public.py b/tests/model/generated/test_attachment_public.py index cfc0204..b5303ea 100644 --- a/tests/model/generated/test_attachment_public.py +++ b/tests/model/generated/test_attachment_public.py @@ -37,10 +37,12 @@ def test_file_upload_and_retrieval(self): attachment_uuid = AttachmentPublic.create(self._API_CONTEXT, self.attachment_contents, - custom_headers) + custom_headers).value - contents_from_response = AttachmentPublicContent.list(self._API_CONTEXT, - attachment_uuid) + contents_from_response = AttachmentPublicContent.list( + self._API_CONTEXT, + attachment_uuid + ).value self.assertEqual(self.attachment_contents, contents_from_response) diff --git a/tests/model/generated/test_avatar.py b/tests/model/generated/test_avatar.py index eb6f7bb..02f902e 100644 --- a/tests/model/generated/test_avatar.py +++ b/tests/model/generated/test_avatar.py @@ -35,19 +35,22 @@ def test_avatar_creation(self): self._ATTACHMENT_DESCRIPTION, ApiClient.HEADER_CONTENT_TYPE: self._CONTENT_TYPE } - attachment_public_uuid = AttachmentPublic \ - .create(self._API_CONTEXT, self.attachment_contents, custom_header) + attachment_public_uuid = AttachmentPublic.create( + self._API_CONTEXT, + self.attachment_contents, + custom_header + ).value avatar_map = { Avatar.FIELD_ATTACHMENT_PUBLIC_UUID: attachment_public_uuid } - avatar_uuid = Avatar.create(self._API_CONTEXT, avatar_map) + avatar_uuid = Avatar.create(self._API_CONTEXT, avatar_map).value attachment_uuid_after = Avatar.get(self._API_CONTEXT, avatar_uuid) \ - .image[self._FIRST_INDEX].attachment_public_uuid + .value.image[self._FIRST_INDEX].attachment_public_uuid file_contents_received = AttachmentPublicContent.list( self._API_CONTEXT, attachment_uuid_after - ) + ).value self.assertEqual(self.attachment_contents, file_contents_received) @property diff --git a/tests/model/generated/test_card_debit.py b/tests/model/generated/test_card_debit.py index 2515619..d843b34 100644 --- a/tests/model/generated/test_card_debit.py +++ b/tests/model/generated/test_card_debit.py @@ -43,8 +43,8 @@ def test_order_debit_card(self): CardDebit.FIELD_SECOND_LINE: second_line } card_debit = CardDebit.create(self._API_CONTEXT, card_debit_map, - self._USER_ID) - card = Card.get(self._API_CONTEXT, self._USER_ID, card_debit.id_) + self._USER_ID).value + card = Card.get(self._API_CONTEXT, self._USER_ID, card_debit.id_).value self.assertEqual(self.card_name_allowed, card.name_on_card) self.assertEqual(second_line, card.second_line) @@ -56,8 +56,8 @@ def alias_first(self): :rtype: Pointer """ - return User.list(self._API_CONTEXT)[self._FIRST_INDEX].UserCompany \ - .alias[self._FIRST_INDEX] + return User.list(self._API_CONTEXT).value[self._FIRST_INDEX] \ + .UserCompany.alias[self._FIRST_INDEX] @property def card_name_allowed(self): @@ -65,7 +65,7 @@ def card_name_allowed(self): :rtype: str """ - return CardName.list(self._API_CONTEXT, self._USER_ID)[ + return CardName.list(self._API_CONTEXT, self._USER_ID).value[ self._FIRST_INDEX].possible_card_name_array[self._FIRST_INDEX] @property diff --git a/tests/model/generated/test_draft_share_invite_bank.py b/tests/model/generated/test_draft_share_invite_bank.py index 3fff1d4..05825c9 100644 --- a/tests/model/generated/test_draft_share_invite_bank.py +++ b/tests/model/generated/test_draft_share_invite_bank.py @@ -43,11 +43,11 @@ def test_draft_share_invite_bank(self): DraftShareInviteBank.FIELD_EXPIRATION: self.expiration_date } draft_id = DraftShareInviteBank.create(self._API_CONTEXT, draft_map, - self._USER_ID) + self._USER_ID).value connect_qr = DraftShareInviteBankQrCodeContent.list(self._API_CONTEXT, self._USER_ID, - draft_id,) + draft_id).value with open(self._OUT_PUT_FILE_PATH, self._WRITE_BYTES) as f: f.write(connect_qr) diff --git a/tests/model/generated/test_monetary_account_bank.py b/tests/model/generated/test_monetary_account_bank.py index 5bdfee8..93e5182 100644 --- a/tests/model/generated/test_monetary_account_bank.py +++ b/tests/model/generated/test_monetary_account_bank.py @@ -38,7 +38,7 @@ def test_create_new_monetary_account(self): } monetary_account_id = MonetaryAccountBank.create(self._API_CONTEXT, create_map, - self._USER_ID) + self._USER_ID).value update_map = { MonetaryAccountBank.FIELD_STATUS: self._FIELD_STATUS, diff --git a/tests/model/generated/test_payment.py b/tests/model/generated/test_payment.py index e938737..2c5ff2b 100644 --- a/tests/model/generated/test_payment.py +++ b/tests/model/generated/test_payment.py @@ -74,12 +74,21 @@ def test_payment_chat(self): self._PAYMENT_CURRENCY), Payment.FIELD_DESCRIPTION: self._FIELD_DESCRIPTION, } - payment_id = Payment.create(self._API_CONTEXT, request_map, - self._USER_ID, self._MONETARY_ACCOUNT_ID) + payment_id = Payment.create( + self._API_CONTEXT, + request_map, + self._USER_ID, + self._MONETARY_ACCOUNT_ID + ).value chat_map = {} - chat_id = PaymentChat.create(self._API_CONTEXT, chat_map, self._USER_ID, - self._MONETARY_ACCOUNT_ID, payment_id) + chat_id = PaymentChat.create( + self._API_CONTEXT, + chat_map, + self._USER_ID, + self._MONETARY_ACCOUNT_ID, + payment_id + ).value message_map = { ChatMessageText.FIELD_TEXT: self._PAYMENT_CHAT_TEXT_MESSAGE, diff --git a/tests/model/generated/test_request_inquiry.py b/tests/model/generated/test_request_inquiry.py index 7a615cb..3a43b1b 100644 --- a/tests/model/generated/test_request_inquiry.py +++ b/tests/model/generated/test_request_inquiry.py @@ -36,10 +36,11 @@ def test_sending_and_accepting_request(self): self.send_request() - request_response_id = RequestResponse.list(self._API_CONTEXT, - self._USER_ID, - self._MONETARY_ACCOUNT_ID2)[ - self._FIRST_INDEX].id_ + request_response_id = RequestResponse.list( + self._API_CONTEXT, + self._USER_ID, + self._MONETARY_ACCOUNT_ID2 + ).value[self._FIRST_INDEX].id_ self.accept_request(request_response_id) diff --git a/tests/model/generated/test_tab_usage_single.py b/tests/model/generated/test_tab_usage_single.py index 71c56c8..e6b5f42 100644 --- a/tests/model/generated/test_tab_usage_single.py +++ b/tests/model/generated/test_tab_usage_single.py @@ -42,7 +42,7 @@ def test_create_and_update_tab(self): tab_uuid = TabUsageSingle.create(self._API_CONTEXT, create_map, self._USER_ID, self._MONETARY_ACCOUNT_ID, - self._CASH_REGISTER_ID) + self._CASH_REGISTER_ID).value self._add_item_to_tab(tab_uuid) self._update_tab(tab_uuid) From 4e2bcb7543432e1bca09031d9c95a8cd7af0826a Mon Sep 17 00:00:00 2001 From: Daniil Belyakov Date: Tue, 8 Aug 2017 17:08:16 +0200 Subject: [PATCH 3/4] #9 Add missing generated model properties and objects --- bunq/sdk/model/generated/endpoint.py | 42 ++++++++++++++++++++++++++++ bunq/sdk/model/generated/object_.py | 17 +++++++++++ 2 files changed, 59 insertions(+) diff --git a/bunq/sdk/model/generated/endpoint.py b/bunq/sdk/model/generated/endpoint.py index 6032503..cbd5abf 100644 --- a/bunq/sdk/model/generated/endpoint.py +++ b/bunq/sdk/model/generated/endpoint.py @@ -1567,6 +1567,7 @@ class Card(model.BunqModel): :type _country_permission: list[object_.CardCountryPermission] :type _label_monetary_account_ordered: object_.MonetaryAccountReference :type _label_monetary_account_current: object_.MonetaryAccountReference + :type _pin_code_assignment: object_.CardPinAssignment """ # Field constants. @@ -1577,6 +1578,8 @@ class Card(model.BunqModel): FIELD_MAG_STRIPE_PERMISSION = "mag_stripe_permission" FIELD_COUNTRY_PERMISSION = "country_permission" FIELD_MONETARY_ACCOUNT_CURRENT_ID = "monetary_account_current_id" + FIELD_PIN_CODE_ASSIGNMENT = "pin_code_assignment" + FIELD_MONETARY_ACCOUNT_ID_FALLBACK = "monetary_account_id_fallback" # Endpoint constants. _ENDPOINT_URL_UPDATE = "user/{}/card/{}" @@ -1602,6 +1605,7 @@ def __init__(self): self._country_permission = None self._label_monetary_account_ordered = None self._label_monetary_account_current = None + self._pin_code_assignment = None @classmethod def update(cls, api_context, request_map, user_id, card_id, @@ -1797,6 +1801,14 @@ def label_monetary_account_current(self): return self._label_monetary_account_current + @property + def pin_code_assignment(self): + """ + :rtype: object_.CardPinAssignment + """ + + return self._pin_code_assignment + class CashRegisterQrCodeContent(model.BunqModel): """ @@ -8974,6 +8986,9 @@ class UserCredentialPasswordIp(model.BunqModel): Create a credential of a user for server authentication, or delete the credential of a user for server authentication. + :type _id_: int + :type _created: str + :type _updated: str :type _status: str :type _expiry_time: str :type _token_value: str @@ -8988,6 +9003,9 @@ class UserCredentialPasswordIp(model.BunqModel): _OBJECT_TYPE = "CredentialPasswordIp" def __init__(self): + self._id_ = None + self._created = None + self._updated = None self._status = None self._expiry_time = None self._token_value = None @@ -9034,6 +9052,30 @@ def list(cls, api_context, user_id, custom_headers=None): return cls._from_json_list(response_raw, cls._OBJECT_TYPE) + @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 status(self): """ diff --git a/bunq/sdk/model/generated/object_.py b/bunq/sdk/model/generated/object_.py index 88f8d10..0f25abc 100644 --- a/bunq/sdk/model/generated/object_.py +++ b/bunq/sdk/model/generated/object_.py @@ -250,6 +250,23 @@ def __init__(self): self.expiry_time = None +class CardPinAssignment(model.BunqModel): + """ + :type type_: str + :type pin_code: str + :type monetary_account_id: str + """ + + def __init__(self, type_): + """ + :type type_: str + """ + + self.type_ = type_ + self.pin_code = None + self.monetary_account_id = None + + class Geolocation(model.BunqModel): """ :type latitude: float From 2c945aeae458520cba184bfc3de65f049185d90e Mon Sep 17 00:00:00 2001 From: Daniil Belyakov Date: Wed, 9 Aug 2017 16:13:06 +0200 Subject: [PATCH 4/4] #9 fix location of BunqResponse --- bunq/sdk/client.py | 32 +++ bunq/sdk/model/generated/endpoint.py | 352 ++++++++++++++------------- bunq/sdk/model/model.py | 33 +-- 3 files changed, 214 insertions(+), 203 deletions(-) diff --git a/bunq/sdk/client.py b/bunq/sdk/client.py index 8b03392..1604bf2 100644 --- a/bunq/sdk/client.py +++ b/bunq/sdk/client.py @@ -302,3 +302,35 @@ def headers(self): """ return self._headers + + +class BunqResponse(object): + """ + :type _value: T + :type _headers: dict[str, str] + """ + + def __init__(self, value, headers): + """ + :type value: T + :type headers: dict[str, str] + """ + + self._value = value + self._headers = headers + + @property + def value(self): + """ + :rtype: T + """ + + return self._value + + @property + def headers(self): + """ + :rtype: dict[str, str] + """ + + return self._headers diff --git a/bunq/sdk/model/generated/endpoint.py b/bunq/sdk/model/generated/endpoint.py index cbd5abf..fd62552 100644 --- a/bunq/sdk/model/generated/endpoint.py +++ b/bunq/sdk/model/generated/endpoint.py @@ -68,7 +68,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[Invoice]] + :rtype: client.BunqResponse[list[Invoice]] """ if custom_headers is None: @@ -91,7 +91,7 @@ def get(cls, api_context, user_id, monetary_account_id, invoice_id, :type invoice_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[Invoice] + :rtype: client.BunqResponse[Invoice] """ if custom_headers is None: @@ -288,7 +288,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[InvoiceByUser]] + :rtype: client.BunqResponse[list[InvoiceByUser]] """ if custom_headers is None: @@ -308,7 +308,7 @@ def get(cls, api_context, user_id, invoice_by_user_id, custom_headers=None): :type invoice_by_user_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[InvoiceByUser] + :rtype: client.BunqResponse[InvoiceByUser] """ if custom_headers is None: @@ -469,7 +469,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[ChatConversation]] + :rtype: client.BunqResponse[list[ChatConversation]] """ if custom_headers is None: @@ -490,7 +490,7 @@ def get(cls, api_context, user_id, chat_conversation_id, :type chat_conversation_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[ChatConversation] + :rtype: client.BunqResponse[ChatConversation] """ if custom_headers is None: @@ -537,7 +537,7 @@ def create(cls, api_context, request_map, user_id, chat_conversation_id, :type chat_conversation_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -593,7 +593,7 @@ def create(cls, api_context, request_map, user_id, chat_conversation_id, :type chat_conversation_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -658,7 +658,7 @@ def list(cls, api_context, user_id, chat_conversation_id, :type chat_conversation_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[ChatMessage]] + :rtype: client.BunqResponse[list[ChatMessage]] """ if custom_headers is None: @@ -760,7 +760,7 @@ def list(cls, api_context, user_id, chat_conversation_id, attachment_id, :type attachment_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[bytes] + :rtype: client.BunqResponse[bytes] """ if custom_headers is None: @@ -772,7 +772,8 @@ def list(cls, api_context, user_id, chat_conversation_id, attachment_id, attachment_id) response_raw = api_client.get(endpoint_url, custom_headers) - return model.BunqResponse(response_raw.body_bytes, response_raw.headers) + return client.BunqResponse(response_raw.body_bytes, + response_raw.headers) class AttachmentPublicContent(model.BunqModel): @@ -796,7 +797,7 @@ def list(cls, api_context, attachment_public_uuid, custom_headers=None): :type attachment_public_uuid: str :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[bytes] + :rtype: client.BunqResponse[bytes] """ if custom_headers is None: @@ -806,7 +807,8 @@ def list(cls, api_context, attachment_public_uuid, custom_headers=None): endpoint_url = cls._ENDPOINT_URL_LISTING.format(attachment_public_uuid) response_raw = api_client.get(endpoint_url, custom_headers) - return model.BunqResponse(response_raw.body_bytes, response_raw.headers) + return client.BunqResponse(response_raw.body_bytes, + response_raw.headers) class AttachmentTabContent(model.BunqModel): @@ -834,7 +836,7 @@ def list(cls, api_context, user_id, monetary_account_id, attachment_tab_id, :type attachment_tab_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[bytes] + :rtype: client.BunqResponse[bytes] """ if custom_headers is None: @@ -846,7 +848,8 @@ def list(cls, api_context, user_id, monetary_account_id, attachment_tab_id, attachment_tab_id) response_raw = api_client.get(endpoint_url, custom_headers) - return model.BunqResponse(response_raw.body_bytes, response_raw.headers) + return client.BunqResponse(response_raw.body_bytes, + response_raw.headers) class TabAttachmentTabContent(model.BunqModel): @@ -871,7 +874,7 @@ def list(cls, api_context, tab_uuid, attachment_id, custom_headers=None): :type attachment_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[bytes] + :rtype: client.BunqResponse[bytes] """ if custom_headers is None: @@ -881,7 +884,8 @@ def list(cls, api_context, tab_uuid, attachment_id, custom_headers=None): endpoint_url = cls._ENDPOINT_URL_LISTING.format(tab_uuid, attachment_id) response_raw = api_client.get(endpoint_url, custom_headers) - return model.BunqResponse(response_raw.body_bytes, response_raw.headers) + return client.BunqResponse(response_raw.body_bytes, + response_raw.headers) class AttachmentMonetaryAccount(model.BunqModel): @@ -920,7 +924,7 @@ def create(cls, api_context, request_bytes, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -990,7 +994,7 @@ def create(cls, api_context, request_bytes, custom_headers=None): :type request_bytes: bytes :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[str] + :rtype: client.BunqResponse[str] """ if custom_headers is None: @@ -1014,7 +1018,7 @@ def get(cls, api_context, attachment_public_uuid, custom_headers=None): :type attachment_public_uuid: str :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[AttachmentPublic] + :rtype: client.BunqResponse[AttachmentPublic] """ if custom_headers is None: @@ -1101,7 +1105,7 @@ def create(cls, api_context, request_bytes, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -1128,7 +1132,7 @@ def get(cls, api_context, user_id, monetary_account_id, attachment_tab_id, :type attachment_tab_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[AttachmentTab] + :rtype: client.BunqResponse[AttachmentTab] """ if custom_headers is None: @@ -1209,7 +1213,7 @@ def get(cls, api_context, tab_uuid, tab_attachment_tab_id, :type tab_attachment_tab_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[TabAttachmentTab] + :rtype: client.BunqResponse[TabAttachmentTab] """ if custom_headers is None: @@ -1289,7 +1293,7 @@ def create(cls, api_context, request_map, custom_headers=None): :type request_map: dict[str, object] :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[str] + :rtype: client.BunqResponse[str] """ if custom_headers is None: @@ -1310,7 +1314,7 @@ def get(cls, api_context, avatar_uuid, custom_headers=None): :type avatar_uuid: str :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[Avatar] + :rtype: client.BunqResponse[Avatar] """ if custom_headers is None: @@ -1394,7 +1398,7 @@ def create(cls, api_context, request_map, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[CardDebit] + :rtype: client.BunqResponse[CardDebit] """ if custom_headers is None: @@ -1527,7 +1531,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[CardName]] + :rtype: client.BunqResponse[list[CardName]] """ if custom_headers is None: @@ -1622,7 +1626,7 @@ def update(cls, api_context, request_map, user_id, card_id, :type card_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[Card] + :rtype: client.BunqResponse[Card] """ if custom_headers is None: @@ -1648,7 +1652,7 @@ def get(cls, api_context, user_id, card_id, custom_headers=None): :type card_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[Card] + :rtype: client.BunqResponse[Card] """ if custom_headers is None: @@ -1669,7 +1673,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[Card]] + :rtype: client.BunqResponse[list[Card]] """ if custom_headers is None: @@ -1836,7 +1840,7 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, :type qr_code_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[bytes] + :rtype: client.BunqResponse[bytes] """ if custom_headers is None: @@ -1849,7 +1853,8 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, qr_code_id) response_raw = api_client.get(endpoint_url, custom_headers) - return model.BunqResponse(response_raw.body_bytes, response_raw.headers) + return client.BunqResponse(response_raw.body_bytes, + response_raw.headers) class CashRegisterQrCode(model.BunqModel): @@ -1905,7 +1910,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type cash_register_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -1936,7 +1941,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type cash_register_qr_code_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -1967,7 +1972,7 @@ def get(cls, api_context, user_id, monetary_account_id, cash_register_id, :type cash_register_qr_code_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[CashRegisterQrCode] + :rtype: client.BunqResponse[CashRegisterQrCode] """ if custom_headers is None: @@ -1994,7 +1999,7 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, :type cash_register_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[CashRegisterQrCode]] + :rtype: client.BunqResponse[list[CashRegisterQrCode]] """ if custom_headers is None: @@ -2118,7 +2123,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -2145,7 +2150,7 @@ def get(cls, api_context, user_id, monetary_account_id, cash_register_id, :type cash_register_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[CashRegister] + :rtype: client.BunqResponse[CashRegister] """ if custom_headers is None: @@ -2174,7 +2179,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type cash_register_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -2201,7 +2206,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[CashRegister]] + :rtype: client.BunqResponse[list[CashRegister]] """ if custom_headers is None: @@ -2325,7 +2330,7 @@ def get(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_uuid: str :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[Tab] + :rtype: client.BunqResponse[Tab] """ if custom_headers is None: @@ -2351,7 +2356,7 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, :type cash_register_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[Tab]] + :rtype: client.BunqResponse[list[Tab]] """ if custom_headers is None: @@ -2479,7 +2484,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type cash_register_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[str] + :rtype: client.BunqResponse[str] """ if custom_headers is None: @@ -2512,7 +2517,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type tab_usage_single_uuid: str :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[str] + :rtype: client.BunqResponse[str] """ if custom_headers is None: @@ -2543,7 +2548,7 @@ def delete(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_usage_single_uuid: str :type custom_headers: dict[str, str]|None - :rtype model.BunqResponse[None]: + :rtype client.BunqResponse[None]: """ if custom_headers is None: @@ -2556,7 +2561,7 @@ def delete(cls, api_context, user_id, monetary_account_id, cash_register_id, tab_usage_single_uuid) response_raw = api_client.delete(endpoint_url, custom_headers) - return model.BunqResponse(None, response_raw.headers) + return client.BunqResponse(None, response_raw.headers) @classmethod def get(cls, api_context, user_id, monetary_account_id, cash_register_id, @@ -2571,7 +2576,7 @@ def get(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_usage_single_uuid: str :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[TabUsageSingle] + :rtype: client.BunqResponse[TabUsageSingle] """ if custom_headers is None: @@ -2598,7 +2603,7 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, :type cash_register_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[TabUsageSingle]] + :rtype: client.BunqResponse[list[TabUsageSingle]] """ if custom_headers is None: @@ -2939,7 +2944,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type cash_register_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[str] + :rtype: client.BunqResponse[str] """ if custom_headers is None: @@ -2974,7 +2979,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type tab_usage_multiple_uuid: str :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[str] + :rtype: client.BunqResponse[str] """ if custom_headers is None: @@ -3005,7 +3010,7 @@ def delete(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_usage_multiple_uuid: str :type custom_headers: dict[str, str]|None - :rtype model.BunqResponse[None]: + :rtype client.BunqResponse[None]: """ if custom_headers is None: @@ -3018,7 +3023,7 @@ def delete(cls, api_context, user_id, monetary_account_id, cash_register_id, tab_usage_multiple_uuid) response_raw = api_client.delete(endpoint_url, custom_headers) - return model.BunqResponse(None, response_raw.headers) + return client.BunqResponse(None, response_raw.headers) @classmethod def get(cls, api_context, user_id, monetary_account_id, cash_register_id, @@ -3033,7 +3038,7 @@ def get(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_usage_multiple_uuid: str :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[TabUsageMultiple] + :rtype: client.BunqResponse[TabUsageMultiple] """ if custom_headers is None: @@ -3060,7 +3065,7 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, :type cash_register_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[TabUsageMultiple]] + :rtype: client.BunqResponse[list[TabUsageMultiple]] """ if custom_headers is None: @@ -3247,7 +3252,7 @@ def create(cls, api_context, request_map, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -3272,7 +3277,7 @@ def delete(cls, api_context, user_id, certificate_pinned_id, :type certificate_pinned_id: int :type custom_headers: dict[str, str]|None - :rtype model.BunqResponse[None]: + :rtype client.BunqResponse[None]: """ if custom_headers is None: @@ -3283,7 +3288,7 @@ def delete(cls, api_context, user_id, certificate_pinned_id, certificate_pinned_id) response_raw = api_client.delete(endpoint_url, custom_headers) - return model.BunqResponse(None, response_raw.headers) + return client.BunqResponse(None, response_raw.headers) @classmethod def list(cls, api_context, user_id, custom_headers=None): @@ -3294,7 +3299,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[CertificatePinned]] + :rtype: client.BunqResponse[list[CertificatePinned]] """ if custom_headers is None: @@ -3317,7 +3322,7 @@ def get(cls, api_context, user_id, certificate_pinned_id, :type certificate_pinned_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[CertificatePinned] + :rtype: client.BunqResponse[CertificatePinned] """ if custom_headers is None: @@ -3393,7 +3398,7 @@ def create(cls, api_context, request_map, custom_headers=None): :type request_map: dict[str, object] :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -3416,7 +3421,7 @@ def get(cls, api_context, device_server_id, custom_headers=None): :type device_server_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[DeviceServer] + :rtype: client.BunqResponse[DeviceServer] """ if custom_headers is None: @@ -3436,7 +3441,7 @@ def list(cls, api_context, custom_headers=None): :type api_context: context.ApiContext :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[DeviceServer]] + :rtype: client.BunqResponse[list[DeviceServer]] """ if custom_headers is None: @@ -3526,7 +3531,7 @@ def get(cls, api_context, device_id, custom_headers=None): :type device_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[Device] + :rtype: client.BunqResponse[Device] """ if custom_headers is None: @@ -3547,7 +3552,7 @@ def list(cls, api_context, custom_headers=None): :type api_context: context.ApiContext :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[Device]] + :rtype: client.BunqResponse[list[Device]] """ if custom_headers is None: @@ -3689,7 +3694,7 @@ def list(cls, api_context, user_id, draft_share_invite_bank_id, :type draft_share_invite_bank_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[bytes] + :rtype: client.BunqResponse[bytes] """ if custom_headers is None: @@ -3700,7 +3705,8 @@ def list(cls, api_context, user_id, draft_share_invite_bank_id, draft_share_invite_bank_id) response_raw = api_client.get(endpoint_url, custom_headers) - return model.BunqResponse(response_raw.body_bytes, response_raw.headers) + return client.BunqResponse(response_raw.body_bytes, + response_raw.headers) class DraftShareInviteBank(model.BunqModel): @@ -3750,7 +3756,7 @@ def create(cls, api_context, request_map, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -3775,7 +3781,7 @@ def get(cls, api_context, user_id, draft_share_invite_bank_id, :type draft_share_invite_bank_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[DraftShareInviteBank] + :rtype: client.BunqResponse[DraftShareInviteBank] """ if custom_headers is None: @@ -3801,7 +3807,7 @@ def update(cls, api_context, request_map, user_id, :type draft_share_invite_bank_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[DraftShareInviteBank] + :rtype: client.BunqResponse[DraftShareInviteBank] """ if custom_headers is None: @@ -3823,7 +3829,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[DraftShareInviteBank]] + :rtype: client.BunqResponse[list[DraftShareInviteBank]] """ if custom_headers is None: @@ -3916,7 +3922,7 @@ def list(cls, api_context, user_id, export_annual_overview_id, :type export_annual_overview_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[bytes] + :rtype: client.BunqResponse[bytes] """ if custom_headers is None: @@ -3927,7 +3933,8 @@ def list(cls, api_context, user_id, export_annual_overview_id, export_annual_overview_id) response_raw = api_client.get(endpoint_url, custom_headers) - return model.BunqResponse(response_raw.body_bytes, response_raw.headers) + return client.BunqResponse(response_raw.body_bytes, + response_raw.headers) class ExportAnnualOverview(model.BunqModel): @@ -3972,7 +3979,7 @@ def create(cls, api_context, request_map, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -3997,7 +4004,7 @@ def get(cls, api_context, user_id, export_annual_overview_id, :type export_annual_overview_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[ExportAnnualOverview] + :rtype: client.BunqResponse[ExportAnnualOverview] """ if custom_headers is None: @@ -4019,7 +4026,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[ExportAnnualOverview]] + :rtype: client.BunqResponse[list[ExportAnnualOverview]] """ if custom_headers is None: @@ -4097,7 +4104,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type customer_statement_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[bytes] + :rtype: client.BunqResponse[bytes] """ if custom_headers is None: @@ -4109,7 +4116,8 @@ def list(cls, api_context, user_id, monetary_account_id, customer_statement_id) response_raw = api_client.get(endpoint_url, custom_headers) - return model.BunqResponse(response_raw.body_bytes, response_raw.headers) + return client.BunqResponse(response_raw.body_bytes, + response_raw.headers) class CustomerStatementExport(model.BunqModel): @@ -4166,7 +4174,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -4191,7 +4199,7 @@ def get(cls, api_context, user_id, monetary_account_id, :type customer_statement_export_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[CustomerStatementExport] + :rtype: client.BunqResponse[CustomerStatementExport] """ if custom_headers is None: @@ -4214,7 +4222,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[CustomerStatementExport]] + :rtype: client.BunqResponse[list[CustomerStatementExport]] """ if custom_headers is None: @@ -4237,7 +4245,7 @@ def delete(cls, api_context, user_id, monetary_account_id, :type customer_statement_export_id: int :type custom_headers: dict[str, str]|None - :rtype model.BunqResponse[None]: + :rtype client.BunqResponse[None]: """ if custom_headers is None: @@ -4249,7 +4257,7 @@ def delete(cls, api_context, user_id, monetary_account_id, customer_statement_export_id) response_raw = api_client.delete(endpoint_url, custom_headers) - return model.BunqResponse(None, response_raw.headers) + return client.BunqResponse(None, response_raw.headers) @property def id_(self): @@ -4358,7 +4366,7 @@ def list(cls, api_context, installation_id, custom_headers=None): :type installation_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[InstallationServerPublicKey]] + :rtype: client.BunqResponse[list[InstallationServerPublicKey]] """ if custom_headers is None: @@ -4409,7 +4417,7 @@ def delete(cls, api_context, user_id, monetary_account_id, :type share_invite_bank_amount_used_id: int :type custom_headers: dict[str, str]|None - :rtype model.BunqResponse[None]: + :rtype client.BunqResponse[None]: """ if custom_headers is None: @@ -4422,7 +4430,7 @@ def delete(cls, api_context, user_id, monetary_account_id, share_invite_bank_amount_used_id) response_raw = api_client.delete(endpoint_url, custom_headers) - return model.BunqResponse(None, response_raw.headers) + return client.BunqResponse(None, response_raw.headers) class ShareInviteBankInquiry(model.BunqModel): @@ -4492,7 +4500,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -4519,7 +4527,7 @@ def get(cls, api_context, user_id, monetary_account_id, :type share_invite_bank_inquiry_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[ShareInviteBankInquiry] + :rtype: client.BunqResponse[ShareInviteBankInquiry] """ if custom_headers is None: @@ -4547,7 +4555,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type share_invite_bank_inquiry_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[ShareInviteBankInquiry] + :rtype: client.BunqResponse[ShareInviteBankInquiry] """ if custom_headers is None: @@ -4576,7 +4584,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[ShareInviteBankInquiry]] + :rtype: client.BunqResponse[list[ShareInviteBankInquiry]] """ if custom_headers is None: @@ -4728,7 +4736,7 @@ def get(cls, api_context, user_id, share_invite_bank_response_id, :type share_invite_bank_response_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[ShareInviteBankResponse] + :rtype: client.BunqResponse[ShareInviteBankResponse] """ if custom_headers is None: @@ -4753,7 +4761,7 @@ def update(cls, api_context, request_map, user_id, :type share_invite_bank_response_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[ShareInviteBankResponse] + :rtype: client.BunqResponse[ShareInviteBankResponse] """ if custom_headers is None: @@ -4777,7 +4785,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[ShareInviteBankResponse]] + :rtype: client.BunqResponse[list[ShareInviteBankResponse]] """ if custom_headers is None: @@ -4950,7 +4958,7 @@ def create(cls, api_context, request_map, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -4975,7 +4983,7 @@ def get(cls, api_context, user_id, monetary_account_bank_id, :type monetary_account_bank_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[MonetaryAccountBank] + :rtype: client.BunqResponse[MonetaryAccountBank] """ if custom_headers is None: @@ -5000,7 +5008,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_bank_id, :type monetary_account_bank_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -5024,7 +5032,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[MonetaryAccountBank]] + :rtype: client.BunqResponse[list[MonetaryAccountBank]] """ if custom_headers is None: @@ -5266,7 +5274,7 @@ def get(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[MonetaryAccount] + :rtype: client.BunqResponse[MonetaryAccount] """ if custom_headers is None: @@ -5288,7 +5296,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[MonetaryAccount]] + :rtype: client.BunqResponse[list[MonetaryAccount]] """ if custom_headers is None: @@ -5345,7 +5353,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -5374,7 +5382,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type payment_batch_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -5402,7 +5410,7 @@ def get(cls, api_context, user_id, monetary_account_id, payment_batch_id, :type payment_batch_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[PaymentBatch] + :rtype: client.BunqResponse[PaymentBatch] """ if custom_headers is None: @@ -5427,7 +5435,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[PaymentBatch]] + :rtype: client.BunqResponse[list[PaymentBatch]] """ if custom_headers is None: @@ -5537,7 +5545,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -5564,7 +5572,7 @@ def get(cls, api_context, user_id, monetary_account_id, payment_id, :type payment_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[Payment] + :rtype: client.BunqResponse[Payment] """ if custom_headers is None: @@ -5590,7 +5598,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[Payment]] + :rtype: client.BunqResponse[list[Payment]] """ if custom_headers is None: @@ -5828,7 +5836,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type payment_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -5858,7 +5866,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type payment_chat_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[PaymentChat] + :rtype: client.BunqResponse[PaymentChat] """ if custom_headers is None: @@ -5887,7 +5895,7 @@ def list(cls, api_context, user_id, monetary_account_id, payment_id, :type payment_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[PaymentChat]] + :rtype: client.BunqResponse[list[PaymentChat]] """ if custom_headers is None: @@ -5970,7 +5978,7 @@ def get(cls, api_context, user_id, credential_password_ip_id, :type permitted_ip_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[PermittedIp] + :rtype: client.BunqResponse[PermittedIp] """ if custom_headers is None: @@ -5994,7 +6002,7 @@ def create(cls, api_context, request_map, user_id, :type credential_password_ip_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -6018,7 +6026,7 @@ def list(cls, api_context, user_id, credential_password_ip_id, :type credential_password_ip_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[PermittedIp]] + :rtype: client.BunqResponse[list[PermittedIp]] """ if custom_headers is None: @@ -6042,7 +6050,7 @@ def update(cls, api_context, request_map, user_id, :type permitted_ip_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -6116,7 +6124,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -6145,7 +6153,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type request_inquiry_batch_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -6173,7 +6181,7 @@ def get(cls, api_context, user_id, monetary_account_id, :type request_inquiry_batch_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[RequestInquiryBatch] + :rtype: client.BunqResponse[RequestInquiryBatch] """ if custom_headers is None: @@ -6198,7 +6206,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[RequestInquiryBatch]] + :rtype: client.BunqResponse[list[RequestInquiryBatch]] """ if custom_headers is None: @@ -6327,7 +6335,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -6355,7 +6363,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type request_inquiry_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[RequestInquiry] + :rtype: client.BunqResponse[RequestInquiry] """ if custom_headers is None: @@ -6382,7 +6390,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[RequestInquiry]] + :rtype: client.BunqResponse[list[RequestInquiry]] """ if custom_headers is None: @@ -6407,7 +6415,7 @@ def get(cls, api_context, user_id, monetary_account_id, request_inquiry_id, :type request_inquiry_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[RequestInquiry] + :rtype: client.BunqResponse[RequestInquiry] """ if custom_headers is None: @@ -6668,7 +6676,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type request_inquiry_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -6699,7 +6707,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type request_inquiry_chat_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[RequestInquiryChat] + :rtype: client.BunqResponse[RequestInquiryChat] """ if custom_headers is None: @@ -6728,7 +6736,7 @@ def list(cls, api_context, user_id, monetary_account_id, request_inquiry_id, :type request_inquiry_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[RequestInquiryChat]] + :rtype: client.BunqResponse[list[RequestInquiryChat]] """ if custom_headers is None: @@ -6822,7 +6830,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type request_response_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -6853,7 +6861,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type request_response_chat_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[RequestResponseChat] + :rtype: client.BunqResponse[RequestResponseChat] """ if custom_headers is None: @@ -6882,7 +6890,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type request_response_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[RequestResponseChat]] + :rtype: client.BunqResponse[list[RequestResponseChat]] """ if custom_headers is None: @@ -7014,7 +7022,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type request_response_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[RequestResponse] + :rtype: client.BunqResponse[RequestResponse] """ if custom_headers is None: @@ -7041,7 +7049,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[RequestResponse]] + :rtype: client.BunqResponse[list[RequestResponse]] """ if custom_headers is None: @@ -7066,7 +7074,7 @@ def get(cls, api_context, user_id, monetary_account_id, request_response_id, :type request_response_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[RequestResponse] + :rtype: client.BunqResponse[RequestResponse] """ if custom_headers is None: @@ -7310,7 +7318,7 @@ def get(cls, api_context, user_id, monetary_account_id, schedule_id, :type schedule_instance_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[ScheduleInstance] + :rtype: client.BunqResponse[ScheduleInstance] """ if custom_headers is None: @@ -7337,7 +7345,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type schedule_instance_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -7364,7 +7372,7 @@ def list(cls, api_context, user_id, monetary_account_id, schedule_id, :type schedule_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[ScheduleInstance]] + :rtype: client.BunqResponse[list[ScheduleInstance]] """ if custom_headers is None: @@ -7463,7 +7471,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -7489,7 +7497,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type schedule_payment_batch_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -7515,7 +7523,7 @@ def delete(cls, api_context, user_id, monetary_account_id, :type schedule_payment_batch_id: int :type custom_headers: dict[str, str]|None - :rtype model.BunqResponse[None]: + :rtype client.BunqResponse[None]: """ if custom_headers is None: @@ -7527,7 +7535,7 @@ def delete(cls, api_context, user_id, monetary_account_id, schedule_payment_batch_id) response_raw = api_client.delete(endpoint_url, custom_headers) - return model.BunqResponse(None, response_raw.headers) + return client.BunqResponse(None, response_raw.headers) @property def payments(self): @@ -7582,7 +7590,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -7607,7 +7615,7 @@ def delete(cls, api_context, user_id, monetary_account_id, :type schedule_payment_id: int :type custom_headers: dict[str, str]|None - :rtype model.BunqResponse[None]: + :rtype client.BunqResponse[None]: """ if custom_headers is None: @@ -7619,7 +7627,7 @@ def delete(cls, api_context, user_id, monetary_account_id, schedule_payment_id) response_raw = api_client.delete(endpoint_url, custom_headers) - return model.BunqResponse(None, response_raw.headers) + return client.BunqResponse(None, response_raw.headers) @classmethod def get(cls, api_context, user_id, monetary_account_id, schedule_payment_id, @@ -7631,7 +7639,7 @@ def get(cls, api_context, user_id, monetary_account_id, schedule_payment_id, :type schedule_payment_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[SchedulePayment] + :rtype: client.BunqResponse[SchedulePayment] """ if custom_headers is None: @@ -7654,7 +7662,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[SchedulePayment]] + :rtype: client.BunqResponse[list[SchedulePayment]] """ if custom_headers is None: @@ -7678,7 +7686,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type schedule_payment_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -7735,7 +7743,7 @@ def get(cls, api_context, user_id, monetary_account_id, schedule_id, :type schedule_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[Schedule] + :rtype: client.BunqResponse[Schedule] """ if custom_headers is None: @@ -7764,7 +7772,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[Schedule]] + :rtype: client.BunqResponse[list[Schedule]] """ if custom_headers is None: @@ -7803,7 +7811,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[ScheduleUser]] + :rtype: client.BunqResponse[list[ScheduleUser]] """ if custom_headers is None: @@ -7836,7 +7844,7 @@ def delete(cls, api_context, session_id, custom_headers=None): :type session_id: int :type custom_headers: dict[str, str]|None - :rtype model.BunqResponse[None]: + :rtype client.BunqResponse[None]: """ if custom_headers is None: @@ -7846,7 +7854,7 @@ def delete(cls, api_context, session_id, custom_headers=None): endpoint_url = cls._ENDPOINT_URL_DELETE.format(session_id) response_raw = api_client.delete(endpoint_url, custom_headers) - return model.BunqResponse(None, response_raw.headers) + return client.BunqResponse(None, response_raw.headers) class TabItemShopBatch(model.BunqModel): @@ -7883,7 +7891,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type tab_uuid: str :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -7974,7 +7982,7 @@ def create(cls, api_context, request_map, user_id, monetary_account_id, :type tab_uuid: str :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -8007,7 +8015,7 @@ def update(cls, api_context, request_map, user_id, monetary_account_id, :type tab_item_shop_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -8040,7 +8048,7 @@ def delete(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_item_shop_id: int :type custom_headers: dict[str, str]|None - :rtype model.BunqResponse[None]: + :rtype client.BunqResponse[None]: """ if custom_headers is None: @@ -8054,7 +8062,7 @@ def delete(cls, api_context, user_id, monetary_account_id, cash_register_id, tab_item_shop_id) response_raw = api_client.delete(endpoint_url, custom_headers) - return model.BunqResponse(None, response_raw.headers) + return client.BunqResponse(None, response_raw.headers) @classmethod def list(cls, api_context, user_id, monetary_account_id, cash_register_id, @@ -8069,7 +8077,7 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_uuid: str :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[TabItemShop]] + :rtype: client.BunqResponse[list[TabItemShop]] """ if custom_headers is None: @@ -8098,7 +8106,7 @@ def get(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_item_shop_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[TabItemShop] + :rtype: client.BunqResponse[TabItemShop] """ if custom_headers is None: @@ -8207,7 +8215,7 @@ def get(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_result_inquiry_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[TabResultInquiry] + :rtype: client.BunqResponse[TabResultInquiry] """ if custom_headers is None: @@ -8235,7 +8243,7 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_uuid: str :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[TabResultInquiry]] + :rtype: client.BunqResponse[list[TabResultInquiry]] """ if custom_headers is None: @@ -8300,7 +8308,7 @@ def get(cls, api_context, user_id, monetary_account_id, :type tab_result_response_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[TabResultResponse] + :rtype: client.BunqResponse[TabResultResponse] """ if custom_headers is None: @@ -8325,7 +8333,7 @@ def list(cls, api_context, user_id, monetary_account_id, :type monetary_account_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[TabResultResponse]] + :rtype: client.BunqResponse[list[TabResultResponse]] """ if custom_headers is None: @@ -8384,7 +8392,7 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, :type tab_uuid: str :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[bytes] + :rtype: client.BunqResponse[bytes] """ if custom_headers is None: @@ -8397,7 +8405,8 @@ def list(cls, api_context, user_id, monetary_account_id, cash_register_id, tab_uuid) response_raw = api_client.get(endpoint_url, custom_headers) - return model.BunqResponse(response_raw.body_bytes, response_raw.headers) + return client.BunqResponse(response_raw.body_bytes, + response_raw.headers) class TokenQrRequestIdeal(model.BunqModel): @@ -8474,7 +8483,7 @@ def create(cls, api_context, request_map, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[TokenQrRequestIdeal] + :rtype: client.BunqResponse[TokenQrRequestIdeal] """ if custom_headers is None: @@ -8743,7 +8752,7 @@ def get(cls, api_context, user_company_id, custom_headers=None): :type user_company_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[UserCompany] + :rtype: client.BunqResponse[UserCompany] """ if custom_headers is None: @@ -8766,7 +8775,7 @@ def update(cls, api_context, request_map, user_company_id, :type user_company_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -9020,7 +9029,7 @@ def get(cls, api_context, user_id, user_credential_password_ip_id, :type user_credential_password_ip_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[UserCredentialPasswordIp] + :rtype: client.BunqResponse[UserCredentialPasswordIp] """ if custom_headers is None: @@ -9040,7 +9049,7 @@ def list(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[UserCredentialPasswordIp]] + :rtype: client.BunqResponse[list[UserCredentialPasswordIp]] """ if custom_headers is None: @@ -9226,7 +9235,7 @@ def get(cls, api_context, user_person_id, custom_headers=None): :type user_person_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[UserPerson] + :rtype: client.BunqResponse[UserPerson] """ if custom_headers is None: @@ -9249,7 +9258,7 @@ def update(cls, api_context, request_map, user_person_id, :type user_person_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[int] + :rtype: client.BunqResponse[int] """ if custom_headers is None: @@ -9543,7 +9552,7 @@ def get(cls, api_context, user_id, custom_headers=None): :type user_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[User] + :rtype: client.BunqResponse[User] """ if custom_headers is None: @@ -9563,7 +9572,7 @@ def list(cls, api_context, custom_headers=None): :type api_context: context.ApiContext :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[list[User]] + :rtype: client.BunqResponse[list[User]] """ if custom_headers is None: @@ -9666,8 +9675,7 @@ class UserLight(model.BunqModel): FIELD_SUB_STATUS = "sub_status" FIELD_LEGAL_GUARDIAN_ALIAS = "legal_guardian_alias" FIELD_SESSION_TIMEOUT = "session_timeout" - FIELD_DAILY_LIMIT_WITHOUT_CONFIRMATION_LOGIN = \ - "daily_limit_without_confirmation_login" + FIELD_DAILY_LIMIT_WITHOUT_CONFIRMATION_LOGIN = "daily_limit_without_confirmation_login" FIELD_NOTIFICATION_FILTERS = "notification_filters" # Endpoint constants. @@ -9719,7 +9727,7 @@ def get(cls, api_context, user_light_id, custom_headers=None): :type user_light_id: int :type custom_headers: dict[str, str]|None - :rtype: model.BunqResponse[UserLight] + :rtype: client.BunqResponse[UserLight] """ if custom_headers is None: diff --git a/bunq/sdk/model/model.py b/bunq/sdk/model/model.py index 3a0a4fb..0e6c5ca 100644 --- a/bunq/sdk/model/model.py +++ b/bunq/sdk/model/model.py @@ -1,5 +1,6 @@ from bunq.sdk import client from bunq.sdk import context +from bunq.sdk.client import BunqResponse from bunq.sdk.json import converter @@ -24,7 +25,7 @@ def _from_json_array_nested(cls, response_raw): """ :type response_raw: client.BunqResponseRaw - :rtype: BunqResponse[cls] + :rtype: bunq.sdk.client.BunqResponse[cls] """ json = response_raw.body_bytes.decode() @@ -340,33 +341,3 @@ def generate_request_body_bytes(cls, secret): return converter.class_to_json({cls.FIELD_SECRET: secret}).encode() -class BunqResponse(object): - """ - :type _value: T - :type _headers: dict[str, str] - """ - - def __init__(self, value, headers): - """ - :type value: T - :type headers: dict[str, str] - """ - - self._value = value - self._headers = headers - - @property - def value(self): - """ - :rtype: T - """ - - return self._value - - @property - def headers(self): - """ - :rtype: dict[str, str] - """ - - return self._headers