View Source Ash.Api.Dsl (ash v2.4.26)
A small DSL for declaring APIs
Apis are the entrypoints for working with your resources.
Apis may optionally include a list of resources, in which case they can be
used as an Ash.Registry in various places. This is for backwards compatibility,
but if at all possible you should define an Ash.Registry if you are using an extension
that requires a list of resources. For example, most extensions look for two application
environment variables called :ash_apis and :ash_registries to find any potential registries
  
  dsl-documentation
  
  DSL Documentation
  
  index
  
  Index
  
  docs
  
  Docs
  
  resources
  
  resources
List the resources present in this API
Examples:
resources do
  registry MyApp.Registry
end
:allow- Support a dynamic resource list by providing a callback that checks whether or not the resource should be allowed.:allow_unregistered?(boolean/0) - Whether the Api will support only registered entries or not. The default value isfalse.:registry(atom/0) - Configure the registry that contains the resources. It is recommended to use application config for this, to help with compile times. See the quick start guide for more.
  
  execution
  
  execution
Options for how requests are executed using this Api
Examples:
execution do
  timeout :timer.seconds(30)
end
:timeout(timeout/0) - The default timeout to use for requests using this API. The default value is30000.:trace_name(String.t/0) - The name to use in traces. Defaults to the last part of the module
  
  authorization
  
  authorization
Options for how requests are authorized using this Api
Examples:
authorization do
  authorize :by_default
  require_actor? true
end
:require_actor?(boolean/0) - Requires that an actor has been supplied. The default value isfalse.:authorize- When to run authorization for a given request. The default value is:when_requested.