LogpointApi.Data.HttpNotification (logpoint_api v2.2.0)

Copy Markdown View Source

Builder for HTTP notification structs.

Wraps the HTTP Notification for Alert Rules API. Start with LogpointApi.http_notification/3 and pipe through the builder functions to configure the request and auth. Supports no_auth/1, api_token_auth/3, basic_auth/3, and bearer_auth/2.

Summary

Types

t()

@type t() :: %LogpointApi.Data.HttpNotification{
  auth: map(),
  dispatch_option: String.t() | nil,
  http_body: String.t() | nil,
  http_format_query: String.t() | nil,
  http_protocol: String.t() | nil,
  http_querystring: String.t() | nil,
  http_request_type: String.t(),
  http_url: String.t(),
  ids: [String.t()],
  notify_http: boolean() | nil,
  threshold_option: String.t() | nil,
  threshold_value: number() | nil
}

Functions

api_token_auth(notif, key, value)

basic_auth(notif, username, password)

bearer_auth(notif, token)

body(notif, body)

dispatch_option(notif, option)

format_query(notif, format)

new(ids, url, request_type)

no_auth(notif)

notify_http(notif, enabled)

protocol(notif, protocol)

querystring(notif, qs)

threshold(notif, option, value)

to_map(notif)

Convert an HttpNotification struct into the flat map format expected by the Logpoint API.

validate(notif)

@spec validate(t()) :: :ok | {:error, [String.t()]}