tallgrass/machine
Types
Functions
pub fn fetch(client: Client) -> Result(PaginatedResource, Error)
Fetches a paginated list of machine resources.
Example
let result = machine.new() |> machine.fetch()
pub fn fetch_by_id(
client: Client,
id: Int,
) -> Result(Machine, Error)
Fetches a machine given the machine ID.
Example
let result = machine.new() |> machine.fetch_by_id(1)
pub fn fetch_resource(
client: Client,
resource: Resource,
) -> Result(Machine, Error)
Fetches a machine given a machine resource.
Example
let client = machine.new()
use res <- result.try(client |> machine.fetch())
let assert Ok(first) = res.results |> list.first
client |> machine.fetch_resource(first)