View Source Zendesk.Client.Streamable (zendesk v0.0.3)
Handle streamable (i.e., paginated) responses from the API.
Link to this section Summary
Functions
Produce a Stream
for a given Zendesk.Client.Operation
.
Link to this section Types
@type t() :: %Zendesk.Client.Streamable{ closed: boolean(), cursor: String.t(), operation: Zendesk.Client.Operation.t() }
Link to this section Functions
@spec stream!(Zendesk.Client.Operation.t()) :: Enumerable.t()
Produce a Stream
for a given Zendesk.Client.Operation
.
For instance:
# get 400 tickets
Zendesk.Ticket.list()
|> Zendesk.stream!()
|> Stream.take(400)
|> Enum.to_list()
|> IO.inspect()