Marqeta.UserTransitions (marqeta v1.0.0)

Copy Markdown View Source

Manage user state transitions (UNVERIFIED → LIMITED → ACTIVE → SUSPENDED → CLOSED).

Summary

Functions

Creates a new user transition.

Creates a new user transition. Raises Marqeta.Error on failure.

Retrieves a user transition by token.

Retrieves a user transition by token. Raises Marqeta.Error on failure.

Lists user transition resources.

Lists user transition resources. Raises Marqeta.Error on failure.

Lists all state transitions for a user.

Returns a lazy Stream that auto-paginates user transition resources.

Functions

create(params \\ %{}, opts \\ [])

@spec create(
  map(),
  keyword()
) :: {:ok, map()} | {:error, Marqeta.Error.t()}

Creates a new user transition.

Returns {:ok, map()} on success, {:error, %Marqeta.Error{}} on failure.

create!(params \\ %{}, opts \\ [])

@spec create!(
  map(),
  keyword()
) :: map()

Creates a new user transition. Raises Marqeta.Error on failure.

get(token, opts \\ [])

@spec get(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Marqeta.Error.t()}

Retrieves a user transition by token.

Returns {:ok, map()} on success, {:error, %Marqeta.Error{}} on failure.

get!(token, opts \\ [])

@spec get!(
  String.t(),
  keyword()
) :: map()

Retrieves a user transition by token. Raises Marqeta.Error on failure.

list(params \\ %{}, opts \\ [])

@spec list(
  map(),
  keyword()
) :: {:ok, map()} | {:error, Marqeta.Error.t()}

Lists user transition resources.

Accepts standard Marqeta pagination params: count, start_index, sort_by, sort_order, fields.

Use stream/2 to lazily iterate all pages automatically.

list!(params \\ %{}, opts \\ [])

@spec list!(
  map(),
  keyword()
) :: map()

Lists user transition resources. Raises Marqeta.Error on failure.

list_by_user(token, params \\ %{}, opts \\ [])

@spec list_by_user(String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Marqeta.Error.t()}

Lists all state transitions for a user.

stream(params \\ %{}, opts \\ [])

@spec stream(
  map(),
  keyword()
) :: Enumerable.t()

Returns a lazy Stream that auto-paginates user transition resources.