OpenPayments.Types.AccessQuote (open_payments_elixir v1.0.0)

Copy Markdown View Source

Quote permissions in a grant's access-item union.

Required type is quote; required actions is an array of unique strings from create, read and read-all. Empty actions are allowed by the pinned schema. Action order is preserved. The enclosing access-item union forbids fields other than type and actions, including identifier, limits and extension metadata.

This type describes permissions without obtaining a grant or issuing a quote. Struct literals can bypass validation. Call validate/1 after constructing or modifying a struct; to_map/1 converts its shape without validating it.

Summary

Functions

Decodes a quote grant access entry using the union's field rules.

Converts to protocol fields without validating.

Validates a quote access struct against the grant access contract.

Types

t()

@type t() :: %OpenPayments.Types.AccessQuote{actions: [String.t()], type: String.t()}

Functions

from_map(data)

@spec from_map(map()) :: {:ok, t()} | {:error, OpenPayments.Error.t()}

Decodes a quote grant access entry using the union's field rules.

to_map(access)

@spec to_map(t()) :: map()

Converts to protocol fields without validating.

validate(access)

@spec validate(t()) :: :ok | {:error, OpenPayments.Error.t()}

Validates a quote access struct against the grant access contract.