Class InvocationParametersFactory
InvocationParameters from a raw query string parameter map.
Centralises all raw-map access so that adding new invocation parameters in the
future requires changes only to this class and InvocationParameters.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic InvocationParametersbuild(com.amazonaws.services.lambda.runtime.events.APIGatewayV2HTTPEvent event) Builds anInvocationParametersfrom an incoming Lambda HTTP event.static InvocationParametersBuilds anInvocationParametersfrom the given query string parameter map.
-
Constructor Details
-
InvocationParametersFactory
public InvocationParametersFactory()
-
-
Method Details
-
build
public static InvocationParameters build(com.amazonaws.services.lambda.runtime.events.APIGatewayV2HTTPEvent event) Builds anInvocationParametersfrom an incoming Lambda HTTP event.Parameters may be supplied either as GET query string parameters or as a
application/x-www-form-urlencodedPOST body, allowing callers with larger scripts to avoid URL length limits by sending the script as a POST parameter instead. When a parameter is present in both the query string and the body, the body value takes precedence.- Parameters:
event- The incoming API Gateway V2 HTTP event.- Returns:
- A new
InvocationParameterswith the extracted values.
-
build
Builds anInvocationParametersfrom the given query string parameter map.A
scriptvalue that is present but blank is treated as absent. Asimulationvalue is split on commas and trimmed to produce a list of scenario names; an absent or blank value produces an empty list. Areplicatesvalue is parsed as a positive integer; if absent or blank it defaults to 1, and if non-integer it is stored as 0 (the handler treats any value less than 1 as invalid and returns 400).- Parameters:
params- The query string parameter map, ornullif none were provided.- Returns:
- A new
InvocationParameterswith the extracted values.
-