cribl-control-plane 0.0.20__py3-none-any.whl → 0.0.21a1__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 cribl-control-plane might be problematic. Click here for more details.

@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "cribl-control-plane"
6
- __version__: str = "0.0.20"
6
+ __version__: str = "0.0.21a1"
7
7
  __openapi_doc_version__: str = "4.14.0-alpha.1753968519625-08e89eb4"
8
8
  __gen_version__: str = "2.660.0"
9
- __user_agent__: str = "speakeasy-sdk/python 0.0.20 2.660.0 4.14.0-alpha.1753968519625-08e89eb4 cribl-control-plane"
9
+ __user_agent__: str = "speakeasy-sdk/python 0.0.21a1 2.660.0 4.14.0-alpha.1753968519625-08e89eb4 cribl-control-plane"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
@@ -3,16 +3,31 @@
3
3
  from __future__ import annotations
4
4
  from cribl_control_plane.types import BaseModel
5
5
  from cribl_control_plane.utils import FieldMetadata, QueryParamMetadata
6
- from typing import Any, Dict, List, Optional
6
+ import io
7
+ from typing import Any, Dict, IO, List, Optional, Union
7
8
  from typing_extensions import Annotated, NotRequired, TypedDict
8
9
 
9
10
 
10
11
  class UpdatePacksRequestTypedDict(TypedDict):
12
+ size: int
13
+ r"""Size of the pack file in bytes"""
14
+ request_body: Union[bytes, IO[bytes], io.BufferedReader]
15
+ r"""file data"""
11
16
  filename: NotRequired[str]
12
17
  r"""the file to upload"""
13
18
 
14
19
 
15
20
  class UpdatePacksRequest(BaseModel):
21
+ size: Annotated[
22
+ int, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
23
+ ]
24
+ r"""Size of the pack file in bytes"""
25
+
26
+ request_body: Annotated[
27
+ Union[bytes, IO[bytes], io.BufferedReader], FieldMetadata(request=True)
28
+ ]
29
+ r"""file data"""
30
+
16
31
  filename: Annotated[
17
32
  Optional[str],
18
33
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
@@ -6,7 +6,8 @@ from cribl_control_plane._hooks import HookContext
6
6
  from cribl_control_plane.types import OptionalNullable, UNSET
7
7
  from cribl_control_plane.utils import get_security_from_env
8
8
  from cribl_control_plane.utils.unmarshal_json_response import unmarshal_json_response
9
- from typing import Any, List, Mapping, Optional, Union
9
+ import io
10
+ from typing import Any, IO, List, Mapping, Optional, Union
10
11
 
11
12
 
12
13
  class Packs(BaseSDK):
@@ -451,6 +452,8 @@ class Packs(BaseSDK):
451
452
  def update_packs(
452
453
  self,
453
454
  *,
455
+ size: int,
456
+ request_body: Union[bytes, IO[bytes], io.BufferedReader],
454
457
  filename: Optional[str] = None,
455
458
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
456
459
  server_url: Optional[str] = None,
@@ -461,6 +464,8 @@ class Packs(BaseSDK):
461
464
 
462
465
  Upload Pack
463
466
 
467
+ :param size: Size of the pack file in bytes
468
+ :param request_body: file data
464
469
  :param filename: the file to upload
465
470
  :param retries: Override the default retry configuration for this method
466
471
  :param server_url: Override the default server URL for this method
@@ -479,6 +484,8 @@ class Packs(BaseSDK):
479
484
 
480
485
  request = models.UpdatePacksRequest(
481
486
  filename=filename,
487
+ size=size,
488
+ request_body=request_body,
482
489
  )
483
490
 
484
491
  req = self._build_request(
@@ -487,13 +494,20 @@ class Packs(BaseSDK):
487
494
  base_url=base_url,
488
495
  url_variables=url_variables,
489
496
  request=request,
490
- request_body_required=False,
497
+ request_body_required=True,
491
498
  request_has_path_params=False,
492
499
  request_has_query_params=True,
493
500
  user_agent_header="user-agent",
494
501
  accept_header_value="application/json",
495
502
  http_headers=http_headers,
496
503
  security=self.sdk_configuration.security,
504
+ get_serialized_body=lambda: utils.serialize_request_body(
505
+ request.request_body,
506
+ False,
507
+ False,
508
+ "raw",
509
+ Union[bytes, IO[bytes], io.BufferedReader],
510
+ ),
497
511
  timeout_ms=timeout_ms,
498
512
  )
499
513
 
@@ -538,6 +552,8 @@ class Packs(BaseSDK):
538
552
  async def update_packs_async(
539
553
  self,
540
554
  *,
555
+ size: int,
556
+ request_body: Union[bytes, IO[bytes], io.BufferedReader],
541
557
  filename: Optional[str] = None,
542
558
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
543
559
  server_url: Optional[str] = None,
@@ -548,6 +564,8 @@ class Packs(BaseSDK):
548
564
 
549
565
  Upload Pack
550
566
 
567
+ :param size: Size of the pack file in bytes
568
+ :param request_body: file data
551
569
  :param filename: the file to upload
552
570
  :param retries: Override the default retry configuration for this method
553
571
  :param server_url: Override the default server URL for this method
@@ -566,6 +584,8 @@ class Packs(BaseSDK):
566
584
 
567
585
  request = models.UpdatePacksRequest(
568
586
  filename=filename,
587
+ size=size,
588
+ request_body=request_body,
569
589
  )
570
590
 
571
591
  req = self._build_request_async(
@@ -574,13 +594,20 @@ class Packs(BaseSDK):
574
594
  base_url=base_url,
575
595
  url_variables=url_variables,
576
596
  request=request,
577
- request_body_required=False,
597
+ request_body_required=True,
578
598
  request_has_path_params=False,
579
599
  request_has_query_params=True,
580
600
  user_agent_header="user-agent",
581
601
  accept_header_value="application/json",
582
602
  http_headers=http_headers,
583
603
  security=self.sdk_configuration.security,
604
+ get_serialized_body=lambda: utils.serialize_request_body(
605
+ request.request_body,
606
+ False,
607
+ False,
608
+ "raw",
609
+ Union[bytes, IO[bytes], io.BufferedReader],
610
+ ),
584
611
  timeout_ms=timeout_ms,
585
612
  )
586
613
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: cribl-control-plane
3
- Version: 0.0.20
3
+ Version: 0.0.21a1
4
4
  Summary: Python Client SDK Generated by Speakeasy.
5
5
  Author: Speakeasy
6
6
  Requires-Python: >=3.9.2
@@ -31,6 +31,7 @@ Cribl API Reference: This API Reference lists available REST endpoints, along wi
31
31
  * [SDK Example Usage](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#sdk-example-usage)
32
32
  * [Authentication](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#authentication)
33
33
  * [Available Resources and Operations](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#available-resources-and-operations)
34
+ * [File uploads](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#file-uploads)
34
35
  * [Retries](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#retries)
35
36
  * [Error Handling](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#error-handling)
36
37
  * [Custom HTTP Client](https://github.com/criblio/cribl_control_plane_sdk_python/blob/master/#custom-http-client)
@@ -301,6 +302,36 @@ with CriblControlPlane(
301
302
  </details>
302
303
  <!-- End Available Resources and Operations [operations] -->
303
304
 
305
+ <!-- Start File uploads [file-upload] -->
306
+ ## File uploads
307
+
308
+ Certain SDK methods accept file objects as part of a request body or multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.
309
+
310
+ > [!TIP]
311
+ >
312
+ > For endpoints that handle file uploads bytes arrays can also be used. However, using streams is recommended for large files.
313
+ >
314
+
315
+ ```python
316
+ from cribl_control_plane import CriblControlPlane, models
317
+ import os
318
+
319
+
320
+ with CriblControlPlane(
321
+ server_url="https://api.example.com",
322
+ security=models.Security(
323
+ bearer_auth=os.getenv("CRIBLCONTROLPLANE_BEARER_AUTH", ""),
324
+ ),
325
+ ) as ccp_client:
326
+
327
+ res = ccp_client.packs.update_packs(size=779474, request_body=open("example.file", "rb"))
328
+
329
+ # Handle response
330
+ print(res)
331
+
332
+ ```
333
+ <!-- End File uploads [file-upload] -->
334
+
304
335
  <!-- Start Retries [retries] -->
305
336
  ## Retries
306
337
 
@@ -4,7 +4,7 @@ cribl_control_plane/_hooks/clientcredentials.py,sha256=gVQkktlv3q4-AHOdbQl5r8i-G
4
4
  cribl_control_plane/_hooks/registration.py,sha256=1QZB41w6If7I9dXiOSQx6dhSc6BPWrnI5Q5bMOr4iVA,624
5
5
  cribl_control_plane/_hooks/sdkhooks.py,sha256=ggXjME1_Rdv8CVCg1XHqB83eYtbxzKyhXyfQ36Yc1gA,2816
6
6
  cribl_control_plane/_hooks/types.py,sha256=Tw_C4zTZm01rW_89VDEUpvQ8KQr1WxN0Gu_-s_fYSPc,2998
7
- cribl_control_plane/_version.py,sha256=Q27DsOHKatjShDpWRUePYtYGh13HXvh4Zmgeqj_PehQ,542
7
+ cribl_control_plane/_version.py,sha256=ZnqjqZBFBwWWPOslk2weR_VRAOHrHngTOGA1eeRqZmw,546
8
8
  cribl_control_plane/auth_sdk.py,sha256=Jxw8hPHbBFay5eXcaRBtgdCC06mh5XHkRbZcIM0vvB8,7431
9
9
  cribl_control_plane/basesdk.py,sha256=amvvB5iPT7c-L6NLo2Rhu2f7xWaapsa6OfQ37SICXOw,11954
10
10
  cribl_control_plane/destinations.py,sha256=9L_VzqiAh8xAN4JNBsU7FT7ZFRiBuhtf-5mJBCbZj-g,65733
@@ -260,12 +260,12 @@ cribl_control_plane/models/updateinputbyidop.py,sha256=DtufjoD9UEPnKT2QOggfMDB1P
260
260
  cribl_control_plane/models/updateinputhectokenbyidandtokenop.py,sha256=-Q8ZP1yDmQmB9aylQNTs4zR1q6NH-Gi2fhlyiDyqWKI,1677
261
261
  cribl_control_plane/models/updateoutputbyidop.py,sha256=odGoTLgvR_AEYizuVMKjcDeB4Uua3BX_U-7OHw7wHiU,1333
262
262
  cribl_control_plane/models/updatepacksbyidop.py,sha256=nQeRQF-NTOCRMWz_gXfYlN0-I2OMM8Rovh_vAq73wzw,1965
263
- cribl_control_plane/models/updatepacksop.py,sha256=jXP_MUAh4cf9u7vo_cJ_zS7Ssv0kd-ZfCCe4yG3b3Zo,1073
263
+ cribl_control_plane/models/updatepacksop.py,sha256=G5UhEf4aAXRQVTH8ZogiuTo3QpcrDfYbdqG7-i9QWUk,1520
264
264
  cribl_control_plane/models/updatepipelinebyidop.py,sha256=CPCiszliWVcewMyZ26_R8OvtbJA8RwrEj_XQFoZTSJg,1420
265
265
  cribl_control_plane/models/updateroutesbyidop.py,sha256=k6vejvOHHqyfp1oR3aDXEXYIUu6NeRHBl7s9k-jcyiE,1440
266
266
  cribl_control_plane/models/updateworkersrestartop.py,sha256=OwX1snIrUTfghc0Pb2PpI5IO6NS-aL0BOMzWqLl8GAA,787
267
267
  cribl_control_plane/models/useraccesscontrollist.py,sha256=UNM3mdqFByd9GAovAi26z9y-5H15hrKDzw0M-f-Pn2o,483
268
- cribl_control_plane/packs.py,sha256=pIW3stXJ7gdJHkYDJ7LF-_I23g3v5E02iNWOnD1tTs8,38830
268
+ cribl_control_plane/packs.py,sha256=syPegLRmrD9ERdPv4w8IamWqcZGhoTudXVtL1BPQHgI,39822
269
269
  cribl_control_plane/pipelines.py,sha256=L-HbP4gyl05hxb4-HNvkFrk1w6xFccfNr4-AJy3Vjxo,36038
270
270
  cribl_control_plane/py.typed,sha256=zrp19r0G21lr2yRiMC0f8MFkQFGj9wMpSbboePMg8KM,59
271
271
  cribl_control_plane/routes_sdk.py,sha256=bxL7KZKdw4Ot78Q3V4Ea5SWrhnEM0fHdRUwQRDeF0Oc,31227
@@ -294,6 +294,6 @@ cribl_control_plane/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8N
294
294
  cribl_control_plane/utils/values.py,sha256=CcaCXEa3xHhkUDROyXZocN8f0bdITftv9Y0P9lTf0YM,3517
295
295
  cribl_control_plane/versioning.py,sha256=-bUutXEf__ewPHzgZshBImZZyQILigzXp1H8ZBCFBbQ,93847
296
296
  cribl_control_plane/workers_sdk.py,sha256=qEt_s-Zfg8zyzWEHnOtqYzTiNzFSwEalG-1lSYzVJWc,22666
297
- cribl_control_plane-0.0.20.dist-info/METADATA,sha256=EHKSg18sYK5Chum-o7NUU6b1ObL0ORJbbjvvUOxdSyY,30841
298
- cribl_control_plane-0.0.20.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
299
- cribl_control_plane-0.0.20.dist-info/RECORD,,
297
+ cribl_control_plane-0.0.21a1.dist-info/METADATA,sha256=xDWVKkC0ywSAGo0f1RE4b4kfNMMRPCGiJXRcSPKgJsw,32011
298
+ cribl_control_plane-0.0.21a1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
299
+ cribl_control_plane-0.0.21a1.dist-info/RECORD,,