Monzo.FeedItems (monzo_client v1.0.0)

Copy Markdown View Source

The Feed Items resource: posting items to a user's Monzo feed.

Summary

Functions

Creates a new dismissible feed item on the user's feed. Currently only the :basic type (image + title + optional body) is supported by Monzo.

Types

basic_params()

@type basic_params() :: %{
  :title => String.t(),
  :image_url => String.t(),
  optional(:body) => String.t(),
  optional(:background_color) => String.t(),
  optional(:title_color) => String.t(),
  optional(:body_color) => String.t()
}

create_params()

@type create_params() :: %{
  :account_id => String.t(),
  :type => :basic,
  :params => basic_params(),
  optional(:url) => String.t()
}

Functions

create(client, params)

@spec create(Monzo.Client.t(), create_params()) :: :ok | {:error, Exception.t()}

Creates a new dismissible feed item on the user's feed. Currently only the :basic type (image + title + optional body) is supported by Monzo.

Monzo.FeedItems.create(client, %{
  account_id: account_id,
  type: :basic,
  params: %{title: "Order shipped!", image_url: "https://example.com/icon.png"}
})