Skip to main content

UnmarshalAutomationSpec

Deserializes stored automation spec bytes.

def UnmarshalAutomationSpec(
specBytes: []byte,
automationType: string
) - > *taskpb.TriggerAutomationSpec, error

Deserializes stored automation spec bytes. This function is used to reconstruct a TriggerAutomationSpec object from its byte representation, optionally setting its type based on a provided string.

Parameters

NameTypeDescription
specBytes[]byteThe byte slice containing the serialized automation specification data.
automationTypestringAn optional string representing the type of automation. If provided and valid, it will set the Type field of the TriggerAutomationSpec.

Returns

TypeDescription
*taskpb.TriggerAutomationSpec, errorThe deserialized TriggerAutomationSpec object and an error if unmarshaling fails.