payi 0.1.0a25__py3-none-any.whl → 0.1.0a27__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.

Potentially problematic release.


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

Files changed (44) hide show
  1. payi/_base_client.py +13 -3
  2. payi/_client.py +24 -8
  3. payi/_response.py +3 -0
  4. payi/_version.py +1 -1
  5. payi/resources/__init__.py +42 -14
  6. payi/resources/billing_models.py +492 -0
  7. payi/resources/budgets/budgets.py +4 -4
  8. payi/resources/categories/resources.py +9 -9
  9. payi/resources/{evaluations/experiences.py → csat.py} +49 -49
  10. payi/resources/ingest.py +23 -11
  11. payi/resources/price_modifiers.py +353 -0
  12. payi/types/__init__.py +10 -1
  13. payi/types/billing_model.py +29 -0
  14. payi/types/billing_model_create_params.py +20 -0
  15. payi/types/billing_model_list_response.py +10 -0
  16. payi/types/billing_model_update_params.py +20 -0
  17. payi/types/budget_create_params.py +2 -2
  18. payi/types/budget_response.py +2 -2
  19. payi/types/bulk_ingest_response.py +7 -0
  20. payi/types/categories/resource_create_params.py +10 -4
  21. payi/types/category_resource_response.py +10 -4
  22. payi/types/cost_data.py +0 -1
  23. payi/types/{shared/evaluation_response.py → csat.py} +3 -4
  24. payi/types/csat_create_params.py +14 -0
  25. payi/types/experience_instance.py +0 -1
  26. payi/types/experiences/experience_type.py +0 -1
  27. payi/types/ingest_event_param.py +14 -6
  28. payi/types/ingest_response.py +7 -1
  29. payi/types/ingest_units_params.py +13 -6
  30. payi/types/paged_budget_list.py +2 -2
  31. payi/types/price_modifier.py +26 -0
  32. payi/types/price_modifier_create_params.py +17 -0
  33. payi/types/price_modifier_retrieve_response.py +10 -0
  34. payi/types/price_modifier_update_params.py +17 -0
  35. payi/types/requests_data.py +2 -1
  36. payi/types/shared/__init__.py +0 -1
  37. payi/types/total_cost_data.py +0 -1
  38. {payi-0.1.0a25.dist-info → payi-0.1.0a27.dist-info}/METADATA +5 -1
  39. {payi-0.1.0a25.dist-info → payi-0.1.0a27.dist-info}/RECORD +41 -33
  40. payi/resources/evaluations/__init__.py +0 -47
  41. payi/resources/evaluations/evaluations.py +0 -134
  42. payi/resources/evaluations/requests.py +0 -200
  43. {payi-0.1.0a25.dist-info → payi-0.1.0a27.dist-info}/WHEEL +0 -0
  44. {payi-0.1.0a25.dist-info → payi-0.1.0a27.dist-info}/licenses/LICENSE +0 -0
@@ -1,200 +0,0 @@
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 Optional
6
-
7
- import httpx
8
-
9
- from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
10
- from ..._utils import (
11
- maybe_transform,
12
- async_maybe_transform,
13
- )
14
- from ..._compat import cached_property
15
- from ..._resource import SyncAPIResource, AsyncAPIResource
16
- from ..._response import (
17
- to_raw_response_wrapper,
18
- to_streamed_response_wrapper,
19
- async_to_raw_response_wrapper,
20
- async_to_streamed_response_wrapper,
21
- )
22
- from ..._base_client import make_request_options
23
- from ...types.evaluations import request_create_params
24
- from ...types.shared.evaluation_response import EvaluationResponse
25
-
26
- __all__ = ["RequestsResource", "AsyncRequestsResource"]
27
-
28
-
29
- class RequestsResource(SyncAPIResource):
30
- @cached_property
31
- def with_raw_response(self) -> RequestsResourceWithRawResponse:
32
- """
33
- This property can be used as a prefix for any HTTP method call to return the
34
- the raw response object instead of the parsed content.
35
-
36
- For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
37
- """
38
- return RequestsResourceWithRawResponse(self)
39
-
40
- @cached_property
41
- def with_streaming_response(self) -> RequestsResourceWithStreamingResponse:
42
- """
43
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
44
-
45
- For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
46
- """
47
- return RequestsResourceWithStreamingResponse(self)
48
-
49
- def create(
50
- self,
51
- request_id: str,
52
- *,
53
- evaluation: int,
54
- user_id: Optional[str] | NotGiven = NOT_GIVEN,
55
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
56
- # The extra values given here take precedence over values defined on the client or passed to this method.
57
- extra_headers: Headers | None = None,
58
- extra_query: Query | None = None,
59
- extra_body: Body | None = None,
60
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
61
- ) -> EvaluationResponse:
62
- """
63
- Create an Evaluation for a Request
64
-
65
- Args:
66
- evaluation: The evaluation value
67
-
68
- request_id: The request ID being evaluated
69
-
70
- user_id: The user ID creating the evaluation
71
-
72
- extra_headers: Send extra headers
73
-
74
- extra_query: Add additional query parameters to the request
75
-
76
- extra_body: Add additional JSON properties to the request
77
-
78
- timeout: Override the client-level default timeout for this request, in seconds
79
- """
80
- if not request_id:
81
- raise ValueError(f"Expected a non-empty value for `request_id` but received {request_id!r}")
82
- return self._post(
83
- f"/api/v1/evaluations/requests/{request_id}",
84
- body=maybe_transform(
85
- {
86
- "evaluation": evaluation,
87
- "user_id": user_id,
88
- },
89
- request_create_params.RequestCreateParams,
90
- ),
91
- options=make_request_options(
92
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
93
- ),
94
- cast_to=EvaluationResponse,
95
- )
96
-
97
-
98
- class AsyncRequestsResource(AsyncAPIResource):
99
- @cached_property
100
- def with_raw_response(self) -> AsyncRequestsResourceWithRawResponse:
101
- """
102
- This property can be used as a prefix for any HTTP method call to return the
103
- the raw response object instead of the parsed content.
104
-
105
- For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
106
- """
107
- return AsyncRequestsResourceWithRawResponse(self)
108
-
109
- @cached_property
110
- def with_streaming_response(self) -> AsyncRequestsResourceWithStreamingResponse:
111
- """
112
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
113
-
114
- For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
115
- """
116
- return AsyncRequestsResourceWithStreamingResponse(self)
117
-
118
- async def create(
119
- self,
120
- request_id: str,
121
- *,
122
- evaluation: int,
123
- user_id: Optional[str] | NotGiven = NOT_GIVEN,
124
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
125
- # The extra values given here take precedence over values defined on the client or passed to this method.
126
- extra_headers: Headers | None = None,
127
- extra_query: Query | None = None,
128
- extra_body: Body | None = None,
129
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
130
- ) -> EvaluationResponse:
131
- """
132
- Create an Evaluation for a Request
133
-
134
- Args:
135
- evaluation: The evaluation value
136
-
137
- request_id: The request ID being evaluated
138
-
139
- user_id: The user ID creating the evaluation
140
-
141
- extra_headers: Send extra headers
142
-
143
- extra_query: Add additional query parameters to the request
144
-
145
- extra_body: Add additional JSON properties to the request
146
-
147
- timeout: Override the client-level default timeout for this request, in seconds
148
- """
149
- if not request_id:
150
- raise ValueError(f"Expected a non-empty value for `request_id` but received {request_id!r}")
151
- return await self._post(
152
- f"/api/v1/evaluations/requests/{request_id}",
153
- body=await async_maybe_transform(
154
- {
155
- "evaluation": evaluation,
156
- "user_id": user_id,
157
- },
158
- request_create_params.RequestCreateParams,
159
- ),
160
- options=make_request_options(
161
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
162
- ),
163
- cast_to=EvaluationResponse,
164
- )
165
-
166
-
167
- class RequestsResourceWithRawResponse:
168
- def __init__(self, requests: RequestsResource) -> None:
169
- self._requests = requests
170
-
171
- self.create = to_raw_response_wrapper(
172
- requests.create,
173
- )
174
-
175
-
176
- class AsyncRequestsResourceWithRawResponse:
177
- def __init__(self, requests: AsyncRequestsResource) -> None:
178
- self._requests = requests
179
-
180
- self.create = async_to_raw_response_wrapper(
181
- requests.create,
182
- )
183
-
184
-
185
- class RequestsResourceWithStreamingResponse:
186
- def __init__(self, requests: RequestsResource) -> None:
187
- self._requests = requests
188
-
189
- self.create = to_streamed_response_wrapper(
190
- requests.create,
191
- )
192
-
193
-
194
- class AsyncRequestsResourceWithStreamingResponse:
195
- def __init__(self, requests: AsyncRequestsResource) -> None:
196
- self._requests = requests
197
-
198
- self.create = async_to_streamed_response_wrapper(
199
- requests.create,
200
- )