CatalogApi.Category (CatalogApi v0.0.17) View Source
Defines the CatalogApi.Category struct and functions which are responsible for parsing categories from CatalogApi responses.
Link to this section Summary
Functions
Casts a map representing a Category which results from parsing JSON
representing a category into a %CatalogApi.Category{} struct.
Accepts a raw JSON response from the CatalogApi.catalog_breakdon/2 function
and casts all categories as %CatalogApi.Category{} structs.
Link to this section Types
Specs
Link to this section Functions
Specs
Casts a map representing a Category which results from parsing JSON
representing a category into a %CatalogApi.Category{} struct.
If the category has any categories enumerated in its "children" key, then it casts those children recursively as well.
Specs
Accepts a raw JSON response from the CatalogApi.catalog_breakdon/2 function
and casts all categories as %CatalogApi.Category{} structs.
If the given json is not recognized or is an invalid format then it returns
an error tuple of the format: {:error, :unparseable_catalog_api_categories}