View Source Dnsimple.Listing (dnsimple v4.0.0)

Summary

Functions

Format request options for list endpoints into HTTP params.

Issues a GET request to the given url processing the listing options first.

Iterates over all pages of a listing endpoint and returns the union of all the elements of all pages in the form of {:ok, all_elements}. If an error occurs it will return the response to the request that failed in the form of {:error, failed_response}.

Functions

Format request options for list endpoints into HTTP params.

Link to this function

get(client, url, options \\ [])

View Source

Issues a GET request to the given url processing the listing options first.

Link to this function

get_all(module, function, params)

View Source

Iterates over all pages of a listing endpoint and returns the union of all the elements of all pages in the form of {:ok, all_elements}. If an error occurs it will return the response to the request that failed in the form of {:error, failed_response}.

Note that the params attribute must include the options parameter even if it's optional.

Examples

client = %Dnsimple.Client{access_token: "a1b2c3d4"} account_id = 1010

Listing.get_all(Dnsimple.Zones, :list_zones, [client, account_id, []]) Listing.get_all(Dnsimple.Zones, :list_zones, [client, account_id, [sort: "name:desc"]]) Listing.get_all(Dnsimple.Zones, :list_zone_records, [client, account_id, _zone_id = "example.com", []])