Creatio.Batch.Response (creatio v0.3.1)

Copy Markdown

Individual response item inside a batch response.

Summary

Functions

Returns true if the batch response represents a failure (status not in 2xx).

Returns true if the batch response status is in the 2xx range.

Converts a failed batch response item into a %Creatio.Error{}.

Types

t()

@type t() :: %Creatio.Batch.Response{
  atomicity_group: String.t() | nil,
  body: any(),
  headers: map(),
  id: String.t(),
  status: integer()
}

Functions

error?(resp)

@spec error?(t()) :: boolean()

Returns true if the batch response represents a failure (status not in 2xx).

success?(arg1)

@spec success?(t()) :: boolean()

Returns true if the batch response status is in the 2xx range.

to_error(resp)

@spec to_error(t()) :: Creatio.Error.t()

Converts a failed batch response item into a %Creatio.Error{}.