Table of Contents

Class SDKHooks

Namespace
Styra.Opa.OpenApi.Hooks
Assembly
Styra.Opa.dll
public class SDKHooks : IHooks
Inheritance
SDKHooks
Implements
Inherited Members

Constructors

SDKHooks()

public SDKHooks()

Fields

afterErrorHooks

public List<IAfterErrorHook> afterErrorHooks

Field Value

List<IAfterErrorHook>

afterSuccessHooks

public List<IAfterSuccessHook> afterSuccessHooks

Field Value

List<IAfterSuccessHook>

beforeRequestHooks

public List<IBeforeRequestHook> beforeRequestHooks

Field Value

List<IBeforeRequestHook>

sdkInitHooks

public List<ISDKInitHook> sdkInitHooks

Field Value

List<ISDKInitHook>

Methods

AfterErrorAsync(AfterErrorContext, HttpResponseMessage?, Exception?)

public Task<HttpResponseMessage?> AfterErrorAsync(AfterErrorContext hookCtx, HttpResponseMessage? response, Exception? error)

Parameters

hookCtx AfterErrorContext
response HttpResponseMessage
error Exception

Returns

Task<HttpResponseMessage>

AfterSuccessAsync(AfterSuccessContext, HttpResponseMessage)

public Task<HttpResponseMessage> AfterSuccessAsync(AfterSuccessContext hookCtx, HttpResponseMessage response)

Parameters

hookCtx AfterSuccessContext
response HttpResponseMessage

Returns

Task<HttpResponseMessage>

BeforeRequestAsync(BeforeRequestContext, HttpRequestMessage)

public Task<HttpRequestMessage> BeforeRequestAsync(BeforeRequestContext hookCtx, HttpRequestMessage request)

Parameters

hookCtx BeforeRequestContext
request HttpRequestMessage

Returns

Task<HttpRequestMessage>

RegisterAfterErrorHook(IAfterErrorHook)

public void RegisterAfterErrorHook(IAfterErrorHook hook)

Parameters

hook IAfterErrorHook

RegisterAfterSuccessHook(IAfterSuccessHook)

public void RegisterAfterSuccessHook(IAfterSuccessHook hook)

Parameters

hook IAfterSuccessHook

RegisterBeforeRequestHook(IBeforeRequestHook)

public void RegisterBeforeRequestHook(IBeforeRequestHook hook)

Parameters

hook IBeforeRequestHook

RegisterSDKInitHook(ISDKInitHook)

public void RegisterSDKInitHook(ISDKInitHook hook)

Parameters

hook ISDKInitHook

SDKInit(string, ISpeakeasyHttpClient)

public (string, ISpeakeasyHttpClient) SDKInit(string baseUrl, ISpeakeasyHttpClient client)

Parameters

baseUrl string
client ISpeakeasyHttpClient

Returns

(string, ISpeakeasyHttpClient)