You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @hint Calls the Lambda function specified by the default ARN, passing in the payload. You must set the default ARN in order to use this.
* @payload Can be passed in as JSON, an array, or a struct. Structs and arrays will be converted to JSON, as required by Lambda
*/
publicstringfunctioninvoke(anypayload= {}) {
if (!len(variables.defaultArn))
throw(
message ='Default Lambda ARN missing',
detail ='Unable to call #getFunctionCalledName()#() without a default Lambda ARN. You can set the default ARN on init() or manually, via setDefaultArn().'
* @hint The payload returned from a Lambda function invocation in the Java SDK is always a Java binary stream. As such, it needs to be decoded into a string of characters.
* @response must be the object returned by the Lambda object's invoke() method
if (isStruct(payload) || isArray(payload)) returnserializeJSON(payload);
else if (isJSON(payload)) returnpayload;
elsereturn'';
}
/**
* @hint Parses an Amazon Resource Name (ARN) and returns its component parts as an object.
* This follows the general format of ARNs outlined by Amazon (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html), but does not fully account for all possible formats
* Derived from https://gist.github.com/gene1wood/5299969edc4ef21d8efcfea52158dd40