Moov.Images (Moov v1.0.0)

Copy Markdown View Source

Upload and manage an account's image library (used for product catalog and line-item visuals). Up to 16 MB, PNG/JPG/WebP, no duplicates.

See https://docs.moov.io/api/tools/images/.

Summary

Functions

Gets metadata for a single image.

Lists image metadata for an account.

Replaces the binary content of an existing image.

Updates an image's metadata (e.g. its display name).

Functions

delete(client, account_id, image_id)

@spec delete(Moov.Client.t(), String.t(), String.t()) ::
  {:ok, term()} | {:error, Moov.Error.t()}

Deletes an image.

get(client, account_id, image_id)

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

Gets metadata for a single image.

list(client, account_id, opts \\ [])

@spec list(Moov.Client.t(), String.t(), keyword()) ::
  {:ok, [map()]} | {:error, Moov.Error.t()}

Lists image metadata for an account.

replace(client, account_id, image_id, file_binary, opts)

@spec replace(Moov.Client.t(), String.t(), String.t(), binary(), keyword()) ::
  {:ok, map()} | {:error, Moov.Error.t()}

Replaces the binary content of an existing image.

update_metadata(client, account_id, image_id, params)

@spec update_metadata(Moov.Client.t(), String.t(), String.t(), map()) ::
  {:ok, map()} | {:error, Moov.Error.t()}

Updates an image's metadata (e.g. its display name).

upload(client, account_id, file_binary, opts)

@spec upload(Moov.Client.t(), String.t(), binary(), keyword()) ::
  {:ok, map()} | {:error, Moov.Error.t()}

Uploads an image.

Moov.Images.upload(client, account_id, File.read!("logo.png"),
  filename: "logo.png",
  content_type: "image/png"
)