Dnsimple.Listing (dnsimple v6.0.1)

View Source

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(options)

Format request options for list endpoints into HTTP params.

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

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

get_all(module, function, params)

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", []])