Interceptor

An interceptor allows injecting code into the request execution pipeline of a generated SDK client.

Terminology:

  • execution - one end-to-end invocation against an SDK client

  • attempt - a single attempt at performing an execution, executions may be retired multiple times based on the client's retry strategy.

  • hook - a single method on the interceptor allowing injection of code into a specific part of the execution pipeline. Hooks are either "read-only" hooks, which make it possible to read in-flight request or response messages, or read/write hooks, which make it possible to modify in-flight request or response messages. Read only hooks MUST not modify state even if it is possible to do so (it is not always possible or performant to provide an immutable view of every type).

Functions

Link copied to clipboard
open suspend fun modifyBeforeAttemptCompletion(context: ResponseInterceptorContext<Input, Output, ProtocolRequest, ProtocolResponse?>): <Error class: unknown class><Output>

A hook called when an attempt is completed. This method has the ability to modify and return a new operation output or error.

Link copied to clipboard
open suspend fun modifyBeforeCompletion(context: ResponseInterceptorContext<Input, Output, ProtocolRequest?, ProtocolResponse?>): <Error class: unknown class><Output>

A hook called when an attempt is completed. This method has the ability to modify and return a new operation output or error.

Link copied to clipboard

A hook called before the transport request message is deserialized into the output response type. This method has the ability to modify and return a new transport response.

Link copied to clipboard

A hook called before the retry loop is entered. This method has the ability to modify and return a new transport request.

Link copied to clipboard

A hook called before the input message is marshalled into a (protocol) transport message. This method has the ability to modify and return a new operation request.

Link copied to clipboard

A hook called before the transport request message is signed. This method has the ability to modify and return a new transport request.

Link copied to clipboard

A hook called before the transport request message is sent to the service. This method has the ability to modify and return a new transport request.

Link copied to clipboard

A hook called when an attempt is completed.

Link copied to clipboard

A hook called after the transport request message is deserialized into the output response type.

Link copied to clipboard

A hook called when an attempt is completed.

Link copied to clipboard

A hook called after the input message is marshalled into a (protocol) transport message.

Link copied to clipboard

A hook called after the transport request message is signed.

Link copied to clipboard

A hook called after the transport response message is received from the service.

Link copied to clipboard

A hook called before each attempt at sending the protocol request message to the service.

Link copied to clipboard

A hook called before the transport request message is deserialized into the output response type.

Link copied to clipboard

A hook called at the start of an execution, before the SDK does anything else.

Link copied to clipboard

A hook called before the input message is marshalled into a (protocol) transport message.

Link copied to clipboard

A hook called before the transport request message is signed.

Link copied to clipboard

A hook called before the transport request message is sent to the service.