IncidentIo (IncidentIo v0.3.0)
View SourceIncidentIo is an Elixir client for the Incident.io API.
Summary
Functions
Take an existing URI and add addition params, appending and replacing as necessary.
Same as authorization_header/2 but defaults initial headers to include @user_agent.
Use a JWT bearer token to authenticate to the Incident.io API
Types
@type deprecated_incident_mode() :: :real | :test | :tutorial
@type deprecated_incident_modes() :: [:real | :test | :tutorial]
@type incident_mode() :: :standard | :retrospective | :test | :tutorial | :stream
@type incident_modes() :: [:standard | :retrospective | :test | :tutorial | :stream]
@type pagination_response() :: {response(), binary() | nil, IncidentIo.Client.auth()}
@type response() :: {integer(), any(), Req.Response.t()} | pagination_response()
Functions
Take an existing URI and add addition params, appending and replacing as necessary.
Examples
iex> add_params_to_url("http://example.com/wat", [])
"http://example.com/wat"
iex> add_params_to_url("http://example.com/wat", [q: 1])
"http://example.com/wat?q=1"
iex> add_params_to_url("http://example.com/wat", [q: 1, t: 2])
"http://example.com/wat?q=1&t=2"
iex> add_params_to_url("http://example.com/wat", %{q: 1, t: 2})
"http://example.com/wat?q=1&t=2"
iex> add_params_to_url("http://example.com/wat?q=1&t=2", [])
"http://example.com/wat?q=1&t=2"
iex> add_params_to_url("http://example.com/wat?q=1", [t: 2])
"http://example.com/wat?q=1&t=2"
iex> add_params_to_url("http://example.com/wat?q=1", [q: 3, t: 2])
"http://example.com/wat?q=3&t=2"
iex> add_params_to_url("http://example.com/wat?q=1&s=4", [q: 3, t: 2])
"http://example.com/wat?q=3&s=4&t=2"
iex> add_params_to_url("http://example.com/wat?q=1&s=4", [q: 3, t: 2, u: [o: 1, v: 0]])
"http://example.com/wat?q=3&s=4&t=2&u[o]=1&u[v]=0"
iex> add_params_to_url("http://example.com/wat?q=1&s=4", [q: 3, t: 2, u: [1, "two", 3]])
"http://example.com/wat?q=3&s=4&t=2&u[]=1&u[]=two&u[]=3"
iex> add_params_to_url("http://example.com/wat?q=1&s=4", %{q: 3, t: 2})
"http://example.com/wat?q=3&s=4&t=2"
iex> add_params_to_url("http://example.com/wat?q=1&s=4", %{q: 3, t: 2, u: [o: 1, v: 0]})
"http://example.com/wat?q=3&s=4&t=2&u[o]=1&u[v]=0"
iex> add_params_to_url("http://example.com/wat?q=1&s=4", %{q: 3, t: 2, u: [1, "two", 3]})
"http://example.com/wat?q=3&s=4&t=2&u[]=1&u[]=two&u[]=3"
Same as authorization_header/2 but defaults initial headers to include @user_agent.
@spec authorization_header(IncidentIo.Client.auth(), list()) :: list()
Use a JWT bearer token to authenticate to the Incident.io API:
Examples
iex> IncidentIo.authorization_header(%{api_key: "92873971893"}, [])
[{"Authorization", "Bearer 92873971893"}]More info at: https://api-docs.incident.io/#section/Making-requests/Authentication
@spec delete(binary(), IncidentIo.Client.t(), any()) :: response()
@spec get(binary(), IncidentIo.Client.t(), keyword()) :: response()
@spec patch(binary(), IncidentIo.Client.t(), any()) :: response()
@spec post(binary(), IncidentIo.Client.t(), any()) :: response()
@spec process_response(Req.Response.t()) :: response()
@spec put(binary(), IncidentIo.Client.t(), any()) :: response()