stackin-python-sdk 0.5.0__py3-none-any.whl → 0.6.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
stackin/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """Invoice __init__ module."""
2
2
 
3
- __version__ = "0.5.0"
3
+ __version__ = "0.6.0"
4
4
  __description__ = (
5
5
  "Python SDK for issuing, consulting and cancelling electronic invoices."
6
6
  )
stackin/core/client.py CHANGED
@@ -3,6 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import os
6
+ from typing import Any
6
7
 
7
8
  import requests
8
9
 
@@ -275,6 +276,14 @@ class Invoice:
275
276
 
276
277
  return self._request("GET", "/invoices", params=params)
277
278
 
279
+ def submissions(self, invoice_id: str) -> list:
280
+ """Every attempt made for one invoice, and what came back.
281
+
282
+ consult() gives the status; this gives the reason. Takes the
283
+ invoice_id because a rejected document has no access key.
284
+ """
285
+ return self._request("GET", f"/invoices/{invoice_id}/submissions")
286
+
278
287
  def manifest(
279
288
  self,
280
289
  access_key: str,
@@ -326,7 +335,7 @@ class Invoice:
326
335
  json: dict | None = None,
327
336
  params: dict | None = None,
328
337
  idempotency_key: str | None = None,
329
- ) -> dict:
338
+ ) -> Any:
330
339
  response = self._send(
331
340
  method,
332
341
  path,
@@ -338,7 +347,9 @@ class Invoice:
338
347
  body = response.json() if response.content else {}
339
348
  except ValueError:
340
349
  body = {}
341
- return body.get("result", body)
350
+ if isinstance(body, dict):
351
+ return body.get("result", body)
352
+ return body
342
353
 
343
354
  def _send(
344
355
  self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stackin-python-sdk
3
- Version: 0.5.0
3
+ Version: 0.6.0
4
4
  Summary: Python SDK for issuing, consulting and cancelling electronic invoices.
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -1,13 +1,13 @@
1
- stackin/__init__.py,sha256=7asOn6WfIEccIYuv-WYfEsjJfZu7SWgJ1ps49lPZGKc,531
1
+ stackin/__init__.py,sha256=H9pBLgWFY-FCi4oOnoW-RM63GgAIJQfTICEfO61LPZw,531
2
2
  stackin/br/__init__.py,sha256=ktBhaGVPE81n8r5jdIloERq4x9B2AE1k9-1IlzqVhVM,1184
3
3
  stackin/br/product.py,sha256=877FGYgVZ8iBIJFecsDRbbnEiKmbMY5WBuVtHoEoia4,4044
4
4
  stackin/br/tax.py,sha256=UxcYX-kJw1HxUixB0hRABSgoHqT6CLoEjup4xIRFaYg,54747
5
5
  stackin/core/__init__.py,sha256=dxtOP1DopMSNFYGh3Hf12RVcs58R9xwLn-gqfKFo-HE,19
6
6
  stackin/core/address.py,sha256=-w5R3nzfU5T3VoxIeygu5Dq4DRb_lJHAGc0lmSMwEMU,616
7
- stackin/core/client.py,sha256=AIN1a0_NQm64tv14GmTpEQm9Gt7JYxpSZFBXBdCK6Jw,11277
7
+ stackin/core/client.py,sha256=Jh5Qkg_AHXBlKZ_rIkSFXEMMcjiC_928EDvMVZewnko,11701
8
8
  stackin/core/exceptions.py,sha256=ELn-uL8rwjAFsD1PgM8Zr-1if3Z5yOWU81chUs4k6tU,505
9
9
  stackin/core/types.py,sha256=NpfYVN58Ug9fEY7VYeQ2TC1eekoFGHZq_habvrqEeTY,604
10
- stackin_python_sdk-0.5.0.dist-info/METADATA,sha256=yw5jy8MC7Wgdv6qr2PKF2yjicfRMlLtC3KG6yqxbAIk,11041
11
- stackin_python_sdk-0.5.0.dist-info/WHEEL,sha256=eY7nduwzv-ldUxpzbRlxwvC693Hg6PX8bWDjEHjZ_dk,88
12
- stackin_python_sdk-0.5.0.dist-info/licenses/LICENSE,sha256=D-XHDcKFFhzEo9C5Dp4QPvt00pb_u__hi4Bc08zpxyU,1072
13
- stackin_python_sdk-0.5.0.dist-info/RECORD,,
10
+ stackin_python_sdk-0.6.0.dist-info/METADATA,sha256=OBtsl_XghGyuIZlQVJMe1fjxsLJyR6gWWHRYu3DcbLc,11041
11
+ stackin_python_sdk-0.6.0.dist-info/WHEEL,sha256=eY7nduwzv-ldUxpzbRlxwvC693Hg6PX8bWDjEHjZ_dk,88
12
+ stackin_python_sdk-0.6.0.dist-info/licenses/LICENSE,sha256=D-XHDcKFFhzEo9C5Dp4QPvt00pb_u__hi4Bc08zpxyU,1072
13
+ stackin_python_sdk-0.6.0.dist-info/RECORD,,