payi 0.1.0a28__tar.gz → 0.1.0a30__tar.gz

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.

Potentially problematic release.


This version of payi might be problematic. Click here for more details.

Files changed (143) hide show
  1. payi-0.1.0a30/.release-please-manifest.json +3 -0
  2. {payi-0.1.0a28 → payi-0.1.0a30}/CHANGELOG.md +31 -0
  3. {payi-0.1.0a28 → payi-0.1.0a30}/PKG-INFO +5 -4
  4. {payi-0.1.0a28 → payi-0.1.0a30}/README.md +4 -2
  5. {payi-0.1.0a28 → payi-0.1.0a30}/mypy.ini +4 -1
  6. {payi-0.1.0a28 → payi-0.1.0a30}/pyproject.toml +2 -2
  7. {payi-0.1.0a28 → payi-0.1.0a30}/requirements-dev.lock +3 -1
  8. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/_base_client.py +8 -4
  9. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/_client.py +2 -2
  10. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/_compat.py +3 -5
  11. payi-0.1.0a30/src/payi/_utils/_sync.py +71 -0
  12. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/_version.py +1 -1
  13. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/resources/billing_models.py +8 -0
  14. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/resources/experiences/types.py +24 -4
  15. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/resources/ingest.py +12 -0
  16. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/billing_model.py +2 -0
  17. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/billing_model_create_params.py +2 -0
  18. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/billing_model_update_params.py +2 -0
  19. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/cost_details.py +2 -0
  20. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/experiences/experience_type.py +3 -0
  21. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/experiences/type_create_params.py +3 -0
  22. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/experiences/type_update_params.py +4 -1
  23. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/ingest_event_param.py +8 -0
  24. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/ingest_units_params.py +6 -0
  25. {payi-0.1.0a28 → payi-0.1.0a30}/tests/api_resources/experiences/test_types.py +44 -8
  26. {payi-0.1.0a28 → payi-0.1.0a30}/tests/api_resources/test_billing_models.py +4 -0
  27. {payi-0.1.0a28 → payi-0.1.0a30}/tests/api_resources/test_ingest.py +12 -66
  28. {payi-0.1.0a28 → payi-0.1.0a30}/tests/test_client.py +40 -2
  29. {payi-0.1.0a28 → payi-0.1.0a30}/tests/test_models.py +8 -0
  30. payi-0.1.0a28/.release-please-manifest.json +0 -3
  31. payi-0.1.0a28/src/payi/_utils/_sync.py +0 -81
  32. {payi-0.1.0a28 → payi-0.1.0a30}/.gitignore +0 -0
  33. {payi-0.1.0a28 → payi-0.1.0a30}/CONTRIBUTING.md +0 -0
  34. {payi-0.1.0a28 → payi-0.1.0a30}/LICENSE +0 -0
  35. {payi-0.1.0a28 → payi-0.1.0a30}/SECURITY.md +0 -0
  36. {payi-0.1.0a28 → payi-0.1.0a30}/api.md +0 -0
  37. {payi-0.1.0a28 → payi-0.1.0a30}/bin/check-release-environment +0 -0
  38. {payi-0.1.0a28 → payi-0.1.0a30}/bin/publish-pypi +0 -0
  39. {payi-0.1.0a28 → payi-0.1.0a30}/examples/.keep +0 -0
  40. {payi-0.1.0a28 → payi-0.1.0a30}/noxfile.py +0 -0
  41. {payi-0.1.0a28 → payi-0.1.0a30}/release-please-config.json +0 -0
  42. {payi-0.1.0a28 → payi-0.1.0a30}/requirements.lock +0 -0
  43. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/__init__.py +0 -0
  44. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/_constants.py +0 -0
  45. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/_exceptions.py +0 -0
  46. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/_files.py +0 -0
  47. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/_models.py +0 -0
  48. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/_qs.py +0 -0
  49. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/_resource.py +0 -0
  50. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/_response.py +0 -0
  51. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/_streaming.py +0 -0
  52. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/_types.py +0 -0
  53. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/_utils/__init__.py +0 -0
  54. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/_utils/_logs.py +0 -0
  55. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/_utils/_proxy.py +0 -0
  56. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/_utils/_reflection.py +0 -0
  57. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/_utils/_streams.py +0 -0
  58. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/_utils/_transform.py +0 -0
  59. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/_utils/_typing.py +0 -0
  60. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/_utils/_utils.py +0 -0
  61. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/lib/.keep +0 -0
  62. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/lib/helpers.py +0 -0
  63. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/py.typed +0 -0
  64. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/resources/__init__.py +0 -0
  65. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/resources/budgets/__init__.py +0 -0
  66. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/resources/budgets/budgets.py +0 -0
  67. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/resources/budgets/tags.py +0 -0
  68. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/resources/categories/__init__.py +0 -0
  69. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/resources/categories/categories.py +0 -0
  70. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/resources/categories/resources.py +0 -0
  71. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/resources/csat.py +0 -0
  72. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/resources/experiences/__init__.py +0 -0
  73. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/resources/experiences/experiences.py +0 -0
  74. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/resources/price_modifiers.py +0 -0
  75. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/__init__.py +0 -0
  76. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/billing_model_list_response.py +0 -0
  77. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/budget_create_params.py +0 -0
  78. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/budget_history_response.py +0 -0
  79. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/budget_list_params.py +0 -0
  80. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/budget_response.py +0 -0
  81. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/budget_update_params.py +0 -0
  82. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/budgets/__init__.py +0 -0
  83. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/budgets/budget_tags.py +0 -0
  84. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/budgets/tag_create_params.py +0 -0
  85. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/budgets/tag_create_response.py +0 -0
  86. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/budgets/tag_delete_response.py +0 -0
  87. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/budgets/tag_list_response.py +0 -0
  88. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/budgets/tag_remove_params.py +0 -0
  89. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/budgets/tag_remove_response.py +0 -0
  90. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/budgets/tag_update_params.py +0 -0
  91. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/budgets/tag_update_response.py +0 -0
  92. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/bulk_ingest_response.py +0 -0
  93. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/categories/__init__.py +0 -0
  94. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/categories/resource_create_params.py +0 -0
  95. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/categories/resource_list_response.py +0 -0
  96. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/category_delete_resource_response.py +0 -0
  97. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/category_delete_response.py +0 -0
  98. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/category_list_resources_response.py +0 -0
  99. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/category_list_response.py +0 -0
  100. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/category_resource_response.py +0 -0
  101. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/category_response.py +0 -0
  102. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/cost_data.py +0 -0
  103. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/csat.py +0 -0
  104. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/csat_create_params.py +0 -0
  105. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/default_response.py +0 -0
  106. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/experience_instance.py +0 -0
  107. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/experiences/__init__.py +0 -0
  108. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/experiences/type_list_params.py +0 -0
  109. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/experiences/type_list_response.py +0 -0
  110. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/ingest_bulk_params.py +0 -0
  111. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/ingest_response.py +0 -0
  112. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/paged_budget_list.py +0 -0
  113. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/price_modifier.py +0 -0
  114. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/price_modifier_create_params.py +0 -0
  115. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/price_modifier_retrieve_response.py +0 -0
  116. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/price_modifier_update_params.py +0 -0
  117. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/requests_data.py +0 -0
  118. {payi-0.1.0a28 → payi-0.1.0a30}/src/payi/types/total_cost_data.py +0 -0
  119. {payi-0.1.0a28 → payi-0.1.0a30}/tests/__init__.py +0 -0
  120. {payi-0.1.0a28 → payi-0.1.0a30}/tests/api_resources/__init__.py +0 -0
  121. {payi-0.1.0a28 → payi-0.1.0a30}/tests/api_resources/budgets/__init__.py +0 -0
  122. {payi-0.1.0a28 → payi-0.1.0a30}/tests/api_resources/budgets/test_tags.py +0 -0
  123. {payi-0.1.0a28 → payi-0.1.0a30}/tests/api_resources/categories/__init__.py +0 -0
  124. {payi-0.1.0a28 → payi-0.1.0a30}/tests/api_resources/categories/test_resources.py +0 -0
  125. {payi-0.1.0a28 → payi-0.1.0a30}/tests/api_resources/experiences/__init__.py +0 -0
  126. {payi-0.1.0a28 → payi-0.1.0a30}/tests/api_resources/test_budgets.py +0 -0
  127. {payi-0.1.0a28 → payi-0.1.0a30}/tests/api_resources/test_categories.py +0 -0
  128. {payi-0.1.0a28 → payi-0.1.0a30}/tests/api_resources/test_csat.py +0 -0
  129. {payi-0.1.0a28 → payi-0.1.0a30}/tests/api_resources/test_experiences.py +0 -0
  130. {payi-0.1.0a28 → payi-0.1.0a30}/tests/api_resources/test_price_modifiers.py +0 -0
  131. {payi-0.1.0a28 → payi-0.1.0a30}/tests/conftest.py +0 -0
  132. {payi-0.1.0a28 → payi-0.1.0a30}/tests/sample_file.txt +0 -0
  133. {payi-0.1.0a28 → payi-0.1.0a30}/tests/test_deepcopy.py +0 -0
  134. {payi-0.1.0a28 → payi-0.1.0a30}/tests/test_extract_files.py +0 -0
  135. {payi-0.1.0a28 → payi-0.1.0a30}/tests/test_files.py +0 -0
  136. {payi-0.1.0a28 → payi-0.1.0a30}/tests/test_qs.py +0 -0
  137. {payi-0.1.0a28 → payi-0.1.0a30}/tests/test_required_args.py +0 -0
  138. {payi-0.1.0a28 → payi-0.1.0a30}/tests/test_response.py +0 -0
  139. {payi-0.1.0a28 → payi-0.1.0a30}/tests/test_streaming.py +0 -0
  140. {payi-0.1.0a28 → payi-0.1.0a30}/tests/test_transform.py +0 -0
  141. {payi-0.1.0a28 → payi-0.1.0a30}/tests/test_utils/test_proxy.py +0 -0
  142. {payi-0.1.0a28 → payi-0.1.0a30}/tests/test_utils/test_typing.py +0 -0
  143. {payi-0.1.0a28 → payi-0.1.0a30}/tests/utils.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.1.0-alpha.30"
3
+ }
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-alpha.30 (2024-12-03)
4
+
5
+ Full Changelog: [v0.1.0-alpha.29...v0.1.0-alpha.30](https://github.com/Pay-i/pay-i-python/compare/v0.1.0-alpha.29...v0.1.0-alpha.30)
6
+
7
+ ### Bug Fixes
8
+
9
+ * **asyncify:** avoid hanging process under certain conditions ([#141](https://github.com/Pay-i/pay-i-python/issues/141)) ([58b8775](https://github.com/Pay-i/pay-i-python/commit/58b8775427865cb3aa4c05748511c7f2d5ab8c22))
10
+ * **client:** compat with new httpx 0.28.0 release ([#146](https://github.com/Pay-i/pay-i-python/issues/146)) ([4ae1a72](https://github.com/Pay-i/pay-i-python/commit/4ae1a72109d0633aaa08d9ff9d6d3aef7e1a9e0d))
11
+
12
+
13
+ ### Chores
14
+
15
+ * **internal:** bump pyright ([#147](https://github.com/Pay-i/pay-i-python/issues/147)) ([f169e37](https://github.com/Pay-i/pay-i-python/commit/f169e3780bb33eefaf18ae61f4765a21be418f1e))
16
+ * **internal:** codegen related update ([#144](https://github.com/Pay-i/pay-i-python/issues/144)) ([792376c](https://github.com/Pay-i/pay-i-python/commit/792376c30d33a9a2aa0bacf53c38e481ded7be4c))
17
+ * **internal:** exclude mypy from running on tests ([#145](https://github.com/Pay-i/pay-i-python/issues/145)) ([3856fd1](https://github.com/Pay-i/pay-i-python/commit/3856fd19391aa68befe8776406e340efdff49984))
18
+ * **internal:** fix compat model_dump method when warnings are passed ([#142](https://github.com/Pay-i/pay-i-python/issues/142)) ([58b3ef8](https://github.com/Pay-i/pay-i-python/commit/58b3ef8b4d1dc9c7df2858c6914e587e08f43857))
19
+ * rebuild project due to codegen change ([#139](https://github.com/Pay-i/pay-i-python/issues/139)) ([9ed4a24](https://github.com/Pay-i/pay-i-python/commit/9ed4a2439973965d745cbfd2dfc68003958d51c5))
20
+
21
+
22
+ ### Documentation
23
+
24
+ * add info log level to readme ([#143](https://github.com/Pay-i/pay-i-python/issues/143)) ([cec3a51](https://github.com/Pay-i/pay-i-python/commit/cec3a51a51ca9ab67c37dd2692a5222ede4c72cf))
25
+
26
+ ## 0.1.0-alpha.29 (2024-11-15)
27
+
28
+ Full Changelog: [v0.1.0-alpha.28...v0.1.0-alpha.29](https://github.com/Pay-i/pay-i-python/compare/v0.1.0-alpha.28...v0.1.0-alpha.29)
29
+
30
+ ### Features
31
+
32
+ * **api:** update apikey header ([#132](https://github.com/Pay-i/pay-i-python/issues/132)) ([4e42d00](https://github.com/Pay-i/pay-i-python/commit/4e42d005530be2e002f536c2008c75a2afc1dea2))
33
+
3
34
  ## 0.1.0-alpha.28 (2024-11-15)
4
35
 
5
36
  Full Changelog: [v0.1.0-alpha.27...v0.1.0-alpha.28](https://github.com/Pay-i/pay-i-python/compare/v0.1.0-alpha.27...v0.1.0-alpha.28)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: payi
3
- Version: 0.1.0a28
3
+ Version: 0.1.0a30
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
@@ -22,7 +22,6 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
22
  Classifier: Typing :: Typed
23
23
  Requires-Python: >=3.8
24
24
  Requires-Dist: anyio<5,>=3.5.0
25
- Requires-Dist: cached-property; python_version < '3.8'
26
25
  Requires-Dist: distro<2,>=1.7.0
27
26
  Requires-Dist: httpx<1,>=0.23.0
28
27
  Requires-Dist: pydantic<3,>=1.9.0
@@ -215,12 +214,14 @@ Note that requests that time out are [retried twice by default](https://github.c
215
214
 
216
215
  We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.
217
216
 
218
- You can enable logging by setting the environment variable `PAYI_LOG` to `debug`.
217
+ You can enable logging by setting the environment variable `PAYI_LOG` to `info`.
219
218
 
220
219
  ```shell
221
- $ export PAYI_LOG=debug
220
+ $ export PAYI_LOG=info
222
221
  ```
223
222
 
223
+ Or to `debug` for more verbose logging.
224
+
224
225
  ### How to tell whether `None` means `null` or missing
225
226
 
226
227
  In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:
@@ -183,12 +183,14 @@ Note that requests that time out are [retried twice by default](#retries).
183
183
 
184
184
  We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.
185
185
 
186
- You can enable logging by setting the environment variable `PAYI_LOG` to `debug`.
186
+ You can enable logging by setting the environment variable `PAYI_LOG` to `info`.
187
187
 
188
188
  ```shell
189
- $ export PAYI_LOG=debug
189
+ $ export PAYI_LOG=info
190
190
  ```
191
191
 
192
+ Or to `debug` for more verbose logging.
193
+
192
194
  ### How to tell whether `None` means `null` or missing
193
195
 
194
196
  In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:
@@ -5,7 +5,10 @@ show_error_codes = True
5
5
  # Exclude _files.py because mypy isn't smart enough to apply
6
6
  # the correct type narrowing and as this is an internal module
7
7
  # it's fine to just use Pyright.
8
- exclude = ^(src/payi/_files\.py|_dev/.*\.py)$
8
+ #
9
+ # We also exclude our `tests` as mypy doesn't always infer
10
+ # types correctly and Pyright will still catch any type errors.
11
+ exclude = ^(src/payi/_files\.py|_dev/.*\.py|tests/.*)$
9
12
 
10
13
  strict_equality = True
11
14
  implicit_reexport = True
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "payi"
3
- version = "0.1.0-alpha.28"
3
+ version = "0.1.0-alpha.30"
4
4
  description = "The official Python library for the payi API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -14,7 +14,6 @@ dependencies = [
14
14
  "anyio>=3.5.0, <5",
15
15
  "distro>=1.7.0, <2",
16
16
  "sniffio",
17
- "cached-property; python_version < '3.8'",
18
17
  ]
19
18
  requires-python = ">= 3.8"
20
19
  classifiers = [
@@ -55,6 +54,7 @@ dev-dependencies = [
55
54
  "dirty-equals>=0.6.0",
56
55
  "importlib-metadata>=6.7.0",
57
56
  "rich>=13.7.1",
57
+ "nest_asyncio==1.6.0"
58
58
  ]
59
59
 
60
60
  [tool.rye.scripts]
@@ -51,6 +51,7 @@ mdurl==0.1.2
51
51
  mypy==1.13.0
52
52
  mypy-extensions==1.0.0
53
53
  # via mypy
54
+ nest-asyncio==1.6.0
54
55
  nodeenv==1.8.0
55
56
  # via pyright
56
57
  nox==2023.4.22
@@ -67,7 +68,7 @@ pydantic-core==2.23.4
67
68
  # via pydantic
68
69
  pygments==2.18.0
69
70
  # via rich
70
- pyright==1.1.380
71
+ pyright==1.1.389
71
72
  pytest==8.3.3
72
73
  # via pytest-asyncio
73
74
  pytest-asyncio==0.24.0
@@ -96,6 +97,7 @@ typing-extensions==4.12.2
96
97
  # via payi
97
98
  # via pydantic
98
99
  # via pydantic-core
100
+ # via pyright
99
101
  virtualenv==20.24.5
100
102
  # via nox
101
103
  zipp==3.17.0
@@ -792,6 +792,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
792
792
  custom_query: Mapping[str, object] | None = None,
793
793
  _strict_response_validation: bool,
794
794
  ) -> None:
795
+ kwargs: dict[str, Any] = {}
795
796
  if limits is not None:
796
797
  warnings.warn(
797
798
  "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
@@ -804,6 +805,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
804
805
  limits = DEFAULT_CONNECTION_LIMITS
805
806
 
806
807
  if transport is not None:
808
+ kwargs["transport"] = transport
807
809
  warnings.warn(
808
810
  "The `transport` argument is deprecated. The `http_client` argument should be passed instead",
809
811
  category=DeprecationWarning,
@@ -813,6 +815,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
813
815
  raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
814
816
 
815
817
  if proxies is not None:
818
+ kwargs["proxies"] = proxies
816
819
  warnings.warn(
817
820
  "The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
818
821
  category=DeprecationWarning,
@@ -856,10 +859,9 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
856
859
  base_url=base_url,
857
860
  # cast to a valid type because mypy doesn't understand our type narrowing
858
861
  timeout=cast(Timeout, timeout),
859
- proxies=proxies,
860
- transport=transport,
861
862
  limits=limits,
862
863
  follow_redirects=True,
864
+ **kwargs, # type: ignore
863
865
  )
864
866
 
865
867
  def is_closed(self) -> bool:
@@ -1358,6 +1360,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1358
1360
  custom_headers: Mapping[str, str] | None = None,
1359
1361
  custom_query: Mapping[str, object] | None = None,
1360
1362
  ) -> None:
1363
+ kwargs: dict[str, Any] = {}
1361
1364
  if limits is not None:
1362
1365
  warnings.warn(
1363
1366
  "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
@@ -1370,6 +1373,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1370
1373
  limits = DEFAULT_CONNECTION_LIMITS
1371
1374
 
1372
1375
  if transport is not None:
1376
+ kwargs["transport"] = transport
1373
1377
  warnings.warn(
1374
1378
  "The `transport` argument is deprecated. The `http_client` argument should be passed instead",
1375
1379
  category=DeprecationWarning,
@@ -1379,6 +1383,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1379
1383
  raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
1380
1384
 
1381
1385
  if proxies is not None:
1386
+ kwargs["proxies"] = proxies
1382
1387
  warnings.warn(
1383
1388
  "The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
1384
1389
  category=DeprecationWarning,
@@ -1422,10 +1427,9 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1422
1427
  base_url=base_url,
1423
1428
  # cast to a valid type because mypy doesn't understand our type narrowing
1424
1429
  timeout=cast(Timeout, timeout),
1425
- proxies=proxies,
1426
- transport=transport,
1427
1430
  limits=limits,
1428
1431
  follow_redirects=True,
1432
+ **kwargs, # type: ignore
1429
1433
  )
1430
1434
 
1431
1435
  def is_closed(self) -> bool:
@@ -129,7 +129,7 @@ class Payi(SyncAPIClient):
129
129
  @override
130
130
  def auth_headers(self) -> dict[str, str]:
131
131
  api_key = self.api_key
132
- return {"Authorization": api_key}
132
+ return {"xProxy-api-key": api_key}
133
133
 
134
134
  @property
135
135
  @override
@@ -309,7 +309,7 @@ class AsyncPayi(AsyncAPIClient):
309
309
  @override
310
310
  def auth_headers(self) -> dict[str, str]:
311
311
  api_key = self.api_key
312
- return {"Authorization": api_key}
312
+ return {"xProxy-api-key": api_key}
313
313
 
314
314
  @property
315
315
  @override
@@ -145,7 +145,8 @@ def model_dump(
145
145
  exclude=exclude,
146
146
  exclude_unset=exclude_unset,
147
147
  exclude_defaults=exclude_defaults,
148
- warnings=warnings,
148
+ # warnings are not supported in Pydantic v1
149
+ warnings=warnings if PYDANTIC_V2 else True,
149
150
  )
150
151
  return cast(
151
152
  "dict[str, Any]",
@@ -213,9 +214,6 @@ if TYPE_CHECKING:
213
214
  # __set__ is not defined at runtime, but @cached_property is designed to be settable
214
215
  def __set__(self, instance: object, value: _T) -> None: ...
215
216
  else:
216
- try:
217
- from functools import cached_property as cached_property
218
- except ImportError:
219
- from cached_property import cached_property as cached_property
217
+ from functools import cached_property as cached_property
220
218
 
221
219
  typed_cached_property = cached_property
@@ -0,0 +1,71 @@
1
+ from __future__ import annotations
2
+
3
+ import sys
4
+ import asyncio
5
+ import functools
6
+ import contextvars
7
+ from typing import Any, TypeVar, Callable, Awaitable
8
+ from typing_extensions import ParamSpec
9
+
10
+ T_Retval = TypeVar("T_Retval")
11
+ T_ParamSpec = ParamSpec("T_ParamSpec")
12
+
13
+
14
+ if sys.version_info >= (3, 9):
15
+ to_thread = asyncio.to_thread
16
+ else:
17
+ # backport of https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread
18
+ # for Python 3.8 support
19
+ async def to_thread(
20
+ func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs
21
+ ) -> Any:
22
+ """Asynchronously run function *func* in a separate thread.
23
+
24
+ Any *args and **kwargs supplied for this function are directly passed
25
+ to *func*. Also, the current :class:`contextvars.Context` is propagated,
26
+ allowing context variables from the main thread to be accessed in the
27
+ separate thread.
28
+
29
+ Returns a coroutine that can be awaited to get the eventual result of *func*.
30
+ """
31
+ loop = asyncio.events.get_running_loop()
32
+ ctx = contextvars.copy_context()
33
+ func_call = functools.partial(ctx.run, func, *args, **kwargs)
34
+ return await loop.run_in_executor(None, func_call)
35
+
36
+
37
+ # inspired by `asyncer`, https://github.com/tiangolo/asyncer
38
+ def asyncify(function: Callable[T_ParamSpec, T_Retval]) -> Callable[T_ParamSpec, Awaitable[T_Retval]]:
39
+ """
40
+ Take a blocking function and create an async one that receives the same
41
+ positional and keyword arguments. For python version 3.9 and above, it uses
42
+ asyncio.to_thread to run the function in a separate thread. For python version
43
+ 3.8, it uses locally defined copy of the asyncio.to_thread function which was
44
+ introduced in python 3.9.
45
+
46
+ Usage:
47
+
48
+ ```python
49
+ def blocking_func(arg1, arg2, kwarg1=None):
50
+ # blocking code
51
+ return result
52
+
53
+
54
+ result = asyncify(blocking_function)(arg1, arg2, kwarg1=value1)
55
+ ```
56
+
57
+ ## Arguments
58
+
59
+ `function`: a blocking regular callable (e.g. a function)
60
+
61
+ ## Return
62
+
63
+ An async function that takes the same positional and keyword arguments as the
64
+ original one, that when called runs the same original function in a thread worker
65
+ and returns the result.
66
+ """
67
+
68
+ async def wrapper(*args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs) -> T_Retval:
69
+ return await to_thread(function, *args, **kwargs)
70
+
71
+ return wrapper
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "payi"
4
- __version__ = "0.1.0-alpha.28" # x-release-please-version
4
+ __version__ = "0.1.0-alpha.30" # x-release-please-version
@@ -53,6 +53,7 @@ class BillingModelsResource(SyncAPIResource):
53
53
  *,
54
54
  name: str,
55
55
  type: Literal["costplus"],
56
+ default_price_modifier: Optional[float] | NotGiven = NOT_GIVEN,
56
57
  prepaid_amount: Optional[float] | NotGiven = NOT_GIVEN,
57
58
  prepaid_max: Optional[float] | NotGiven = NOT_GIVEN,
58
59
  threshold: Optional[float] | NotGiven = NOT_GIVEN,
@@ -79,6 +80,7 @@ class BillingModelsResource(SyncAPIResource):
79
80
  {
80
81
  "name": name,
81
82
  "type": type,
83
+ "default_price_modifier": default_price_modifier,
82
84
  "prepaid_amount": prepaid_amount,
83
85
  "prepaid_max": prepaid_max,
84
86
  "threshold": threshold,
@@ -127,6 +129,7 @@ class BillingModelsResource(SyncAPIResource):
127
129
  billing_model_id: str,
128
130
  *,
129
131
  type: Literal["costplus"],
132
+ default_price_modifier: Optional[float] | NotGiven = NOT_GIVEN,
130
133
  name: Optional[str] | NotGiven = NOT_GIVEN,
131
134
  prepaid_amount: Optional[float] | NotGiven = NOT_GIVEN,
132
135
  prepaid_max: Optional[float] | NotGiven = NOT_GIVEN,
@@ -155,6 +158,7 @@ class BillingModelsResource(SyncAPIResource):
155
158
  body=maybe_transform(
156
159
  {
157
160
  "type": type,
161
+ "default_price_modifier": default_price_modifier,
158
162
  "name": name,
159
163
  "prepaid_amount": prepaid_amount,
160
164
  "prepaid_max": prepaid_max,
@@ -243,6 +247,7 @@ class AsyncBillingModelsResource(AsyncAPIResource):
243
247
  *,
244
248
  name: str,
245
249
  type: Literal["costplus"],
250
+ default_price_modifier: Optional[float] | NotGiven = NOT_GIVEN,
246
251
  prepaid_amount: Optional[float] | NotGiven = NOT_GIVEN,
247
252
  prepaid_max: Optional[float] | NotGiven = NOT_GIVEN,
248
253
  threshold: Optional[float] | NotGiven = NOT_GIVEN,
@@ -269,6 +274,7 @@ class AsyncBillingModelsResource(AsyncAPIResource):
269
274
  {
270
275
  "name": name,
271
276
  "type": type,
277
+ "default_price_modifier": default_price_modifier,
272
278
  "prepaid_amount": prepaid_amount,
273
279
  "prepaid_max": prepaid_max,
274
280
  "threshold": threshold,
@@ -317,6 +323,7 @@ class AsyncBillingModelsResource(AsyncAPIResource):
317
323
  billing_model_id: str,
318
324
  *,
319
325
  type: Literal["costplus"],
326
+ default_price_modifier: Optional[float] | NotGiven = NOT_GIVEN,
320
327
  name: Optional[str] | NotGiven = NOT_GIVEN,
321
328
  prepaid_amount: Optional[float] | NotGiven = NOT_GIVEN,
322
329
  prepaid_max: Optional[float] | NotGiven = NOT_GIVEN,
@@ -345,6 +352,7 @@ class AsyncBillingModelsResource(AsyncAPIResource):
345
352
  body=await async_maybe_transform(
346
353
  {
347
354
  "type": type,
355
+ "default_price_modifier": default_price_modifier,
348
356
  "name": name,
349
357
  "prepaid_amount": prepaid_amount,
350
358
  "prepaid_max": prepaid_max,
@@ -2,6 +2,8 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from typing import Optional
6
+
5
7
  import httpx
6
8
 
7
9
  from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
@@ -50,6 +52,7 @@ class TypesResource(SyncAPIResource):
50
52
  *,
51
53
  description: str,
52
54
  name: str,
55
+ logging_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
53
56
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
54
57
  # The extra values given here take precedence over values defined on the client or passed to this method.
55
58
  extra_headers: Headers | None = None,
@@ -75,6 +78,7 @@ class TypesResource(SyncAPIResource):
75
78
  {
76
79
  "description": description,
77
80
  "name": name,
81
+ "logging_enabled": logging_enabled,
78
82
  },
79
83
  type_create_params.TypeCreateParams,
80
84
  ),
@@ -121,7 +125,8 @@ class TypesResource(SyncAPIResource):
121
125
  self,
122
126
  experience_name: str,
123
127
  *,
124
- description: str,
128
+ description: Optional[str],
129
+ logging_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
125
130
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
126
131
  # The extra values given here take precedence over values defined on the client or passed to this method.
127
132
  extra_headers: Headers | None = None,
@@ -145,7 +150,13 @@ class TypesResource(SyncAPIResource):
145
150
  raise ValueError(f"Expected a non-empty value for `experience_name` but received {experience_name!r}")
146
151
  return self._patch(
147
152
  f"/api/v1/experiences/types/{experience_name}",
148
- body=maybe_transform({"description": description}, type_update_params.TypeUpdateParams),
153
+ body=maybe_transform(
154
+ {
155
+ "description": description,
156
+ "logging_enabled": logging_enabled,
157
+ },
158
+ type_update_params.TypeUpdateParams,
159
+ ),
149
160
  options=make_request_options(
150
161
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
151
162
  ),
@@ -248,6 +259,7 @@ class AsyncTypesResource(AsyncAPIResource):
248
259
  *,
249
260
  description: str,
250
261
  name: str,
262
+ logging_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
251
263
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
252
264
  # The extra values given here take precedence over values defined on the client or passed to this method.
253
265
  extra_headers: Headers | None = None,
@@ -273,6 +285,7 @@ class AsyncTypesResource(AsyncAPIResource):
273
285
  {
274
286
  "description": description,
275
287
  "name": name,
288
+ "logging_enabled": logging_enabled,
276
289
  },
277
290
  type_create_params.TypeCreateParams,
278
291
  ),
@@ -319,7 +332,8 @@ class AsyncTypesResource(AsyncAPIResource):
319
332
  self,
320
333
  experience_name: str,
321
334
  *,
322
- description: str,
335
+ description: Optional[str],
336
+ logging_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
323
337
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
324
338
  # The extra values given here take precedence over values defined on the client or passed to this method.
325
339
  extra_headers: Headers | None = None,
@@ -343,7 +357,13 @@ class AsyncTypesResource(AsyncAPIResource):
343
357
  raise ValueError(f"Expected a non-empty value for `experience_name` but received {experience_name!r}")
344
358
  return await self._patch(
345
359
  f"/api/v1/experiences/types/{experience_name}",
346
- body=await async_maybe_transform({"description": description}, type_update_params.TypeUpdateParams),
360
+ body=await async_maybe_transform(
361
+ {
362
+ "description": description,
363
+ "logging_enabled": logging_enabled,
364
+ },
365
+ type_update_params.TypeUpdateParams,
366
+ ),
347
367
  options=make_request_options(
348
368
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
349
369
  ),
@@ -91,8 +91,11 @@ class IngestResource(SyncAPIResource):
91
91
  category: str,
92
92
  resource: str,
93
93
  units: Dict[str, ingest_units_params.Units],
94
+ end_to_end_latency_ms: Optional[int] | NotGiven = NOT_GIVEN,
94
95
  event_timestamp: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
96
+ http_status_code: Optional[int] | NotGiven = NOT_GIVEN,
95
97
  provisioned_resource_name: Optional[str] | NotGiven = NOT_GIVEN,
98
+ time_to_first_token_ms: Optional[int] | NotGiven = NOT_GIVEN,
96
99
  budget_ids: Union[list[str], None] | NotGiven = NOT_GIVEN,
97
100
  request_tags: Union[list[str], None] | NotGiven = NOT_GIVEN,
98
101
  experience_id: Union[str, None] | NotGiven = NOT_GIVEN,
@@ -186,8 +189,11 @@ class IngestResource(SyncAPIResource):
186
189
  "category": category,
187
190
  "resource": resource,
188
191
  "units": units,
192
+ "end_to_end_latency_ms": end_to_end_latency_ms,
189
193
  "event_timestamp": event_timestamp,
194
+ "http_status_code": http_status_code,
190
195
  "provisioned_resource_name": provisioned_resource_name,
196
+ "time_to_first_token_ms": time_to_first_token_ms,
191
197
  },
192
198
  ingest_units_params.IngestUnitsParams,
193
199
  ),
@@ -258,8 +264,11 @@ class AsyncIngestResource(AsyncAPIResource):
258
264
  category: str,
259
265
  resource: str,
260
266
  units: Dict[str, ingest_units_params.Units],
267
+ end_to_end_latency_ms: Optional[int] | NotGiven = NOT_GIVEN,
261
268
  event_timestamp: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
269
+ http_status_code: Optional[int] | NotGiven = NOT_GIVEN,
262
270
  provisioned_resource_name: Optional[str] | NotGiven = NOT_GIVEN,
271
+ time_to_first_token_ms: Optional[int] | NotGiven = NOT_GIVEN,
263
272
  budget_ids: Union[list[str], None] | NotGiven = NOT_GIVEN,
264
273
  request_tags: Union[list[str], None] | NotGiven = NOT_GIVEN,
265
274
  experience_name: Union[str, None] | NotGiven = NOT_GIVEN,
@@ -352,8 +361,11 @@ class AsyncIngestResource(AsyncAPIResource):
352
361
  "category": category,
353
362
  "resource": resource,
354
363
  "units": units,
364
+ "end_to_end_latency_ms": end_to_end_latency_ms,
355
365
  "event_timestamp": event_timestamp,
366
+ "http_status_code": http_status_code,
356
367
  "provisioned_resource_name": provisioned_resource_name,
368
+ "time_to_first_token_ms": time_to_first_token_ms,
357
369
  },
358
370
  ingest_units_params.IngestUnitsParams,
359
371
  ),
@@ -22,6 +22,8 @@ class BillingModel(BaseModel):
22
22
 
23
23
  updated_on: datetime
24
24
 
25
+ default_price_modifier: Optional[float] = None
26
+
25
27
  prepaid_amount: Optional[float] = None
26
28
 
27
29
  prepaid_max: Optional[float] = None
@@ -13,6 +13,8 @@ class BillingModelCreateParams(TypedDict, total=False):
13
13
 
14
14
  type: Required[Literal["costplus"]]
15
15
 
16
+ default_price_modifier: Optional[float]
17
+
16
18
  prepaid_amount: Optional[float]
17
19
 
18
20
  prepaid_max: Optional[float]
@@ -11,6 +11,8 @@ __all__ = ["BillingModelUpdateParams"]
11
11
  class BillingModelUpdateParams(TypedDict, total=False):
12
12
  type: Required[Literal["costplus"]]
13
13
 
14
+ default_price_modifier: Optional[float]
15
+
14
16
  name: Optional[str]
15
17
 
16
18
  prepaid_amount: Optional[float]
@@ -10,4 +10,6 @@ __all__ = ["CostDetails"]
10
10
  class CostDetails(BaseModel):
11
11
  base: float
12
12
 
13
+ overage_base: Optional[float] = None
14
+
13
15
  overrun_base: Optional[float] = None
@@ -1,5 +1,6 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ from typing import Optional
3
4
 
4
5
  from ..._models import BaseModel
5
6
 
@@ -12,3 +13,5 @@ class ExperienceType(BaseModel):
12
13
  name: str
13
14
 
14
15
  request_id: str
16
+
17
+ logging_enabled: Optional[bool] = None
@@ -2,6 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from typing import Optional
5
6
  from typing_extensions import Required, TypedDict
6
7
 
7
8
  __all__ = ["TypeCreateParams"]
@@ -11,3 +12,5 @@ class TypeCreateParams(TypedDict, total=False):
11
12
  description: Required[str]
12
13
 
13
14
  name: Required[str]
15
+
16
+ logging_enabled: Optional[bool]
@@ -2,10 +2,13 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from typing import Optional
5
6
  from typing_extensions import Required, TypedDict
6
7
 
7
8
  __all__ = ["TypeUpdateParams"]
8
9
 
9
10
 
10
11
  class TypeUpdateParams(TypedDict, total=False):
11
- description: Required[str]
12
+ description: Required[Optional[str]]
13
+
14
+ logging_enabled: Optional[bool]
@@ -26,14 +26,22 @@ class IngestEventParam(TypedDict, total=False):
26
26
 
27
27
  budget_ids: Optional[List[str]]
28
28
 
29
+ csat_rating: Optional[int]
30
+
31
+ end_to_end_latency_ms: Optional[int]
32
+
29
33
  event_timestamp: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
30
34
 
31
35
  experience_id: Optional[str]
32
36
 
33
37
  experience_name: Optional[str]
34
38
 
39
+ http_status_code: Optional[int]
40
+
35
41
  provisioned_resource_name: Optional[str]
36
42
 
37
43
  request_tags: Optional[List[str]]
38
44
 
45
+ time_to_first_token_ms: Optional[int]
46
+
39
47
  user_id: Optional[str]