payi 0.1.0a107__py3-none-any.whl → 0.1.0a137__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.
- payi/__init__.py +3 -1
- payi/_base_client.py +12 -12
- payi/_client.py +8 -8
- payi/_compat.py +48 -48
- payi/_models.py +87 -59
- payi/_qs.py +7 -7
- payi/_streaming.py +4 -6
- payi/_types.py +53 -12
- payi/_utils/__init__.py +9 -2
- payi/_utils/_compat.py +45 -0
- payi/_utils/_datetime_parse.py +136 -0
- payi/_utils/_sync.py +3 -31
- payi/_utils/_transform.py +13 -3
- payi/_utils/_typing.py +6 -1
- payi/_utils/_utils.py +5 -6
- payi/_version.py +1 -1
- payi/lib/AnthropicInstrumentor.py +83 -57
- payi/lib/BedrockInstrumentor.py +292 -57
- payi/lib/GoogleGenAiInstrumentor.py +18 -31
- payi/lib/OpenAIInstrumentor.py +56 -72
- payi/lib/ProviderRequest.py +216 -0
- payi/lib/StreamWrappers.py +379 -0
- payi/lib/VertexInstrumentor.py +18 -37
- payi/lib/VertexRequest.py +16 -2
- payi/lib/data/cohere_embed_english_v3.json +30706 -0
- payi/lib/helpers.py +62 -5
- payi/lib/instrument.py +433 -659
- payi/resources/categories/__init__.py +0 -14
- payi/resources/categories/categories.py +25 -53
- payi/resources/categories/resources.py +27 -23
- payi/resources/ingest.py +126 -132
- payi/resources/limits/__init__.py +14 -14
- payi/resources/limits/limits.py +58 -58
- payi/resources/limits/properties.py +171 -0
- payi/resources/requests/request_id/properties.py +8 -8
- payi/resources/requests/request_id/result.py +3 -3
- payi/resources/requests/response_id/properties.py +8 -8
- payi/resources/requests/response_id/result.py +3 -3
- payi/resources/use_cases/definitions/definitions.py +27 -27
- payi/resources/use_cases/definitions/kpis.py +23 -23
- payi/resources/use_cases/definitions/limit_config.py +14 -14
- payi/resources/use_cases/definitions/version.py +3 -3
- payi/resources/use_cases/kpis.py +15 -15
- payi/resources/use_cases/properties.py +6 -6
- payi/resources/use_cases/use_cases.py +7 -7
- payi/types/__init__.py +2 -0
- payi/types/bulk_ingest_response.py +3 -20
- payi/types/categories/__init__.py +0 -1
- payi/types/categories/resource_list_params.py +5 -1
- payi/types/category_list_resources_params.py +5 -1
- payi/types/category_resource_response.py +31 -1
- payi/types/ingest_event_param.py +7 -6
- payi/types/ingest_units_params.py +5 -4
- payi/types/limit_create_params.py +3 -3
- payi/types/limit_list_response.py +1 -3
- payi/types/limit_response.py +1 -3
- payi/types/limits/__init__.py +2 -9
- payi/types/limits/{tag_remove_params.py → property_update_params.py} +4 -5
- payi/types/limits/{tag_delete_response.py → property_update_response.py} +3 -3
- payi/types/requests/request_id/property_update_params.py +2 -2
- payi/types/requests/response_id/property_update_params.py +2 -2
- payi/types/shared/__init__.py +2 -0
- payi/types/shared/api_error.py +18 -0
- payi/types/shared/pay_i_common_models_budget_management_create_limit_base.py +3 -3
- payi/types/shared/properties_request.py +11 -0
- payi/types/shared/xproxy_result.py +2 -0
- payi/types/shared_params/pay_i_common_models_budget_management_create_limit_base.py +3 -3
- payi/types/use_cases/definitions/limit_config_create_params.py +3 -3
- payi/types/use_cases/property_update_params.py +2 -2
- {payi-0.1.0a107.dist-info → payi-0.1.0a137.dist-info}/METADATA +6 -6
- {payi-0.1.0a107.dist-info → payi-0.1.0a137.dist-info}/RECORD +73 -75
- payi/resources/categories/fixed_cost_resources.py +0 -196
- payi/resources/limits/tags.py +0 -507
- payi/types/categories/fixed_cost_resource_create_params.py +0 -21
- payi/types/limits/limit_tags.py +0 -16
- payi/types/limits/tag_create_params.py +0 -13
- payi/types/limits/tag_create_response.py +0 -10
- payi/types/limits/tag_list_response.py +0 -10
- payi/types/limits/tag_remove_response.py +0 -10
- payi/types/limits/tag_update_params.py +0 -13
- payi/types/limits/tag_update_response.py +0 -10
- {payi-0.1.0a107.dist-info → payi-0.1.0a137.dist-info}/WHEEL +0 -0
- {payi-0.1.0a107.dist-info → payi-0.1.0a137.dist-info}/licenses/LICENSE +0 -0
payi/resources/ingest.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict,
|
|
5
|
+
from typing import Dict, Union, Iterable, Optional
|
|
6
6
|
from datetime import datetime
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
@@ -10,7 +10,7 @@ import httpx
|
|
|
10
10
|
from payi._utils._utils import is_given
|
|
11
11
|
|
|
12
12
|
from ..types import ingest_units_params
|
|
13
|
-
from .._types import
|
|
13
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
|
|
14
14
|
from .._utils import maybe_transform, strip_not_given, async_maybe_transform
|
|
15
15
|
from .._compat import cached_property
|
|
16
16
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -53,13 +53,13 @@ class IngestResource(SyncAPIResource):
|
|
|
53
53
|
def bulk(
|
|
54
54
|
self,
|
|
55
55
|
*,
|
|
56
|
-
events: Iterable[IngestEventParam] |
|
|
56
|
+
events: Iterable[IngestEventParam] | Omit = omit,
|
|
57
57
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
58
58
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
59
59
|
extra_headers: Headers | None = None,
|
|
60
60
|
extra_query: Query | None = None,
|
|
61
61
|
extra_body: Body | None = None,
|
|
62
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
62
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
63
63
|
) -> BulkIngestResponse:
|
|
64
64
|
"""
|
|
65
65
|
Bulk Ingest
|
|
@@ -87,38 +87,39 @@ class IngestResource(SyncAPIResource):
|
|
|
87
87
|
*,
|
|
88
88
|
category: str,
|
|
89
89
|
units: Dict[str, IngestUnits],
|
|
90
|
-
end_to_end_latency_ms: Optional[int] |
|
|
91
|
-
event_timestamp: Union[str, datetime, None] |
|
|
92
|
-
http_status_code: Optional[int] |
|
|
93
|
-
properties: Optional[Dict[str, str]] |
|
|
94
|
-
provider_request_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] |
|
|
95
|
-
provider_request_json: Optional[str] |
|
|
96
|
-
provider_request_reasoning_json: Optional[str] |
|
|
90
|
+
end_to_end_latency_ms: Optional[int] | Omit = omit,
|
|
91
|
+
event_timestamp: Union[str, datetime, None] | Omit = omit,
|
|
92
|
+
http_status_code: Optional[int] | Omit = omit,
|
|
93
|
+
properties: Optional[Dict[str, Optional[str]]] | Omit = omit,
|
|
94
|
+
provider_request_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | Omit = omit,
|
|
95
|
+
provider_request_json: Optional[str] | Omit = omit,
|
|
96
|
+
provider_request_reasoning_json: Optional[str] | Omit = omit,
|
|
97
97
|
provider_response_function_calls: Optional[Iterable[ingest_units_params.ProviderResponseFunctionCall]]
|
|
98
|
-
|
|
|
99
|
-
provider_response_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] |
|
|
100
|
-
provider_response_id: Optional[str] |
|
|
101
|
-
provider_response_json: Union[str,
|
|
102
|
-
provider_uri: Optional[str] |
|
|
103
|
-
resource: Optional[str] |
|
|
104
|
-
time_to_first_completion_token_ms: Optional[int] |
|
|
105
|
-
time_to_first_token_ms: Optional[int] |
|
|
106
|
-
use_case_properties: Optional[Dict[str, str]] |
|
|
107
|
-
limit_ids: Optional[list[str]] |
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
98
|
+
| Omit = omit,
|
|
99
|
+
provider_response_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | Omit = omit,
|
|
100
|
+
provider_response_id: Optional[str] | Omit = omit,
|
|
101
|
+
provider_response_json: Union[str, SequenceNotStr[str], None] | Omit = omit,
|
|
102
|
+
provider_uri: Optional[str] | Omit = omit,
|
|
103
|
+
resource: Optional[str] | Omit = omit,
|
|
104
|
+
time_to_first_completion_token_ms: Optional[int] | Omit = omit,
|
|
105
|
+
time_to_first_token_ms: Optional[int] | Omit = omit,
|
|
106
|
+
use_case_properties: Optional[Dict[str, Optional[str]]] | Omit = omit,
|
|
107
|
+
limit_ids: Optional[list[str]] | Omit = omit,
|
|
108
|
+
disable_logging: Optional[bool] | Omit = omit,
|
|
109
|
+
request_tags: Optional[list[str]] | Omit = omit,
|
|
110
|
+
use_case_id: Optional[str] | Omit = omit,
|
|
111
|
+
use_case_name: Optional[str] | Omit = omit,
|
|
112
|
+
use_case_step: Optional[str] | Omit = omit,
|
|
113
|
+
use_case_version: Optional[int] | Omit = omit,
|
|
114
|
+
user_id: Optional[str] | Omit = omit,
|
|
115
|
+
resource_scope: Optional[str] | Omit = omit,
|
|
116
|
+
account_name: Optional[str] | Omit = omit,
|
|
116
117
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
117
118
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
118
119
|
extra_headers: Headers | None = None,
|
|
119
120
|
extra_query: Query | None = None,
|
|
120
121
|
extra_body: Body | None = None,
|
|
121
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
122
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
122
123
|
) -> IngestResponse:
|
|
123
124
|
"""
|
|
124
125
|
Ingest an Event
|
|
@@ -134,9 +135,11 @@ class IngestResource(SyncAPIResource):
|
|
|
134
135
|
|
|
135
136
|
event_timestamp: (str, datetime, None): The timestamp of the event
|
|
136
137
|
|
|
138
|
+
disable_logging (bool, optional): Disable logging for the request
|
|
139
|
+
|
|
137
140
|
limit_ids (list[str], optional): The limit IDs to associate with the request
|
|
138
141
|
|
|
139
|
-
properties (Dict[str, str], optional): Properties to associate with the request
|
|
142
|
+
properties (Dict[str, Optional[str]], optional): Properties to associate with the request
|
|
140
143
|
|
|
141
144
|
request_tags (list[str], optional): The request tags to associate with the request
|
|
142
145
|
|
|
@@ -148,7 +151,7 @@ class IngestResource(SyncAPIResource):
|
|
|
148
151
|
|
|
149
152
|
use_case_version (int, optional): The use case instance version
|
|
150
153
|
|
|
151
|
-
use_case_properties (Dict[str, str], optional): The use case properties
|
|
154
|
+
use_case_properties (Dict[str, Optional[str]], optional): The use case properties
|
|
152
155
|
|
|
153
156
|
user_id (str, optional): The user id
|
|
154
157
|
|
|
@@ -164,65 +167,59 @@ class IngestResource(SyncAPIResource):
|
|
|
164
167
|
|
|
165
168
|
timeout (Union[float, None], optional): The timeout for the request in seconds. Defaults to None.
|
|
166
169
|
"""
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
use_case_version_str: str |
|
|
170
|
+
request_tags = request_tags
|
|
171
|
+
valid_ids_str: str | Omit = omit
|
|
172
|
+
use_case_version_str: str | Omit = omit
|
|
170
173
|
|
|
171
|
-
if limit_ids is None or
|
|
172
|
-
valid_ids_str =
|
|
174
|
+
if limit_ids is None or not is_given(limit_ids):
|
|
175
|
+
valid_ids_str = omit
|
|
173
176
|
elif not isinstance(limit_ids, list): # type: ignore
|
|
174
177
|
raise TypeError("limit_ids must be a list")
|
|
175
178
|
else:
|
|
176
|
-
# Proceed with the list comprehension if limit_ids is
|
|
179
|
+
# Proceed with the list comprehension if limit_ids is given
|
|
177
180
|
valid_ids = [id.strip() for id in limit_ids if id.strip()]
|
|
178
|
-
valid_ids_str = ",".join(valid_ids) if valid_ids else
|
|
181
|
+
valid_ids_str = ",".join(valid_ids) if valid_ids else omit
|
|
179
182
|
|
|
180
|
-
if
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
if
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
if use_case_step is None or isinstance(use_case_step, NotGiven):
|
|
193
|
-
use_case_step = NOT_GIVEN
|
|
194
|
-
|
|
195
|
-
if use_case_id is None or isinstance(use_case_id, NotGiven):
|
|
196
|
-
use_case_id = NOT_GIVEN
|
|
197
|
-
|
|
198
|
-
if use_case_version is None or isinstance(use_case_version, NotGiven):
|
|
199
|
-
use_case_version_str = NOT_GIVEN
|
|
183
|
+
if use_case_name is None or not is_given(use_case_name):
|
|
184
|
+
use_case_name = omit
|
|
185
|
+
|
|
186
|
+
if use_case_step is None or not is_given(use_case_step):
|
|
187
|
+
use_case_step = omit
|
|
188
|
+
|
|
189
|
+
if use_case_id is None or not is_given(use_case_id):
|
|
190
|
+
use_case_id = omit
|
|
191
|
+
|
|
192
|
+
if use_case_version is None or not is_given(use_case_version):
|
|
193
|
+
use_case_version_str = omit
|
|
200
194
|
else:
|
|
201
195
|
use_case_version_str = str(use_case_version)
|
|
202
196
|
|
|
203
|
-
if user_id is None or
|
|
204
|
-
user_id =
|
|
197
|
+
if user_id is None or not is_given(user_id):
|
|
198
|
+
user_id = omit
|
|
205
199
|
|
|
206
|
-
if resource_scope is None or
|
|
207
|
-
resource_scope =
|
|
200
|
+
if resource_scope is None or not is_given(resource_scope):
|
|
201
|
+
resource_scope = omit
|
|
208
202
|
|
|
209
|
-
if account_name is None or
|
|
210
|
-
account_name =
|
|
203
|
+
if account_name is None or not is_given(account_name):
|
|
204
|
+
account_name = omit
|
|
211
205
|
|
|
212
206
|
extra_headers = {
|
|
213
207
|
**strip_not_given(
|
|
214
208
|
{
|
|
215
209
|
"xProxy-Limit-IDs": valid_ids_str,
|
|
216
|
-
"xProxy-Request-Tags":
|
|
210
|
+
"xProxy-Request-Tags": omit,
|
|
217
211
|
"xProxy-UseCase-ID": use_case_id,
|
|
218
212
|
"xProxy-UseCase-Name": use_case_name,
|
|
219
213
|
"xProxy-UseCase-Step": use_case_step,
|
|
220
214
|
"xProxy-UseCase-Version": use_case_version_str
|
|
221
215
|
if is_given(use_case_version)
|
|
222
|
-
else
|
|
216
|
+
else not_given,
|
|
223
217
|
"xProxy-User-ID": user_id,
|
|
224
218
|
"xProxy-Resource-Scope": resource_scope,
|
|
225
219
|
"xProxy-Account-Name": account_name,
|
|
220
|
+
"xProxy-Logging-Disable": str(disable_logging)
|
|
221
|
+
if is_given(disable_logging)
|
|
222
|
+
else not_given,
|
|
226
223
|
}
|
|
227
224
|
),
|
|
228
225
|
**(extra_headers or {}),
|
|
@@ -283,13 +280,13 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
283
280
|
async def bulk(
|
|
284
281
|
self,
|
|
285
282
|
*,
|
|
286
|
-
events: Iterable[IngestEventParam] |
|
|
283
|
+
events: Iterable[IngestEventParam] | Omit = omit,
|
|
287
284
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
288
285
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
289
286
|
extra_headers: Headers | None = None,
|
|
290
287
|
extra_query: Query | None = None,
|
|
291
288
|
extra_body: Body | None = None,
|
|
292
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
289
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
293
290
|
) -> BulkIngestResponse:
|
|
294
291
|
"""
|
|
295
292
|
Bulk Ingest
|
|
@@ -317,37 +314,38 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
317
314
|
*,
|
|
318
315
|
category: str,
|
|
319
316
|
units: Dict[str, IngestUnits],
|
|
320
|
-
end_to_end_latency_ms: Optional[int] |
|
|
321
|
-
event_timestamp: Union[str, datetime, None] |
|
|
322
|
-
http_status_code: Optional[int] |
|
|
323
|
-
properties: Optional[Dict[str, str]] |
|
|
324
|
-
provider_request_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] |
|
|
325
|
-
provider_request_json: Optional[str] |
|
|
326
|
-
provider_request_reasoning_json: Optional[str] |
|
|
317
|
+
end_to_end_latency_ms: Optional[int] | Omit = omit,
|
|
318
|
+
event_timestamp: Union[str, datetime, None] | Omit = omit,
|
|
319
|
+
http_status_code: Optional[int] | Omit = omit,
|
|
320
|
+
properties: Optional[Dict[str, Optional[str]]] | Omit = omit,
|
|
321
|
+
provider_request_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | Omit = omit,
|
|
322
|
+
provider_request_json: Optional[str] | Omit = omit,
|
|
323
|
+
provider_request_reasoning_json: Optional[str] | Omit = omit,
|
|
327
324
|
provider_response_function_calls: Optional[Iterable[ingest_units_params.ProviderResponseFunctionCall]]
|
|
328
|
-
|
|
|
329
|
-
provider_response_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] |
|
|
330
|
-
provider_response_id: Optional[str] |
|
|
331
|
-
provider_response_json: Union[str,
|
|
332
|
-
provider_uri: Optional[str] |
|
|
333
|
-
resource: Optional[str] |
|
|
334
|
-
time_to_first_completion_token_ms: Optional[int] |
|
|
335
|
-
time_to_first_token_ms: Optional[int] |
|
|
336
|
-
use_case_properties: Optional[Dict[str, str]] |
|
|
337
|
-
limit_ids: Optional[list[str]] |
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
325
|
+
| Omit = omit,
|
|
326
|
+
provider_response_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | Omit = omit,
|
|
327
|
+
provider_response_id: Optional[str] | Omit = omit,
|
|
328
|
+
provider_response_json: Union[str, SequenceNotStr[str], None] | Omit = omit,
|
|
329
|
+
provider_uri: Optional[str] | Omit = omit,
|
|
330
|
+
resource: Optional[str] | Omit = omit,
|
|
331
|
+
time_to_first_completion_token_ms: Optional[int] | Omit = omit,
|
|
332
|
+
time_to_first_token_ms: Optional[int] | Omit = omit,
|
|
333
|
+
use_case_properties: Optional[Dict[str, Optional[str]]] | Omit = omit,
|
|
334
|
+
limit_ids: Optional[list[str]] | Omit = omit,
|
|
335
|
+
disable_logging: Optional[bool] | Omit = omit,
|
|
336
|
+
request_tags: Optional[list[str]] | Omit = omit,
|
|
337
|
+
use_case_id: Optional[str] | Omit = omit,
|
|
338
|
+
use_case_name: Optional[str] | Omit = omit,
|
|
339
|
+
use_case_step: Optional[str] | Omit = omit,
|
|
340
|
+
use_case_version: Optional[int] | Omit = omit,
|
|
341
|
+
user_id: Optional[str] | Omit = omit,
|
|
342
|
+
resource_scope: Union[str, None] | Omit = omit,
|
|
343
|
+
account_name: Optional[str] | Omit = omit,
|
|
346
344
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
347
345
|
extra_headers: Headers | None = None,
|
|
348
346
|
extra_query: Query | None = None,
|
|
349
347
|
extra_body: Body | None = None,
|
|
350
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
348
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
351
349
|
) -> IngestResponse:
|
|
352
350
|
"""
|
|
353
351
|
Ingest an Event
|
|
@@ -363,9 +361,11 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
363
361
|
|
|
364
362
|
event_timestamp: (datetime, None): The timestamp of the event
|
|
365
363
|
|
|
364
|
+
disable_logging: (bool, optional): Disable logging for the request
|
|
365
|
+
|
|
366
366
|
limit_ids (list[str], optional): The limit IDs to associate with the request
|
|
367
367
|
|
|
368
|
-
properties (Dict[str, str], optional): Properties to associate with the request
|
|
368
|
+
properties (Dict[str, Optional[str]], optional): Properties to associate with the request
|
|
369
369
|
|
|
370
370
|
request_tags (list[str], optional): The request tags to associate with the request
|
|
371
371
|
|
|
@@ -377,7 +377,7 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
377
377
|
|
|
378
378
|
use_case_version (int, optional): The use case instance version
|
|
379
379
|
|
|
380
|
-
use_case_properties (Dict[str, str], optional): The use case properties
|
|
380
|
+
use_case_properties (Dict[str, Optional[str]], optional): The use case properties
|
|
381
381
|
|
|
382
382
|
user_id (str, optional): The user id
|
|
383
383
|
|
|
@@ -393,65 +393,59 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
393
393
|
|
|
394
394
|
timeout (Union[float, None], optional): The timeout for the request in seconds. Defaults to None.
|
|
395
395
|
"""
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
use_case_version_str: str |
|
|
396
|
+
request_tags = request_tags
|
|
397
|
+
valid_ids_str: str | Omit = omit
|
|
398
|
+
use_case_version_str: str | Omit = omit
|
|
399
399
|
|
|
400
|
-
if limit_ids is None or
|
|
401
|
-
valid_ids_str =
|
|
400
|
+
if limit_ids is None or not is_given(limit_ids):
|
|
401
|
+
valid_ids_str = omit
|
|
402
402
|
elif not isinstance(limit_ids, list): # type: ignore
|
|
403
403
|
raise TypeError("limit_ids must be a list")
|
|
404
404
|
else:
|
|
405
|
-
# Proceed with the list comprehension if limit_ids is
|
|
405
|
+
# Proceed with the list comprehension if limit_ids is given
|
|
406
406
|
valid_ids = [id.strip() for id in limit_ids if id.strip()]
|
|
407
|
-
valid_ids_str = ",".join(valid_ids) if valid_ids else
|
|
407
|
+
valid_ids_str = ",".join(valid_ids) if valid_ids else omit
|
|
408
408
|
|
|
409
|
-
if
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
if
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
if use_case_step is None or isinstance(use_case_step, NotGiven):
|
|
422
|
-
use_case_step = NOT_GIVEN
|
|
423
|
-
|
|
424
|
-
if use_case_id is None or isinstance(use_case_id, NotGiven):
|
|
425
|
-
use_case_id = NOT_GIVEN
|
|
426
|
-
|
|
427
|
-
if use_case_version is None or isinstance(use_case_version, NotGiven):
|
|
428
|
-
use_case_version_str = NOT_GIVEN
|
|
409
|
+
if use_case_name is None or not is_given(use_case_name):
|
|
410
|
+
use_case_name = omit
|
|
411
|
+
|
|
412
|
+
if use_case_step is None or not is_given(use_case_step):
|
|
413
|
+
use_case_step = omit
|
|
414
|
+
|
|
415
|
+
if use_case_id is None or not is_given(use_case_id):
|
|
416
|
+
use_case_id = omit
|
|
417
|
+
|
|
418
|
+
if use_case_version is None or not is_given(use_case_version):
|
|
419
|
+
use_case_version_str = omit
|
|
429
420
|
else:
|
|
430
421
|
use_case_version_str = str(use_case_version)
|
|
431
422
|
|
|
432
|
-
if user_id is None or
|
|
433
|
-
user_id =
|
|
423
|
+
if user_id is None or not is_given(user_id):
|
|
424
|
+
user_id = omit
|
|
434
425
|
|
|
435
|
-
if resource_scope is None or
|
|
436
|
-
resource_scope =
|
|
426
|
+
if resource_scope is None or not is_given(resource_scope):
|
|
427
|
+
resource_scope = omit
|
|
437
428
|
|
|
438
|
-
if account_name is None or
|
|
439
|
-
account_name =
|
|
429
|
+
if account_name is None or not is_given(account_name):
|
|
430
|
+
account_name = omit
|
|
440
431
|
|
|
441
432
|
extra_headers = {
|
|
442
433
|
**strip_not_given(
|
|
443
434
|
{
|
|
444
435
|
"xProxy-Account-Name": account_name,
|
|
445
436
|
"xProxy-Limit-IDs": valid_ids_str,
|
|
446
|
-
"xProxy-Request-Tags":
|
|
437
|
+
"xProxy-Request-Tags": omit,
|
|
447
438
|
"xProxy-UseCase-ID": use_case_id,
|
|
448
439
|
"xProxy-UseCase-Name": use_case_name,
|
|
449
440
|
"xProxy-UseCase-Step": use_case_step,
|
|
450
441
|
"xProxy-UseCase-Version": use_case_version_str
|
|
451
442
|
if is_given(use_case_version)
|
|
452
|
-
else
|
|
443
|
+
else not_given,
|
|
453
444
|
"xProxy-User-ID": user_id,
|
|
454
445
|
"xProxy-Resource-Scope": resource_scope,
|
|
446
|
+
"xProxy-Logging-Disable": str(disable_logging)
|
|
447
|
+
if is_given(disable_logging)
|
|
448
|
+
else not_given,
|
|
455
449
|
}
|
|
456
450
|
),
|
|
457
451
|
**(extra_headers or {}),
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
from .tags import (
|
|
4
|
-
TagsResource,
|
|
5
|
-
AsyncTagsResource,
|
|
6
|
-
TagsResourceWithRawResponse,
|
|
7
|
-
AsyncTagsResourceWithRawResponse,
|
|
8
|
-
TagsResourceWithStreamingResponse,
|
|
9
|
-
AsyncTagsResourceWithStreamingResponse,
|
|
10
|
-
)
|
|
11
3
|
from .limits import (
|
|
12
4
|
LimitsResource,
|
|
13
5
|
AsyncLimitsResource,
|
|
@@ -16,14 +8,22 @@ from .limits import (
|
|
|
16
8
|
LimitsResourceWithStreamingResponse,
|
|
17
9
|
AsyncLimitsResourceWithStreamingResponse,
|
|
18
10
|
)
|
|
11
|
+
from .properties import (
|
|
12
|
+
PropertiesResource,
|
|
13
|
+
AsyncPropertiesResource,
|
|
14
|
+
PropertiesResourceWithRawResponse,
|
|
15
|
+
AsyncPropertiesResourceWithRawResponse,
|
|
16
|
+
PropertiesResourceWithStreamingResponse,
|
|
17
|
+
AsyncPropertiesResourceWithStreamingResponse,
|
|
18
|
+
)
|
|
19
19
|
|
|
20
20
|
__all__ = [
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
21
|
+
"PropertiesResource",
|
|
22
|
+
"AsyncPropertiesResource",
|
|
23
|
+
"PropertiesResourceWithRawResponse",
|
|
24
|
+
"AsyncPropertiesResourceWithRawResponse",
|
|
25
|
+
"PropertiesResourceWithStreamingResponse",
|
|
26
|
+
"AsyncPropertiesResourceWithStreamingResponse",
|
|
27
27
|
"LimitsResource",
|
|
28
28
|
"AsyncLimitsResource",
|
|
29
29
|
"LimitsResourceWithRawResponse",
|