Class WebhookDefinitionBuilder

Namespace
Cratis.Chronicle.Webhooks
Assembly
Cratis.Chronicle.dll

Represents an implementation of IWebhookDefinitionBuilder.

public class WebhookDefinitionBuilder : IWebhookDefinitionBuilder
Inheritance
WebhookDefinitionBuilder
Implements
Inherited Members
Extension Methods

Constructors

WebhookDefinitionBuilder(IEventTypes)

Represents an implementation of IWebhookDefinitionBuilder.

public WebhookDefinitionBuilder(IEventTypes eventTypes)

Parameters

eventTypes IEventTypes

The IEventTypes.

Methods

Build(WebhookId, WebhookTargetUrl)

Builds the WebhookDefinition.

public WebhookDefinition Build(WebhookId id, WebhookTargetUrl targetUrl)

Parameters

id WebhookId

The WebhookId.

targetUrl WebhookTargetUrl

The WebhookTargetUrl.

Returns

WebhookDefinition

The built WebhookDefinition.

NotActive()

Specifies that the webhook is not active.

public IWebhookDefinitionBuilder NotActive()

Returns

IWebhookDefinitionBuilder

The IWebhookDefinitionBuilder builder for continuation.

NotReplayable()

Specifies that the webhook is not replayable.

public IWebhookDefinitionBuilder NotReplayable()

Returns

IWebhookDefinitionBuilder

The IWebhookDefinitionBuilder builder for continuation.

OnEventSequence(EventSequenceId)

Sets the EventSequenceId that the webhook observer should be registered on.

public IWebhookDefinitionBuilder OnEventSequence(EventSequenceId eventSequenceId)

Parameters

eventSequenceId EventSequenceId

The EventSequenceId.

Returns

IWebhookDefinitionBuilder

The IWebhookDefinitionBuilder builder for continuation.

WithBasicAuth(string, string)

Use basic authentication.

public IWebhookDefinitionBuilder WithBasicAuth(string username, string password)

Parameters

username string

The username.

password string

The password.

Returns

IWebhookDefinitionBuilder

The IWebhookDefinitionBuilder builder for continuation.

WithBearerToken(string)

Use bearer token authentication.

public IWebhookDefinitionBuilder WithBearerToken(string token)

Parameters

token string

The bearer token.

Returns

IWebhookDefinitionBuilder

The IWebhookDefinitionBuilder builder for continuation.

WithEventType<TEventType>()

Adds an event type to the webhook observer.

public IWebhookDefinitionBuilder WithEventType<TEventType>()

Returns

IWebhookDefinitionBuilder

The IWebhookDefinitionBuilder builder for continuation.

Type Parameters

TEventType

The Type of the event type.

WithGenerationDelivery(EventGenerationDelivery)

Sets the generation delivery policy. Compatibility is the default.

public IWebhookDefinitionBuilder WithGenerationDelivery(EventGenerationDelivery generationDelivery)

Parameters

generationDelivery EventGenerationDelivery

The generation delivery policy.

Returns

IWebhookDefinitionBuilder

The builder for continuation.

Exceptions

WebhookGenerationDeliveryNotSupported

The builder does not support pinned delivery.

WithHeader(string, string)

Adds a header to the webhook requests.

public IWebhookDefinitionBuilder WithHeader(string key, string value)

Parameters

key string

The header key.

value string

The header value.

Returns

IWebhookDefinitionBuilder

The IWebhookDefinitionBuilder builder for continuation.

WithOAuth(string, string, string, string)

Uses OAuth client credentials, optionally requesting a scope.

public IWebhookDefinitionBuilder WithOAuth(string authority, string clientId, string clientSecret, string scope = "")

Parameters

authority string

The authority.

clientId string

The client identifier.

clientSecret string

The client secret.

scope string

The optional scope.

Returns

IWebhookDefinitionBuilder

The builder continuation.

Exceptions

NotSupportedException

The builder does not support scoped OAuth configuration.