RigInboundGatewayWeb.V1.SubscriptionController (Reactive Interaction Gateway v3.0.0-alpha.2) View Source

Link to this section Summary

Functions

Returns module configuration.

Sets subscriptions for an existing connection, replacing previous subscriptions.

Link to this section Functions

Specs

config() :: any()

Returns module configuration.

If application environment contains values in Keyword or Map struct, defaults from macro usage will be recursively merged with application configuration.

If one of the configuration parameters does not exist or can not be resolved, raises ArgumentError.

Link to this function

set_subscriptions(conn, map)

View Source

Specs

set_subscriptions(conn :: Plug.Conn.t(), params :: map()) :: Plug.Conn.t()

Sets subscriptions for an existing connection, replacing previous subscriptions.

There may be multiple subscriptions contained in the request body. Each subscription refers to a single event type and may optionally include a constraint list (conjunctive normal form). Subscriptions that were present in a previous request but are no longer present in this one will be removed.

Example

Single subscription with a constraint that says "either head_repo equals octocat/Hello-World, or base_repo equals octocat/Hello-World (or both)":

{
  "subscriptions": [
    {
      "eventType": "com.github.pull.create",
      "oneOf": [
        { "head_repo": "octocat/Hello-World" },
        { "base_repo": "octocat/Hello-World" }
      ]
    }
  ]
}