payi 0.1.0a13__py3-none-any.whl → 0.1.0a15__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.
Files changed (36) hide show
  1. payi/_base_client.py +6 -6
  2. payi/_client.py +8 -0
  3. payi/_compat.py +3 -3
  4. payi/_models.py +9 -0
  5. payi/_version.py +1 -1
  6. payi/resources/__init__.py +14 -0
  7. payi/resources/budgets/budgets.py +12 -4
  8. payi/resources/categories/__init__.py +33 -0
  9. payi/resources/categories/categories.py +388 -0
  10. payi/resources/categories/resources.py +450 -0
  11. payi/resources/ingest.py +152 -21
  12. payi/types/__init__.py +11 -1
  13. payi/types/budget_create_params.py +4 -0
  14. payi/types/budget_history_response.py +3 -75
  15. payi/types/budget_response.py +3 -26
  16. payi/types/budget_update_params.py +4 -3
  17. payi/types/bulk_ingest_response.py +44 -0
  18. payi/types/categories/__init__.py +6 -0
  19. payi/types/categories/resource_create_params.py +25 -0
  20. payi/types/categories/resource_list_response.py +9 -0
  21. payi/types/category_delete_resource_response.py +9 -0
  22. payi/types/category_delete_response.py +9 -0
  23. payi/types/category_list_resources_response.py +9 -0
  24. payi/types/category_list_response.py +9 -0
  25. payi/types/category_resource_response.py +24 -0
  26. payi/types/category_response.py +15 -0
  27. payi/types/ingest_bulk_params.py +14 -0
  28. payi/types/{proxy_result.py → ingest_response.py} +15 -6
  29. payi/types/ingest_units_param.py +23 -0
  30. payi/types/ingest_units_params.py +6 -2
  31. payi/types/paged_budget_list.py +3 -26
  32. payi/types/total_cost_data.py +31 -0
  33. {payi-0.1.0a13.dist-info → payi-0.1.0a15.dist-info}/METADATA +8 -2
  34. {payi-0.1.0a13.dist-info → payi-0.1.0a15.dist-info}/RECORD +36 -20
  35. {payi-0.1.0a13.dist-info → payi-0.1.0a15.dist-info}/WHEEL +0 -0
  36. {payi-0.1.0a13.dist-info → payi-0.1.0a15.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,14 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Iterable
6
+ from typing_extensions import Required, TypedDict
7
+
8
+ from .ingest_units_param import IngestUnitsParam
9
+
10
+ __all__ = ["IngestBulkParams"]
11
+
12
+
13
+ class IngestBulkParams(TypedDict, total=False):
14
+ items: Required[Iterable[IngestUnitsParam]]
@@ -1,19 +1,20 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  from typing import Dict, List, Optional
4
+ from datetime import datetime
4
5
  from typing_extensions import Literal
5
6
 
6
7
  from .._models import BaseModel
7
8
  from .cost_details import CostDetails
8
9
 
9
- __all__ = ["ProxyResult", "Budgets", "Cost"]
10
+ __all__ = ["IngestResponse", "XproxyResult", "XproxyResultBudgets", "XproxyResultCost"]
10
11
 
11
12
 
12
- class Budgets(BaseModel):
13
+ class XproxyResultBudgets(BaseModel):
13
14
  state: Optional[Literal["ok", "blocked", "blocked_external", "exceeded", "failed"]] = None
14
15
 
15
16
 
16
- class Cost(BaseModel):
17
+ class XproxyResultCost(BaseModel):
17
18
  currency: Optional[Literal["usd"]] = None
18
19
 
19
20
  input: Optional[CostDetails] = None
@@ -23,11 +24,19 @@ class Cost(BaseModel):
23
24
  total: Optional[CostDetails] = None
24
25
 
25
26
 
26
- class ProxyResult(BaseModel):
27
- budgets: Optional[Dict[str, Budgets]] = None
27
+ class XproxyResult(BaseModel):
28
+ budgets: Optional[Dict[str, XproxyResultBudgets]] = None
28
29
 
29
- cost: Optional[Cost] = None
30
+ cost: Optional[XproxyResultCost] = None
30
31
 
31
32
  request_id: Optional[str] = None
32
33
 
33
34
  request_tags: Optional[List[str]] = None
35
+
36
+
37
+ class IngestResponse(BaseModel):
38
+ ingest_timestamp: datetime
39
+
40
+ request_id: str
41
+
42
+ xproxy_result: XproxyResult
@@ -0,0 +1,23 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Union
6
+ from datetime import datetime
7
+ from typing_extensions import Required, Annotated, TypedDict
8
+
9
+ from .._utils import PropertyInfo
10
+
11
+ __all__ = ["IngestUnitsParam"]
12
+
13
+
14
+ class IngestUnitsParam(TypedDict, total=False):
15
+ category: Required[str]
16
+
17
+ input: Required[int]
18
+
19
+ output: Required[int]
20
+
21
+ resource: Required[str]
22
+
23
+ event_timestamp: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
@@ -2,6 +2,8 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from typing import Union
6
+ from datetime import datetime
5
7
  from typing_extensions import Required, Annotated, TypedDict
6
8
 
7
9
  from .._utils import PropertyInfo
@@ -18,6 +20,8 @@ class IngestUnitsParams(TypedDict, total=False):
18
20
 
19
21
  resource: Required[str]
20
22
 
21
- budget_ids: Annotated[list[str], PropertyInfo(alias="xProxy-Budget-IDs")]
23
+ event_timestamp: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
22
24
 
23
- request_tags: Annotated[list[str], PropertyInfo(alias="xProxy-Request-Tags")]
25
+ budget_ids: Annotated[Union[list[str], None], PropertyInfo(alias="xProxy-Budget-IDs")]
26
+
27
+ request_tags: Annotated[Union[list[str], None], PropertyInfo(alias="xProxy-Request-Tags")]
@@ -7,32 +7,9 @@ from typing_extensions import Literal
7
7
  from pydantic import Field as FieldInfo
8
8
 
9
9
  from .._models import BaseModel
10
- from .cost_data import CostData
11
- from .requests_data import RequestsData
10
+ from .total_cost_data import TotalCostData
12
11
 
13
- __all__ = ["PagedBudgetList", "Item", "ItemTotals", "ItemTotalsBudgetTransactions"]
14
-
15
-
16
- class ItemTotalsBudgetTransactions(BaseModel):
17
- blocked: int
18
-
19
- blocked_external: int
20
-
21
- exceeded: int
22
-
23
- successful: int
24
-
25
- error: Optional[int] = None
26
-
27
- total: Optional[int] = None
28
-
29
-
30
- class ItemTotals(BaseModel):
31
- budget_transactions: ItemTotalsBudgetTransactions
32
-
33
- cost: CostData
34
-
35
- requests: RequestsData
12
+ __all__ = ["PagedBudgetList", "Item"]
36
13
 
37
14
 
38
15
  class Item(BaseModel):
@@ -54,7 +31,7 @@ class Item(BaseModel):
54
31
 
55
32
  max: float
56
33
 
57
- totals: ItemTotals
34
+ totals: TotalCostData
58
35
 
59
36
  budget_tags: Optional[List[str]] = None
60
37
 
@@ -0,0 +1,31 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+
5
+ from .._models import BaseModel
6
+ from .cost_data import CostData
7
+ from .requests_data import RequestsData
8
+
9
+ __all__ = ["TotalCostData", "BudgetTransactions"]
10
+
11
+
12
+ class BudgetTransactions(BaseModel):
13
+ blocked: int
14
+
15
+ blocked_external: int
16
+
17
+ exceeded: int
18
+
19
+ successful: int
20
+
21
+ error: Optional[int] = None
22
+
23
+ total: Optional[int] = None
24
+
25
+
26
+ class TotalCostData(BaseModel):
27
+ cost: CostData
28
+
29
+ requests: RequestsData
30
+
31
+ budget_transactions: Optional[BudgetTransactions] = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: payi
3
- Version: 0.1.0a13
3
+ Version: 0.1.0a15
4
4
  Summary: The official Python library for the payi API
5
5
  Project-URL: Homepage, https://github.com/Pay-i/pay-i-python
6
6
  Project-URL: Repository, https://github.com/Pay-i/pay-i-python
@@ -44,7 +44,7 @@ It is generated with [Stainless](https://www.stainlessapi.com/).
44
44
 
45
45
  ## Documentation
46
46
 
47
- The REST API documentation can be found [on docs.payi.com](https://docs.payi.com). The full API of this library can be found in [api.md](https://github.com/Pay-i/pay-i-python/tree/main/api.md).
47
+ The REST API documentation can be found on [docs.payi.com](https://docs.payi.com). The full API of this library can be found in [api.md](https://github.com/Pay-i/pay-i-python/tree/main/api.md).
48
48
 
49
49
  ## Installation
50
50
 
@@ -334,6 +334,12 @@ client = Payi(
334
334
  )
335
335
  ```
336
336
 
337
+ You can also customize the client on a per-request basis by using `with_options()`:
338
+
339
+ ```python
340
+ client.with_options(http_client=DefaultHttpxClient(...))
341
+ ```
342
+
337
343
  ### Managing HTTP resources
338
344
 
339
345
  By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
@@ -1,17 +1,17 @@
1
1
  payi/__init__.py,sha256=LWpfR6WSMPTnmmx3ToqqZ0A8CNduLcuxY1SSOqhPxuk,2381
2
- payi/_base_client.py,sha256=c5Hju1M9F2Bweaubt_YHoIW6WBi41ztJdw6WV6ALxVg,66170
3
- payi/_client.py,sha256=lQBkhIC3OQpsv84PQvVpoOPdR5QabmEPkzyn7U9O1aA,15622
4
- payi/_compat.py,sha256=m0I0haqFZuVxd5m227_8nNmvA1saXyuNJ7BjidX_PTE,6389
2
+ payi/_base_client.py,sha256=m9HUAVfRZskxs-zENi8VtkaGXSipWhRq8Qh2H1YGWbc,66226
3
+ payi/_client.py,sha256=xw0Z15gsNtWO5ktYEleEwksIYhUtHx8ogU3-j4gkdWM,16222
4
+ payi/_compat.py,sha256=BPuFBQUQE-C6lIB2PTMco9-g08p94cqPxbU3x8VENso,6430
5
5
  payi/_constants.py,sha256=JE8kyZa2Q4NK_i4fO--8siEYTzeHnT0fYbOFDgDP4uk,464
6
6
  payi/_exceptions.py,sha256=ItygKNrNXIVY0H6LsGVZvFuAHB3Vtm_VZXmWzCnpHy0,3216
7
7
  payi/_files.py,sha256=me2eyWzJCM4YKh10Gzkxw4YyIEJoikzD4BVu_20UUc0,3565
8
- payi/_models.py,sha256=iIdzp18nPedv1mQxC6hoNDEsRIAiPkS88e4ZwA5mpGo,27892
8
+ payi/_models.py,sha256=3METTz2oSlPfVcHL0fZ-L5IPnvckZDkgEe1H58mRsFE,28210
9
9
  payi/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
10
10
  payi/_resource.py,sha256=j2jIkTr8OIC8sU6-05nxSaCyj4MaFlbZrwlyg4_xJos,1088
11
11
  payi/_response.py,sha256=W6pADUzbnMFGnVzGY4M3FkX9uvw8AFSMTPZKPgQ_TV4,28363
12
12
  payi/_streaming.py,sha256=Z_wIyo206T6Jqh2rolFg2VXZgX24PahLmpURp0-NssU,10092
13
13
  payi/_types.py,sha256=04q-KHD-qZ1xlfwEb_muyIHWmD-nZ-KxnRxA_QEjqNk,6125
14
- payi/_version.py,sha256=fVekM5nK6zjT_VszEGHaPVvPL-b6_3OcQkrsnwQaG28,165
14
+ payi/_version.py,sha256=10rhRcen69ntoRaQVy3kwdgI8S_SdpwWX5apB-8lwxc,165
15
15
  payi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  payi/_utils/__init__.py,sha256=Uzq1-FIih_VUjzdNVWXks0sdC39KBKLMrZoz-_JOjJ4,1988
17
17
  payi/_utils/_logs.py,sha256=fmnf5D9TOgkgZKfgYmSa3PiUc3SZgkchn6CzJUeo0SQ,768
@@ -24,24 +24,37 @@ payi/_utils/_typing.py,sha256=tFbktdpdHCQliwzGsWysgn0P5H0JRdagkZdb_LegGkY,3838
24
24
  payi/_utils/_utils.py,sha256=FaZdW0tWil7IERdxUfKt7pVcyXL2aCnR3lo73q66qgI,11447
25
25
  payi/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
26
26
  payi/lib/helpers.py,sha256=IdB_pi8dLtVh9b4DG-zasA1i9Yk-5xAayoUTNWBAFpc,1235
27
- payi/resources/__init__.py,sha256=1p8kzMES8NNDQQoK3TEDE-8vVuQ59xxUjyyblZJBTjw,1015
28
- payi/resources/ingest.py,sha256=nEJcbeKt0eI6qi7lkVxVUmRXaI5hH5UtmSDLZUkkmSM,8419
27
+ payi/resources/__init__.py,sha256=uGNmPeysPonVR9KOzw-Qs1WB4CqJm17pEfoXqeEX1JA,1517
28
+ payi/resources/ingest.py,sha256=nl1-h7_xItYfQSmXUveuuyBSNmwcLZ03JZe31EgpztE,13468
29
29
  payi/resources/budgets/__init__.py,sha256=w1UhOdDXtUH4A91ME5Tw2nr9bRvPJyJY1YWiVVy7jj0,989
30
- payi/resources/budgets/budgets.py,sha256=_z9fg1rq1dNeIKJJxZ4kfqOTBdVzifMSRINwlLHGRHs,25946
30
+ payi/resources/budgets/budgets.py,sha256=VQiwsQIF6Rp7jlIUPQ5VpJbbVxFOxYHEPI-bWkiPt2k,26508
31
31
  payi/resources/budgets/tags.py,sha256=N26Uc7N8N1egvujY4LZ7RDoQ7oWeTR9w1pPbbgKLLqc,17841
32
- payi/types/__init__.py,sha256=JjHDryLWv31S0mtDuNEepBt4Dp1YSEtGRks9SBiMj4o,897
33
- payi/types/budget_create_params.py,sha256=2Vd6Z2x-xEfk73QknmNKJAicIT4ACmrPUYkmrAKp4dc,573
34
- payi/types/budget_history_response.py,sha256=WI7a6WZ2Dv573uPsFXKdGutj15Y975AOQfrINKwsgBc,2629
32
+ payi/resources/categories/__init__.py,sha256=w5gMiPdBSzJA_qfoVtFBElaoe8wGf_O63R7R1Spr6Gk,1093
33
+ payi/resources/categories/categories.py,sha256=hqJE4iSiMe5nvvsui4RjFJxFb8170iRbJfTafk2NzGw,15072
34
+ payi/resources/categories/resources.py,sha256=tEx1D3hrjgB_CDoGPIung-Ub3-jMFSYVnzmqZg-pr5g,17848
35
+ payi/types/__init__.py,sha256=yL2tBUOA4T1_S8E1K039r9Sr2OUOXI6hsdlA__r-S2I,1729
36
+ payi/types/budget_create_params.py,sha256=3PziVJT3_ll-6yv3i5EF8ERm19jFJAKbv9v-CvRW5ik,653
37
+ payi/types/budget_history_response.py,sha256=4SnisCLr1HImVecgonZK7HIm9WTmYl0YMaTbMP70qZY,934
35
38
  payi/types/budget_list_params.py,sha256=Win-Spveurf6WarTgCXXsP-yDIxr_HCP7oV_4JbqKOc,674
36
- payi/types/budget_response.py,sha256=OkG2MfiRMHqBalaZN23lLHiKC5DMAk04RRdpu5Z1kuQ,1243
37
- payi/types/budget_update_params.py,sha256=TTH7uu1c1zBK5zYhh2SPuRWEwr1XwDX_8bVS_GxIn9I,306
39
+ payi/types/budget_response.py,sha256=ZAZOvA5KLirARR92IuLkjGNWTLBUVJp5RwGI9Ow2Au0,827
40
+ payi/types/budget_update_params.py,sha256=foD5cPa1p2M2cpVUqlwkXwSEQlQcBLaigUQMUGkvcic,334
41
+ payi/types/bulk_ingest_response.py,sha256=uZO89-RjrckzM37LRXNifvRptyz_mqbyVP6zO2FlBiM,962
42
+ payi/types/category_delete_resource_response.py,sha256=DHGvvldGMSxwqsk83EAkqzEge94bYYZKPNyzL9jULdM,288
43
+ payi/types/category_delete_response.py,sha256=i9hW9WGPSIR9cBCLgSfH6lseGISoQwAK_3pgjlVMoI4,289
44
+ payi/types/category_list_resources_response.py,sha256=CnaOKWwDUPH47EKrNyeiI3p7jhEdgM9qs97M2tPRSGg,286
45
+ payi/types/category_list_response.py,sha256=LHuL6iKGoDVjHWWbpA4tm1r3mQMauQm4EZrWGrOZzWQ,243
46
+ payi/types/category_resource_response.py,sha256=GL3SjVawwzxQCTTHw5CyF4jajBKx5j7dirBmBHGoya0,518
47
+ payi/types/category_response.py,sha256=43i8bii20Sb-z9R5M1Ia6RGfRZmdQqsWPlv4Bl1XQf0,293
38
48
  payi/types/cost_data.py,sha256=jZtju_3WWNXh4wCu77XnyvxZkvewcvXBS_V0z07BizA,284
39
49
  payi/types/cost_details.py,sha256=3ldvnYILAG6Sz9wGWMs1SZvIfdGEbn5i4-CauWEXMPA,265
40
50
  payi/types/default_response.py,sha256=o617LpRsCIZHCZxAc5nVI2JQ3HPGZo4gCDvSDkxkIJ8,270
41
- payi/types/ingest_units_params.py,sha256=NhC7wRF0lpoKikUPQUAgE1OxpU8dqMxtRZNIbiXkYCA,575
42
- payi/types/paged_budget_list.py,sha256=wEC2UMQ6xSEfD1Z27Rb0J4uw-ewBWeKQ2ppKkPeWrxc,1789
43
- payi/types/proxy_result.py,sha256=qsl1dwZMXf3Gy7f7BzE4Fe4Pnu6OlSUY_LIo0oYLEZo,798
51
+ payi/types/ingest_bulk_params.py,sha256=Yngb3DBIsVTZakvFxu3FMFJbXQyJwWeoeMgXUxtOqOA,381
52
+ payi/types/ingest_response.py,sha256=7v5RU7YbXOsd3qKG2tKHeJZmsWpWR3VSqAaX8TDOUhY,1040
53
+ payi/types/ingest_units_param.py,sha256=jPYNfk8wZVmd1qIXglKW6ckZH2MHw0dV3BwIWXG_U6Q,558
54
+ payi/types/ingest_units_params.py,sha256=a3fEqwmrRNtGR9pqbTo50feTTjSmRGov6MYvXhBo1yc,748
55
+ payi/types/paged_budget_list.py,sha256=FqKlbAifEWY3sZqiJSny-XtS-XIfmj14AufNffNVmqM,1385
44
56
  payi/types/requests_data.py,sha256=UniFVu9SgDQIbZupzrLSrvBKV487_iKFemLw9nRDhGo,296
57
+ payi/types/total_cost_data.py,sha256=Nu1LyV1NX4CsI02Yn3GbvNXVZPrXG8U4Fs55rZE9KJk,603
45
58
  payi/types/budgets/__init__.py,sha256=5ByVuqOcgSYLHmGzhuj6-HG48mtQhC6oT5U5tNjQtxk,725
46
59
  payi/types/budgets/budget_tags.py,sha256=nOYMf7YgRdTZgGdedJw0UbQ2uupCq9MHlevLJoXxWB4,348
47
60
  payi/types/budgets/tag_create_params.py,sha256=_zEYfH2uKF44WenAdedx4TB9Az6RbIoAUMwqW8SAiuc,314
@@ -52,7 +65,10 @@ payi/types/budgets/tag_remove_params.py,sha256=fNiHex1U11o_B0bfJDkpGARkEf99J-bd-
52
65
  payi/types/budgets/tag_remove_response.py,sha256=Wt4KwC76y3qxdEqKhXzFkYu2iECYePgXcpidXkuheWQ,219
53
66
  payi/types/budgets/tag_update_params.py,sha256=bWWeDqfySt7CZ6HDsZzENREOWGWGWFgnAtyleNMwUsE,314
54
67
  payi/types/budgets/tag_update_response.py,sha256=Vlf-zxLZzvmhUodhzF7hiqWcxyjrb7Ri_lSajg8vOPM,219
55
- payi-0.1.0a13.dist-info/METADATA,sha256=KaoE098u5vTXtTVQbyyDX_fEHkH3mc45DAm9UUYfIic,11873
56
- payi-0.1.0a13.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
57
- payi-0.1.0a13.dist-info/licenses/LICENSE,sha256=8vX1pjh3esb6D5DvXAf6NxiBcVyon8aHWNJCxmmHXeY,11334
58
- payi-0.1.0a13.dist-info/RECORD,,
68
+ payi/types/categories/__init__.py,sha256=HQScxfK3F_J9HYbphrhG6bYb7S6vtrwafLViar5pHcM,285
69
+ payi/types/categories/resource_create_params.py,sha256=mbLjAyRz9iuINs_KEWYCLLUZFq4GcRhs0vL2RxqBFwQ,587
70
+ payi/types/categories/resource_list_response.py,sha256=DmfAmYm72WK9hSF0FSj6XYsZ59_S-ErmXNbZM8Bkc4o,269
71
+ payi-0.1.0a15.dist-info/METADATA,sha256=Xbtaak0SShck7BbYM2fwWus77dTwDPcEKtGCdoaia1g,12030
72
+ payi-0.1.0a15.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
73
+ payi-0.1.0a15.dist-info/licenses/LICENSE,sha256=8vX1pjh3esb6D5DvXAf6NxiBcVyon8aHWNJCxmmHXeY,11334
74
+ payi-0.1.0a15.dist-info/RECORD,,