cribl-control-plane 0.0.20__py3-none-any.whl → 0.0.21a2__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.21a2"
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.21a2 2.660.0 4.14.0-alpha.1753968519625-08e89eb4 cribl-control-plane"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
@@ -4748,7 +4748,11 @@ if TYPE_CHECKING:
4748
4748
  UpdatePacksByIDResponseTypedDict,
4749
4749
  )
4750
4750
  from .updatepacksop import (
4751
+ UpdatePacksFile,
4752
+ UpdatePacksFileTypedDict,
4751
4753
  UpdatePacksRequest,
4754
+ UpdatePacksRequestBody,
4755
+ UpdatePacksRequestBodyTypedDict,
4752
4756
  UpdatePacksRequestTypedDict,
4753
4757
  UpdatePacksResponse,
4754
4758
  UpdatePacksResponseTypedDict,
@@ -9165,7 +9169,11 @@ __all__ = [
9165
9169
  "UpdatePacksByIDRequestTypedDict",
9166
9170
  "UpdatePacksByIDResponse",
9167
9171
  "UpdatePacksByIDResponseTypedDict",
9172
+ "UpdatePacksFile",
9173
+ "UpdatePacksFileTypedDict",
9168
9174
  "UpdatePacksRequest",
9175
+ "UpdatePacksRequestBody",
9176
+ "UpdatePacksRequestBodyTypedDict",
9169
9177
  "UpdatePacksRequestTypedDict",
9170
9178
  "UpdatePacksResponse",
9171
9179
  "UpdatePacksResponseTypedDict",
@@ -13584,7 +13592,11 @@ _dynamic_imports: dict[str, str] = {
13584
13592
  "UpdatePacksByIDRequestTypedDict": ".updatepacksbyidop",
13585
13593
  "UpdatePacksByIDResponse": ".updatepacksbyidop",
13586
13594
  "UpdatePacksByIDResponseTypedDict": ".updatepacksbyidop",
13595
+ "UpdatePacksFile": ".updatepacksop",
13596
+ "UpdatePacksFileTypedDict": ".updatepacksop",
13587
13597
  "UpdatePacksRequest": ".updatepacksop",
13598
+ "UpdatePacksRequestBody": ".updatepacksop",
13599
+ "UpdatePacksRequestBodyTypedDict": ".updatepacksop",
13588
13600
  "UpdatePacksRequestTypedDict": ".updatepacksop",
13589
13601
  "UpdatePacksResponse": ".updatepacksop",
13590
13602
  "UpdatePacksResponseTypedDict": ".updatepacksop",
@@ -2,23 +2,84 @@
2
2
 
3
3
  from __future__ import annotations
4
4
  from cribl_control_plane.types import BaseModel
5
- from cribl_control_plane.utils import FieldMetadata, QueryParamMetadata
6
- from typing import Any, Dict, List, Optional
5
+ from cribl_control_plane.utils import (
6
+ FieldMetadata,
7
+ MultipartFormMetadata,
8
+ QueryParamMetadata,
9
+ RequestMetadata,
10
+ )
11
+ import io
12
+ import pydantic
13
+ from typing import Any, Dict, IO, List, Optional, Union
7
14
  from typing_extensions import Annotated, NotRequired, TypedDict
8
15
 
9
16
 
17
+ class UpdatePacksFileTypedDict(TypedDict):
18
+ file_name: str
19
+ content: Union[bytes, IO[bytes], io.BufferedReader]
20
+ content_type: NotRequired[str]
21
+
22
+
23
+ class UpdatePacksFile(BaseModel):
24
+ file_name: Annotated[
25
+ str, pydantic.Field(alias="fileName"), FieldMetadata(multipart=True)
26
+ ]
27
+
28
+ content: Annotated[
29
+ Union[bytes, IO[bytes], io.BufferedReader],
30
+ pydantic.Field(alias=""),
31
+ FieldMetadata(multipart=MultipartFormMetadata(content=True)),
32
+ ]
33
+
34
+ content_type: Annotated[
35
+ Optional[str],
36
+ pydantic.Field(alias="Content-Type"),
37
+ FieldMetadata(multipart=True),
38
+ ] = None
39
+
40
+
41
+ class UpdatePacksRequestBodyTypedDict(TypedDict):
42
+ r"""multipart upload of the pack file"""
43
+
44
+ file: UpdatePacksFileTypedDict
45
+ r"""The pack file to upload"""
46
+
47
+
48
+ class UpdatePacksRequestBody(BaseModel):
49
+ r"""multipart upload of the pack file"""
50
+
51
+ file: Annotated[
52
+ UpdatePacksFile, FieldMetadata(multipart=MultipartFormMetadata(file=True))
53
+ ]
54
+ r"""The pack file to upload"""
55
+
56
+
10
57
  class UpdatePacksRequestTypedDict(TypedDict):
11
- filename: NotRequired[str]
58
+ filename: str
12
59
  r"""the file to upload"""
60
+ size: int
61
+ r"""Size of the pack file in bytes"""
62
+ request_body: UpdatePacksRequestBodyTypedDict
63
+ r"""multipart upload of the pack file"""
13
64
 
14
65
 
15
66
  class UpdatePacksRequest(BaseModel):
16
67
  filename: Annotated[
17
- Optional[str],
18
- FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
19
- ] = None
68
+ str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
69
+ ]
20
70
  r"""the file to upload"""
21
71
 
72
+ size: Annotated[
73
+ int, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
74
+ ]
75
+ r"""Size of the pack file in bytes"""
76
+
77
+ request_body: Annotated[
78
+ UpdatePacksRequestBody,
79
+ FieldMetadata(request=RequestMetadata(media_type="multipart/form-data")),
80
+ ]
81
+ r"""multipart upload of the pack file"""
82
+
22
83
 
23
84
  class UpdatePacksResponseTypedDict(TypedDict):
24
85
  r"""a list of any objects"""
@@ -451,7 +451,9 @@ class Packs(BaseSDK):
451
451
  def update_packs(
452
452
  self,
453
453
  *,
454
- filename: Optional[str] = None,
454
+ filename: str,
455
+ size: int,
456
+ file: Union[models.UpdatePacksFile, models.UpdatePacksFileTypedDict],
455
457
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
456
458
  server_url: Optional[str] = None,
457
459
  timeout_ms: Optional[int] = None,
@@ -462,6 +464,8 @@ class Packs(BaseSDK):
462
464
  Upload Pack
463
465
 
464
466
  :param filename: the file to upload
467
+ :param size: Size of the pack file in bytes
468
+ :param file: The pack file to upload
465
469
  :param retries: Override the default retry configuration for this method
466
470
  :param server_url: Override the default server URL for this method
467
471
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -479,6 +483,10 @@ class Packs(BaseSDK):
479
483
 
480
484
  request = models.UpdatePacksRequest(
481
485
  filename=filename,
486
+ size=size,
487
+ request_body=models.UpdatePacksRequestBody(
488
+ file=utils.get_pydantic_model(file, models.UpdatePacksFile),
489
+ ),
482
490
  )
483
491
 
484
492
  req = self._build_request(
@@ -487,13 +495,20 @@ class Packs(BaseSDK):
487
495
  base_url=base_url,
488
496
  url_variables=url_variables,
489
497
  request=request,
490
- request_body_required=False,
498
+ request_body_required=True,
491
499
  request_has_path_params=False,
492
500
  request_has_query_params=True,
493
501
  user_agent_header="user-agent",
494
502
  accept_header_value="application/json",
495
503
  http_headers=http_headers,
496
504
  security=self.sdk_configuration.security,
505
+ get_serialized_body=lambda: utils.serialize_request_body(
506
+ request.request_body,
507
+ False,
508
+ False,
509
+ "multipart",
510
+ models.UpdatePacksRequestBody,
511
+ ),
497
512
  timeout_ms=timeout_ms,
498
513
  )
499
514
 
@@ -538,7 +553,9 @@ class Packs(BaseSDK):
538
553
  async def update_packs_async(
539
554
  self,
540
555
  *,
541
- filename: Optional[str] = None,
556
+ filename: str,
557
+ size: int,
558
+ file: Union[models.UpdatePacksFile, models.UpdatePacksFileTypedDict],
542
559
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
543
560
  server_url: Optional[str] = None,
544
561
  timeout_ms: Optional[int] = None,
@@ -549,6 +566,8 @@ class Packs(BaseSDK):
549
566
  Upload Pack
550
567
 
551
568
  :param filename: the file to upload
569
+ :param size: Size of the pack file in bytes
570
+ :param file: The pack file to upload
552
571
  :param retries: Override the default retry configuration for this method
553
572
  :param server_url: Override the default server URL for this method
554
573
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -566,6 +585,10 @@ class Packs(BaseSDK):
566
585
 
567
586
  request = models.UpdatePacksRequest(
568
587
  filename=filename,
588
+ size=size,
589
+ request_body=models.UpdatePacksRequestBody(
590
+ file=utils.get_pydantic_model(file, models.UpdatePacksFile),
591
+ ),
569
592
  )
570
593
 
571
594
  req = self._build_request_async(
@@ -574,13 +597,20 @@ class Packs(BaseSDK):
574
597
  base_url=base_url,
575
598
  url_variables=url_variables,
576
599
  request=request,
577
- request_body_required=False,
600
+ request_body_required=True,
578
601
  request_has_path_params=False,
579
602
  request_has_query_params=True,
580
603
  user_agent_header="user-agent",
581
604
  accept_header_value="application/json",
582
605
  http_headers=http_headers,
583
606
  security=self.sdk_configuration.security,
607
+ get_serialized_body=lambda: utils.serialize_request_body(
608
+ request.request_body,
609
+ False,
610
+ False,
611
+ "multipart",
612
+ models.UpdatePacksRequestBody,
613
+ ),
584
614
  timeout_ms=timeout_ms,
585
615
  )
586
616
 
@@ -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.21a2
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,39 @@ 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(filename="example.file", size=779474, file={
328
+ "file_name": "example.file",
329
+ "content": open("example.file", "rb"),
330
+ })
331
+
332
+ # Handle response
333
+ print(res)
334
+
335
+ ```
336
+ <!-- End File uploads [file-upload] -->
337
+
304
338
  <!-- Start Retries [retries] -->
305
339
  ## Retries
306
340
 
@@ -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=JhVQal2YcNAqga4bHbJcNV5I-_-wWUMmDykvzwR6Ev8,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
@@ -20,7 +20,7 @@ cribl_control_plane/groups_sdk.py,sha256=9tFiyKLd65XO-eTsLs74bUqE3g_0CJYeJ--vK-H
20
20
  cribl_control_plane/health.py,sha256=nK_Q4lDXi8zkfAqcIv9X4zBGi8BzomaBQWBD7TsSwLk,6743
21
21
  cribl_control_plane/httpclient.py,sha256=Eu73urOAiZQtdUIyOUnPccxCiBbWEKrXG-JrRG3SLM4,3946
22
22
  cribl_control_plane/lake.py,sha256=dHWnoO4KKOO8fncrdOqnc2sN4nGAWc6nX4UdNP4kx40,46484
23
- cribl_control_plane/models/__init__.py,sha256=2pUh9ZsWJQst_D0X5TOslvdnn91HiuBqY8hfu1AVNwI,577721
23
+ cribl_control_plane/models/__init__.py,sha256=OCkOOnwz2j0N06eU1Euked1cuKNw0zVhn_Nqze67go8,578173
24
24
  cribl_control_plane/models/addhectokenrequest.py,sha256=mzQLKrMWlwxNheqEs5SM_yrT-gyenfCWgHKhmb5oXFQ,800
25
25
  cribl_control_plane/models/appmode.py,sha256=5xRJz9oP5ah4b6dcay4Q1IbQ9irm6k6x2BrTNysIMY4,300
26
26
  cribl_control_plane/models/authtoken.py,sha256=uW0aIs8j14CQzFM2ueY5GIWFulna91cigBWQ3oPlDgY,295
@@ -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=oH7fcrk4uBTiD0bXJFvavUTonH0G0c63GRPg7CCLlgI,2669
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=Q6JnsLchHLbDb7lPDfS2AzGzrXqb-9QQ-uBOyHkeqUo,40014
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.21a2.dist-info/METADATA,sha256=BX5vxlOINc69mlWSWeqdyQtOuN6YOTwBsye88qtOMSI,32093
298
+ cribl_control_plane-0.0.21a2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
299
+ cribl_control_plane-0.0.21a2.dist-info/RECORD,,