# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). # https://openapi-generator.tech # Do not edit the class manually. defmodule Ory.Api.Courier do @moduledoc """ API calls for all endpoints tagged `Courier`. """ alias Ory.Connection import Ory.RequestBuilder @doc """ List Messages Lists all messages by given status and recipient. ## Parameters - connection (Ory.Connection): Connection to server - opts (KeywordList): [optional] Optional parameters - :per_page (integer()): Items per Page This is the number of items per page. - :page (integer()): Pagination Page This value is currently an integer, but it is not sequential. The value is not the page number, but a reference. The next page can be any number and some numbers might return an empty list. For example, page 2 might not follow after page 1. And even if page 3 and 5 exist, but page 4 might not exist. - :status (CourierMessageStatus): Status filters out messages based on status. If no value is provided, it doesn't take effect on filter. - :recipient (String.t): Recipient filters out messages based on recipient. If no value is provided, it doesn't take effect on filter. ## Returns {:ok, [%Message{}, ...]} on success {:error, Tesla.Env.t} on failure """ @spec list_courier_messages(Tesla.Env.client, keyword()) :: {:ok, list(Ory.Model.Message.t)} | {:ok, Ory.Model.ErrorGeneric.t} | {:error, Tesla.Env.t} def list_courier_messages(connection, opts \\ []) do optional_params = %{ :per_page => :query, :page => :query, :status => :query, :recipient => :query } %{} |> method(:get) |> url("/admin/courier/messages") |> add_optional_params(optional_params, opts) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> evaluate_response([ { 200, [%Ory.Model.Message{}]}, { 400, %Ory.Model.ErrorGeneric{}}, { :default, %Ory.Model.ErrorGeneric{}} ]) end end