@@ -459,6 +459,31 @@ def webhooks(self) -> WebhookCollectionClient:
459
459
"""Retrieve a client for webhooks associated with this Actor."""
460
460
return WebhookCollectionClient (** self ._sub_resource_init_options ())
461
461
462
+ def validate_input (
463
+ self , run_input : Any = None , * , build_tag : str | None = None , content_type : str | None = None
464
+ ) -> bool :
465
+ """Validate an input for the Actor that defines an input schema.
466
+
467
+ Args:
468
+ run_input: The input to validate.
469
+ build_tag: The actor's build tag.
470
+ content_type: The content type of the input.
471
+
472
+ Returns:
473
+ True if the input is valid, else raise an exception with validation error details.
474
+ """
475
+ run_input , content_type = encode_key_value_store_record_value (run_input , content_type )
476
+
477
+ self .http_client .call (
478
+ url = self ._url ('validate-input' ),
479
+ method = 'POST' ,
480
+ headers = {'content-type' : content_type },
481
+ data = run_input ,
482
+ params = self ._params (build = build_tag ),
483
+ )
484
+
485
+ return True
486
+
462
487
463
488
class ActorClientAsync (ResourceClientAsync ):
464
489
"""Async sub-client for manipulating a single Actor."""
@@ -829,3 +854,28 @@ def version(self, version_number: str) -> ActorVersionClientAsync:
829
854
def webhooks (self ) -> WebhookCollectionClientAsync :
830
855
"""Retrieve a client for webhooks associated with this Actor."""
831
856
return WebhookCollectionClientAsync (** self ._sub_resource_init_options ())
857
+
858
+ async def validate_input (
859
+ self , run_input : Any = None , * , build_tag : str | None = None , content_type : str | None = None
860
+ ) -> bool :
861
+ """Validate an input for the Actor that defines an input schema.
862
+
863
+ Args:
864
+ run_input: The input to validate.
865
+ build_tag: The actor's build tag.
866
+ content_type: The content type of the input.
867
+
868
+ Returns:
869
+ True if the input is valid, else raise an exception with validation error details.
870
+ """
871
+ run_input , content_type = encode_key_value_store_record_value (run_input , content_type )
872
+
873
+ await self .http_client .call (
874
+ url = self ._url ('validate-input' ),
875
+ method = 'POST' ,
876
+ headers = {'content-type' : content_type },
877
+ data = run_input ,
878
+ params = self ._params (build = build_tag ),
879
+ )
880
+
881
+ return True
0 commit comments