payi 0.1.0a122__py3-none-any.whl → 0.1.0a123__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.

@@ -7,7 +7,7 @@ from datetime import datetime
7
7
 
8
8
  import httpx
9
9
 
10
- from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
10
+ from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
11
11
  from ..._utils import maybe_transform, async_maybe_transform
12
12
  from ..._compat import cached_property
13
13
  from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -51,16 +51,16 @@ class ResourcesResource(SyncAPIResource):
51
51
  *,
52
52
  category: str,
53
53
  units: Dict[str, resource_create_params.Units],
54
- max_input_units: Optional[int] | NotGiven = NOT_GIVEN,
55
- max_output_units: Optional[int] | NotGiven = NOT_GIVEN,
56
- max_total_units: Optional[int] | NotGiven = NOT_GIVEN,
57
- start_timestamp: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
54
+ max_input_units: Optional[int] | Omit = omit,
55
+ max_output_units: Optional[int] | Omit = omit,
56
+ max_total_units: Optional[int] | Omit = omit,
57
+ start_timestamp: Union[str, datetime, None] | Omit = omit,
58
58
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
59
59
  # The extra values given here take precedence over values defined on the client or passed to this method.
60
60
  extra_headers: Headers | None = None,
61
61
  extra_query: Query | None = None,
62
62
  extra_body: Body | None = None,
63
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
63
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
64
64
  ) -> CategoryResourceResponse:
65
65
  """
66
66
  Create a Resource
@@ -107,7 +107,7 @@ class ResourcesResource(SyncAPIResource):
107
107
  extra_headers: Headers | None = None,
108
108
  extra_query: Query | None = None,
109
109
  extra_body: Body | None = None,
110
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
110
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
111
111
  ) -> CategoryResourceResponse:
112
112
  """
113
113
  Get a Resource version details
@@ -140,15 +140,15 @@ class ResourcesResource(SyncAPIResource):
140
140
  resource: str,
141
141
  *,
142
142
  category: str,
143
- cursor: str | NotGiven = NOT_GIVEN,
144
- limit: int | NotGiven = NOT_GIVEN,
145
- sort_ascending: bool | NotGiven = NOT_GIVEN,
143
+ cursor: str | Omit = omit,
144
+ limit: int | Omit = omit,
145
+ sort_ascending: bool | Omit = omit,
146
146
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
147
147
  # The extra values given here take precedence over values defined on the client or passed to this method.
148
148
  extra_headers: Headers | None = None,
149
149
  extra_query: Query | None = None,
150
150
  extra_body: Body | None = None,
151
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
151
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
152
152
  ) -> SyncCursorPage[CategoryResourceResponse]:
153
153
  """
154
154
  Get a list of versions of a Resource
@@ -197,7 +197,7 @@ class ResourcesResource(SyncAPIResource):
197
197
  extra_headers: Headers | None = None,
198
198
  extra_query: Query | None = None,
199
199
  extra_body: Body | None = None,
200
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
200
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
201
201
  ) -> CategoryResourceResponse:
202
202
  """
203
203
  Delete a version of the Resource
@@ -252,16 +252,16 @@ class AsyncResourcesResource(AsyncAPIResource):
252
252
  *,
253
253
  category: str,
254
254
  units: Dict[str, resource_create_params.Units],
255
- max_input_units: Optional[int] | NotGiven = NOT_GIVEN,
256
- max_output_units: Optional[int] | NotGiven = NOT_GIVEN,
257
- max_total_units: Optional[int] | NotGiven = NOT_GIVEN,
258
- start_timestamp: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
255
+ max_input_units: Optional[int] | Omit = omit,
256
+ max_output_units: Optional[int] | Omit = omit,
257
+ max_total_units: Optional[int] | Omit = omit,
258
+ start_timestamp: Union[str, datetime, None] | Omit = omit,
259
259
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
260
260
  # The extra values given here take precedence over values defined on the client or passed to this method.
261
261
  extra_headers: Headers | None = None,
262
262
  extra_query: Query | None = None,
263
263
  extra_body: Body | None = None,
264
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
264
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
265
265
  ) -> CategoryResourceResponse:
266
266
  """
267
267
  Create a Resource
@@ -308,7 +308,7 @@ class AsyncResourcesResource(AsyncAPIResource):
308
308
  extra_headers: Headers | None = None,
309
309
  extra_query: Query | None = None,
310
310
  extra_body: Body | None = None,
311
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
311
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
312
312
  ) -> CategoryResourceResponse:
313
313
  """
314
314
  Get a Resource version details
@@ -341,15 +341,15 @@ class AsyncResourcesResource(AsyncAPIResource):
341
341
  resource: str,
342
342
  *,
343
343
  category: str,
344
- cursor: str | NotGiven = NOT_GIVEN,
345
- limit: int | NotGiven = NOT_GIVEN,
346
- sort_ascending: bool | NotGiven = NOT_GIVEN,
344
+ cursor: str | Omit = omit,
345
+ limit: int | Omit = omit,
346
+ sort_ascending: bool | Omit = omit,
347
347
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
348
348
  # The extra values given here take precedence over values defined on the client or passed to this method.
349
349
  extra_headers: Headers | None = None,
350
350
  extra_query: Query | None = None,
351
351
  extra_body: Body | None = None,
352
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
352
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
353
353
  ) -> AsyncPaginator[CategoryResourceResponse, AsyncCursorPage[CategoryResourceResponse]]:
354
354
  """
355
355
  Get a list of versions of a Resource
@@ -398,7 +398,7 @@ class AsyncResourcesResource(AsyncAPIResource):
398
398
  extra_headers: Headers | None = None,
399
399
  extra_query: Query | None = None,
400
400
  extra_body: Body | None = None,
401
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
401
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
402
402
  ) -> CategoryResourceResponse:
403
403
  """
404
404
  Delete a version of the Resource
payi/resources/ingest.py CHANGED
@@ -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 NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
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] | NotGiven = NOT_GIVEN,
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 = NOT_GIVEN,
62
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
63
63
  ) -> BulkIngestResponse:
64
64
  """
65
65
  Bulk Ingest
@@ -87,38 +87,38 @@ class IngestResource(SyncAPIResource):
87
87
  *,
88
88
  category: str,
89
89
  units: Dict[str, IngestUnits],
90
- end_to_end_latency_ms: Optional[int] | NotGiven = NOT_GIVEN,
91
- event_timestamp: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
92
- http_status_code: Optional[int] | NotGiven = NOT_GIVEN,
93
- properties: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
94
- provider_request_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | NotGiven = NOT_GIVEN,
95
- provider_request_json: Optional[str] | NotGiven = NOT_GIVEN,
96
- provider_request_reasoning_json: Optional[str] | NotGiven = NOT_GIVEN,
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, 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
- | NotGiven = NOT_GIVEN,
99
- provider_response_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | NotGiven = NOT_GIVEN,
100
- provider_response_id: Optional[str] | NotGiven = NOT_GIVEN,
101
- provider_response_json: Union[str, SequenceNotStr[str], None] | NotGiven = NOT_GIVEN,
102
- provider_uri: Optional[str] | NotGiven = NOT_GIVEN,
103
- resource: Optional[str] | NotGiven = NOT_GIVEN,
104
- time_to_first_completion_token_ms: Optional[int] | NotGiven = NOT_GIVEN,
105
- time_to_first_token_ms: Optional[int] | NotGiven = NOT_GIVEN,
106
- use_case_properties: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
107
- limit_ids: Optional[list[str]] | NotGiven = NOT_GIVEN,
108
- request_tags: Optional[list[str]] | NotGiven = NOT_GIVEN,
109
- use_case_id: Optional[str] | NotGiven = NOT_GIVEN,
110
- use_case_name: Optional[str] | NotGiven = NOT_GIVEN,
111
- use_case_step: Optional[str] | NotGiven = NOT_GIVEN,
112
- use_case_version: Optional[int] | NotGiven = NOT_GIVEN,
113
- user_id: Optional[str] | NotGiven = NOT_GIVEN,
114
- resource_scope: Optional[str] | NotGiven = NOT_GIVEN,
115
- account_name: Optional[str] | NotGiven = NOT_GIVEN,
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, str]] | Omit = omit,
107
+ limit_ids: Optional[list[str]] | Omit = omit,
108
+ request_tags: Optional[list[str]] | Omit = omit,
109
+ use_case_id: Optional[str] | Omit = omit,
110
+ use_case_name: Optional[str] | Omit = omit,
111
+ use_case_step: Optional[str] | Omit = omit,
112
+ use_case_version: Optional[int] | Omit = omit,
113
+ user_id: Optional[str] | Omit = omit,
114
+ resource_scope: Optional[str] | Omit = omit,
115
+ account_name: Optional[str] | Omit = omit,
116
116
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
117
117
  # The extra values given here take precedence over values defined on the client or passed to this method.
118
118
  extra_headers: Headers | None = None,
119
119
  extra_query: Query | None = None,
120
120
  extra_body: Body | None = None,
121
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
121
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
122
122
  ) -> IngestResponse:
123
123
  """
124
124
  Ingest an Event
@@ -164,62 +164,53 @@ class IngestResource(SyncAPIResource):
164
164
 
165
165
  timeout (Union[float, None], optional): The timeout for the request in seconds. Defaults to None.
166
166
  """
167
- valid_ids_str: str | NotGiven = NOT_GIVEN
168
- _valid_tags_str: str | NotGiven = NOT_GIVEN
169
- use_case_version_str: str | NotGiven = NOT_GIVEN
167
+ request_tags = request_tags
168
+ valid_ids_str: str | Omit = omit
169
+ use_case_version_str: str | Omit = omit
170
170
 
171
- if limit_ids is None or isinstance(limit_ids, NotGiven):
172
- valid_ids_str = NOT_GIVEN
171
+ if limit_ids is None or not is_given(limit_ids):
172
+ valid_ids_str = omit
173
173
  elif not isinstance(limit_ids, list): # type: ignore
174
174
  raise TypeError("limit_ids must be a list")
175
175
  else:
176
- # Proceed with the list comprehension if limit_ids is not NotGiven
176
+ # Proceed with the list comprehension if limit_ids is given
177
177
  valid_ids = [id.strip() for id in limit_ids if id.strip()]
178
- valid_ids_str = ",".join(valid_ids) if valid_ids else NOT_GIVEN
178
+ valid_ids_str = ",".join(valid_ids) if valid_ids else omit
179
179
 
180
- if request_tags is None or isinstance(request_tags, NotGiven):
181
- _valid_tags_str = NOT_GIVEN
182
- elif not isinstance(request_tags, list): # type: ignore
183
- raise TypeError("request_tags must be a list")
184
- else:
185
- # Proceed with the list comprehension if request_tags is not NotGiven
186
- valid_tags = [tag.strip() for tag in request_tags if tag.strip()]
187
- _valid_tags_str = ",".join(valid_tags) if valid_tags else NOT_GIVEN
188
-
189
- if use_case_name is None or isinstance(use_case_name, NotGiven):
190
- use_case_name = NOT_GIVEN
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
180
+ if use_case_name is None or not is_given(use_case_name):
181
+ use_case_name = omit
182
+
183
+ if use_case_step is None or not is_given(use_case_step):
184
+ use_case_step = omit
185
+
186
+ if use_case_id is None or not is_given(use_case_id):
187
+ use_case_id = omit
188
+
189
+ if use_case_version is None or not is_given(use_case_version):
190
+ use_case_version_str = omit
200
191
  else:
201
192
  use_case_version_str = str(use_case_version)
202
193
 
203
- if user_id is None or isinstance(user_id, NotGiven):
204
- user_id = NOT_GIVEN
194
+ if user_id is None or not is_given(user_id):
195
+ user_id = omit
205
196
 
206
- if resource_scope is None or isinstance(resource_scope, NotGiven):
207
- resource_scope = NOT_GIVEN
197
+ if resource_scope is None or not is_given(resource_scope):
198
+ resource_scope = omit
208
199
 
209
- if account_name is None or isinstance(account_name, NotGiven):
210
- account_name = NOT_GIVEN
200
+ if account_name is None or not is_given(account_name):
201
+ account_name = omit
211
202
 
212
203
  extra_headers = {
213
204
  **strip_not_given(
214
205
  {
215
206
  "xProxy-Limit-IDs": valid_ids_str,
216
- "xProxy-Request-Tags": NOT_GIVEN, # _valid_tags_str
207
+ "xProxy-Request-Tags": omit,
217
208
  "xProxy-UseCase-ID": use_case_id,
218
209
  "xProxy-UseCase-Name": use_case_name,
219
210
  "xProxy-UseCase-Step": use_case_step,
220
211
  "xProxy-UseCase-Version": use_case_version_str
221
212
  if is_given(use_case_version)
222
- else NOT_GIVEN,
213
+ else omit,
223
214
  "xProxy-User-ID": user_id,
224
215
  "xProxy-Resource-Scope": resource_scope,
225
216
  "xProxy-Account-Name": account_name,
@@ -283,13 +274,13 @@ class AsyncIngestResource(AsyncAPIResource):
283
274
  async def bulk(
284
275
  self,
285
276
  *,
286
- events: Iterable[IngestEventParam] | NotGiven = NOT_GIVEN,
277
+ events: Iterable[IngestEventParam] | Omit = omit,
287
278
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
288
279
  # The extra values given here take precedence over values defined on the client or passed to this method.
289
280
  extra_headers: Headers | None = None,
290
281
  extra_query: Query | None = None,
291
282
  extra_body: Body | None = None,
292
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
283
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
293
284
  ) -> BulkIngestResponse:
294
285
  """
295
286
  Bulk Ingest
@@ -317,37 +308,37 @@ class AsyncIngestResource(AsyncAPIResource):
317
308
  *,
318
309
  category: str,
319
310
  units: Dict[str, IngestUnits],
320
- end_to_end_latency_ms: Optional[int] | NotGiven = NOT_GIVEN,
321
- event_timestamp: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
322
- http_status_code: Optional[int] | NotGiven = NOT_GIVEN,
323
- properties: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
324
- provider_request_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | NotGiven = NOT_GIVEN,
325
- provider_request_json: Optional[str] | NotGiven = NOT_GIVEN,
326
- provider_request_reasoning_json: Optional[str] | NotGiven = NOT_GIVEN,
311
+ end_to_end_latency_ms: Optional[int] | Omit = omit,
312
+ event_timestamp: Union[str, datetime, None] | Omit = omit,
313
+ http_status_code: Optional[int] | Omit = omit,
314
+ properties: Optional[Dict[str, str]] | Omit = omit,
315
+ provider_request_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | Omit = omit,
316
+ provider_request_json: Optional[str] | Omit = omit,
317
+ provider_request_reasoning_json: Optional[str] | Omit = omit,
327
318
  provider_response_function_calls: Optional[Iterable[ingest_units_params.ProviderResponseFunctionCall]]
328
- | NotGiven = NOT_GIVEN,
329
- provider_response_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | NotGiven = NOT_GIVEN,
330
- provider_response_id: Optional[str] | NotGiven = NOT_GIVEN,
331
- provider_response_json: Union[str, SequenceNotStr[str], None] | NotGiven = NOT_GIVEN,
332
- provider_uri: Optional[str] | NotGiven = NOT_GIVEN,
333
- resource: Optional[str] | NotGiven = NOT_GIVEN,
334
- time_to_first_completion_token_ms: Optional[int] | NotGiven = NOT_GIVEN,
335
- time_to_first_token_ms: Optional[int] | NotGiven = NOT_GIVEN,
336
- use_case_properties: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
337
- limit_ids: Optional[list[str]] | NotGiven = NOT_GIVEN,
338
- request_tags: Optional[list[str]] | NotGiven = NOT_GIVEN,
339
- use_case_id: Optional[str] | NotGiven = NOT_GIVEN,
340
- use_case_name: Optional[str] | NotGiven = NOT_GIVEN,
341
- use_case_step: Optional[str] | NotGiven = NOT_GIVEN,
342
- use_case_version: Optional[int] | NotGiven = NOT_GIVEN,
343
- user_id: Optional[str] | NotGiven = NOT_GIVEN,
344
- resource_scope: Union[str, None] | NotGiven = NOT_GIVEN,
345
- account_name: Optional[str] | NotGiven = NOT_GIVEN,
319
+ | Omit = omit,
320
+ provider_response_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | Omit = omit,
321
+ provider_response_id: Optional[str] | Omit = omit,
322
+ provider_response_json: Union[str, SequenceNotStr[str], None] | Omit = omit,
323
+ provider_uri: Optional[str] | Omit = omit,
324
+ resource: Optional[str] | Omit = omit,
325
+ time_to_first_completion_token_ms: Optional[int] | Omit = omit,
326
+ time_to_first_token_ms: Optional[int] | Omit = omit,
327
+ use_case_properties: Optional[Dict[str, str]] | Omit = omit,
328
+ limit_ids: Optional[list[str]] | Omit = omit,
329
+ request_tags: Optional[list[str]] | Omit = omit,
330
+ use_case_id: Optional[str] | Omit = omit,
331
+ use_case_name: Optional[str] | Omit = omit,
332
+ use_case_step: Optional[str] | Omit = omit,
333
+ use_case_version: Optional[int] | Omit = omit,
334
+ user_id: Optional[str] | Omit = omit,
335
+ resource_scope: Union[str, None] | Omit = omit,
336
+ account_name: Optional[str] | Omit = omit,
346
337
  # The extra values given here take precedence over values defined on the client or passed to this method.
347
338
  extra_headers: Headers | None = None,
348
339
  extra_query: Query | None = None,
349
340
  extra_body: Body | None = None,
350
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
341
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
351
342
  ) -> IngestResponse:
352
343
  """
353
344
  Ingest an Event
@@ -393,63 +384,54 @@ class AsyncIngestResource(AsyncAPIResource):
393
384
 
394
385
  timeout (Union[float, None], optional): The timeout for the request in seconds. Defaults to None.
395
386
  """
396
- valid_ids_str: str | NotGiven = NOT_GIVEN
397
- _valid_tags_str: str | NotGiven = NOT_GIVEN
398
- use_case_version_str: str | NotGiven = NOT_GIVEN
387
+ request_tags = request_tags
388
+ valid_ids_str: str | Omit = omit
389
+ use_case_version_str: str | Omit = omit
399
390
 
400
- if limit_ids is None or isinstance(limit_ids, NotGiven):
401
- valid_ids_str = NOT_GIVEN
391
+ if limit_ids is None or not is_given(limit_ids):
392
+ valid_ids_str = omit
402
393
  elif not isinstance(limit_ids, list): # type: ignore
403
394
  raise TypeError("limit_ids must be a list")
404
395
  else:
405
- # Proceed with the list comprehension if limit_ids is not NotGiven
396
+ # Proceed with the list comprehension if limit_ids is given
406
397
  valid_ids = [id.strip() for id in limit_ids if id.strip()]
407
- valid_ids_str = ",".join(valid_ids) if valid_ids else NOT_GIVEN
398
+ valid_ids_str = ",".join(valid_ids) if valid_ids else omit
408
399
 
409
- if request_tags is None or isinstance(request_tags, NotGiven):
410
- _valid_tags_str = NOT_GIVEN
411
- elif not isinstance(request_tags, list): # type: ignore
412
- raise TypeError("request_tags must be a list")
413
- else:
414
- # Proceed with the list comprehension if request_tags is not NotGiven
415
- valid_tags = [tag.strip() for tag in request_tags if tag.strip()]
416
- _valid_tags_str = ",".join(valid_tags) if valid_tags else NOT_GIVEN
417
-
418
- if use_case_name is None or isinstance(use_case_name, NotGiven):
419
- use_case_name = NOT_GIVEN
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
400
+ if use_case_name is None or not is_given(use_case_name):
401
+ use_case_name = omit
402
+
403
+ if use_case_step is None or not is_given(use_case_step):
404
+ use_case_step = omit
405
+
406
+ if use_case_id is None or not is_given(use_case_id):
407
+ use_case_id = omit
408
+
409
+ if use_case_version is None or not is_given(use_case_version):
410
+ use_case_version_str = omit
429
411
  else:
430
412
  use_case_version_str = str(use_case_version)
431
413
 
432
- if user_id is None or isinstance(user_id, NotGiven):
433
- user_id = NOT_GIVEN
414
+ if user_id is None or not is_given(user_id):
415
+ user_id = omit
434
416
 
435
- if resource_scope is None or isinstance(resource_scope, NotGiven):
436
- resource_scope = NOT_GIVEN
417
+ if resource_scope is None or not is_given(resource_scope):
418
+ resource_scope = omit
437
419
 
438
- if account_name is None or isinstance(account_name, NotGiven):
439
- account_name = NOT_GIVEN
420
+ if account_name is None or not is_given(account_name):
421
+ account_name = omit
440
422
 
441
423
  extra_headers = {
442
424
  **strip_not_given(
443
425
  {
444
426
  "xProxy-Account-Name": account_name,
445
427
  "xProxy-Limit-IDs": valid_ids_str,
446
- "xProxy-Request-Tags": NOT_GIVEN, # _valid_tags_str,
428
+ "xProxy-Request-Tags": omit,
447
429
  "xProxy-UseCase-ID": use_case_id,
448
430
  "xProxy-UseCase-Name": use_case_name,
449
431
  "xProxy-UseCase-Step": use_case_step,
450
432
  "xProxy-UseCase-Version": use_case_version_str
451
433
  if is_given(use_case_version)
452
- else NOT_GIVEN,
434
+ else omit,
453
435
  "xProxy-User-ID": user_id,
454
436
  "xProxy-Resource-Scope": resource_scope,
455
437
  }