Duffel.AirlineInitiatedChanges (Duffel v0.1.0)

Copy Markdown View Source

Handle changes that airlines make to existing orders (e.g. schedule changes), accepting them or recording the action taken.

See the Duffel documentation.

Summary

Functions

Accepts an airline-initiated change.

Lists one page of airline-initiated changes.

Lazily streams all airline-initiated changes across pages.

Records the action taken on an airline-initiated change when it can't be accepted through Duffel.

Functions

accept(client, id)

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

Accepts an airline-initiated change.

list(client, params \\ [])

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

Lists one page of airline-initiated changes.

Parameters

  • :order_id - filter by order
  • :limit / :after / :before - pagination (see Duffel.Page)

stream(client, params \\ [])

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

Lazily streams all airline-initiated changes across pages.

Takes the same parameters as list/2. Raises Duffel.Error if a page request fails.

update(client, id, params)

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

Records the action taken on an airline-initiated change when it can't be accepted through Duffel.

Examples

Duffel.AirlineInitiatedChanges.update(client, "aic_123", %{action_taken: "accepted"})