Current section
Files
Jump to
Current section
Files
lib/hook_sniff_api/api/inbound.ex
# NOTE: This file is auto generated by OpenAPI Generator 7.22.0 (https://openapi-generator.tech).
# Do not edit this file manually.
defmodule HookSniffAPI.Api.Inbound do
@moduledoc """
API calls for all endpoints tagged `Inbound`.
"""
alias HookSniffAPI.Connection
import HookSniffAPI.RequestBuilder
@doc """
Receive inbound webhook for a specific endpoint
### Parameters
- `connection` (HookSniffAPI.Connection): Connection to server
- `provider` (String.t):
- `endpoint_id` (String.t):
- `body` (map()):
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, nil}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec inbound_provider_endpoint_id_post(Tesla.Env.client, String.t, String.t, %{optional(String.t) => any()}, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
def inbound_provider_endpoint_id_post(connection, provider, endpoint_id, body, _opts \\ []) do
request =
%{}
|> method(:post)
|> url("/inbound/#{provider}/#{endpoint_id}")
|> add_param(:body, :body, body)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, false}
])
end
@doc """
Receive inbound webhook from a provider
Accepts webhooks from external providers (Stripe, GitHub, etc.) and routes them to the customer's endpoints.
### Parameters
- `connection` (HookSniffAPI.Connection): Connection to server
- `provider` (String.t):
- `body` (map()):
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, nil}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec inbound_provider_post(Tesla.Env.client, String.t, %{optional(String.t) => any()}, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
def inbound_provider_post(connection, provider, body, _opts \\ []) do
request =
%{}
|> method(:post)
|> url("/inbound/#{provider}")
|> add_param(:body, :body, body)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, false},
{400, false}
])
end
end