A function that mutate the passed in middleware stack. Functions implementing this interface can add, remove, modify existing middleware stack from clients or commands
Add middleware to the stack to be executed during the "initialize" step, optionally specifying a priority, tags and name
Add middleware to the stack to be executed during the "serialize" step, optionally specifying a priority, tags and name
Add middleware to the stack to be executed during the "build" step, optionally specifying a priority, tags and name
Add middleware to the stack to be executed during the "finalizeRequest" step, optionally specifying a priority, tags and name
Add middleware to the stack to be executed during the "deserialize" step, optionally specifying a priority, tags and name
Add middleware to a stack position before or after a known middleware,optionally specifying name and tags.
Create a shallow clone of this stack. Step bindings and handler priorities and tags are preserved in the copy.
Create a stack containing the middlewares in this stack as well as the
middlewares in the from
stack. Neither source is modified, and step
bindings and handler priorities and tags are preserved in the copy.
Returns a list of the current order of middleware in the stack. This does not execute the middleware functions, nor does it provide a reference to the stack itself.
Removes middleware from the stack.
If a string is provided, it will be treated as middleware name. If a middleware is inserted with the given name, it will be removed.
If a middleware class is provided, all usages thereof will be removed.
Removes middleware that contains given tag
Multiple middleware will potentially be removed
Builds a single handler function from zero or more middleware classes and a core handler. The core handler is meant to send command objects to AWS services and return promises that will resolve with the operation result or be rejected with an error.
When a composed handler is invoked, the arguments will pass through all middleware in a defined order, and the return from the innermost handler will pass through all middleware in the reverse of that order.
Apply a customization function to mutate the middleware stack, often used for customizations that requires mutating multiple middleware.
A stack storing middleware. It can be resolved into a handler. It supports 2 approaches for adding middleware:
add()
. The order of middleware added into same step is determined by order of adding them. If one middleware needs to be executed at the front of the step or at the end of step, setpriority
options tohigh
orlow
.addRelativeTo()
. This is useful when given middleware must be executed before or after specific middleware(toMiddleware
). You can add a middleware relatively to another middleware which also added relatively. But eventually, this relative middleware chain must be 'anchored' by a middleware that added usingadd()
API with absolutestep
andpriority
. This mothod will throw if specifiedtoMiddleware
is not found.