<!--
This file was generated by Spark. Do not edit it by hand.
-->
# AshToonEx.Resource

`Ash.Resource` extension for implementing `ToonEx.Encoder` protocol.


## toon
Configuration for ToonEx encoder implementation.


### Nested DSLs
 * [compact](#toon-compact)
 * [merge](#toon-merge)
 * [rename](#toon-rename)
 * [order](#toon-order)
 * [customize](#toon-customize)





### Options

| Name | Type | Default | Docs |
|------|------|---------|------|
| [`pick`](#toon-pick){: #toon-pick } | `list(atom) \| %{optional(:private?) => boolean, optional(:sensitive?) => boolean, optional(:include) => list(atom), optional(:exclude) => list(atom), optional(:relationships?) => boolean, optional(:calculations?) => boolean, optional(:aggregates?) => boolean, optional(:format) => atom}` |  | Keys to pick from a record into a result. Accepts an explicit names list or a behaviour configuration map. |



### toon.compact
```elixir
compact config
```


A step to omit fields with unwanted values (nil, for example).






### Arguments

| Name | Type | Default | Docs |
|------|------|---------|------|
| [`config`](#toon-compact-config){: #toon-compact-config .spark-required} | `boolean \| {:only, list(atom)} \| {:except, list(atom)} \| %{optional(:values) => list(any), optional(:fields) => {:only, list(atom)} \| {:except, list(atom)}}` |  | Accepts `true` to remove any field with nil, a tagged `only`/`except` tuple to specify targeted fields or a map to configure which value or fields to work on. |







### toon.merge
```elixir
merge values
```


A step to merge fixed values into a result.






### Arguments

| Name | Type | Default | Docs |
|------|------|---------|------|
| [`values`](#toon-merge-values){: #toon-merge-values .spark-required} | `list({any, any}) \| %{optional(any) => any}` |  | Values to merge into a result. Accepts a map or a tuples list. |







### toon.rename
```elixir
rename renames
```


A step to rename keys in a result.






### Arguments

| Name | Type | Default | Docs |
|------|------|---------|------|
| [`renames`](#toon-rename-renames){: #toon-rename-renames .spark-required} | `list({any, any}) \| %{optional(any) => any} \| (any -> any)` |  | A mapping for renaming keys in a result. Accepts a map, a tuples list or a function. |







### toon.order
```elixir
order sort
```


A step to reorder keys in a result.






### Arguments

| Name | Type | Default | Docs |
|------|------|---------|------|
| [`sort`](#toon-order-sort){: #toon-order-sort .spark-required} | `boolean \| (list(any) -> list(any)) \| list(any)` |  | An order to apply to keys in toon. Accepts a boolean, a sort function or a list of keys in a desired order. |







### toon.customize
```elixir
customize fun
```


A step to arbitrary customize a result.






### Arguments

| Name | Type | Default | Docs |
|------|------|---------|------|
| [`fun`](#toon-customize-fun){: #toon-customize-fun .spark-required} | `(list({any, any}), map -> list({any, any}))` |  | A function to customize a result with. Receives a result and a resource record. |











<style type="text/css">.spark-required::after { content: "*"; color: red !important; }</style>
