Skip to main content
Version: 1.0

generateInputPayloadForPipeline()

Generates an input payload for the pipeline based on the dictionary’s key-value pairs.

Declaration

func generateInputPayloadForPipeline() async throws -> Data

Return Value

The generated input payload as Data.

Discussion

This method iterates through the dictionary’s key-value pairs and constructs a payload that can be used as input for the pipeline. If the value is a URL, it uploads the data and includes the remote URL in the payload. If the value is a string, it includes the string directly in the payload. Other types are not supported and will result in an error.

Note

PipelineError.typeNotRecognizedWhileCreatingACombinedInput if an unsupported value type is encountered. FileUploadError if an error occurs during file upload. PipelineError.inputEncodingError if an error occurs during JSON encoding.