# `ApifyClient.Generator.Processor`
[🔗](https://github.com/social-growth-studio/apify-client-ex/blob/v1.0.0/dev/apify_client/generator/processor.ex#L1)

`oapi_generator` processor that names operations after their URL path.

Apify's operation IDs are flat (`actor_runs_last_dataset_items_get`) and its tags
overlap (every storage endpoint is also tagged "Actor Runtime API/..."), so neither
gives usable modules. Names are derived from the path instead:

  * every static segment that is a resource becomes a module segment:
    `/v2/actors/{actorId}/runs` => `API.Actors.Runs`
  * the function name follows the method and whether the path ends in a
    collection or an item:

    | Request                  | Function     |
    | ------------------------ | ------------ |
    | `GET` collection         | `list`       |
    | `POST` collection        | `create`     |
    | `GET` item or singleton  | `get`        |
    | `PUT`/`PATCH`            | `update`     |
    | `DELETE`                 | `delete`     |
    | `HEAD`                   | `head`       |

  * a trailing segment with a single method that is not a resource is an action
    on its parent: `POST /v2/actor-runs/{runId}/abort` => `API.Runs.abort/2`
  * top-level `actor-runs`, `actor-builds` and `actor-tasks` become `Runs`,
    `Builds` and `Tasks`, as in the official JavaScript client (`client.run(id)`,
    `client.builds()`, `client.task(id)`); the runs of one Actor stay under
    `API.Actors.Runs`

A static segment is a resource when it is top-level, has sub-paths, has more than
one method, or is a collection (followed by an `{id}` somewhere, or a plural name
with a `GET`). Cases the rules get wrong go into `@overrides`.

Operations that only duplicate another one under a different method (summaries
ending in "(POST)" or "(GET)", e.g. "Update Actor version (POST)") are skipped,
as are deprecated operations (`ignore: [:deprecated_operations]`).

Schema structs are placed under `ApifyClient.Schemas`.

> #### Generation-time only {: .neutral}
>
> Runs under `mix apify.gen` only; lives in `dev/` because it depends on the
> dev-only `:oapi_generator`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
