Creatio. OData
(creatio v0.3.1)
Copy Markdown
Client implementation for Creatio OData 4 protocol endpoints (/0/odata/).
Provides CRUD operations, field-level access, streams, pagination, and batching.
Summary
Functions
Executes an OData batch request.
Same as batch/3, but raises Creatio.Error on failure.
Gets the total count of an entity collection.
Same as count/3, but raises Creatio.Error on failure.
Creates a new entity record (POST /0/odata/{Entity}).
Same as create/4, but raises Creatio.Error on failure.
Deletes an entity record (DELETE /0/odata/{Entity}({id})).
Same as delete/4, but raises Creatio.Error on failure.
Deletes a specific field of an entity (DELETE /0/odata/{Entity}({id})/{Field}).
Same as delete_field/5, but raises Creatio.Error on failure.
Executes an OData query or entity listing. Alias for list/3.
Same as execute/3, but raises Creatio.Error on failure.
Retrieves a single entity by its primary ID (GET /0/odata/{Entity}({id})).
Same as get/4, but raises Creatio.Error on failure.
Retrieves a specific field value by ID (GET /0/odata/{Entity}({id})/{Field}).
Same as get_field/5, but raises Creatio.Error on failure.
Retrieves the raw scalar or stream value of a field (GET /0/odata/{Entity}({id})/{Field}/$value).
Same as get_field_value/4, but raises Creatio.Error on failure.
Retrieves related records via a navigation property (GET /0/odata/{Entity}({id})/{Property}).
Same as get_navigation/5, but raises Creatio.Error on failure.
Queries an entity collection (GET /0/odata/{Entity}).
Same as list/3, but raises Creatio.Error on failure.
Returns a lazy Stream that paginates through records of the given entity or query.
Updates an existing entity record (PATCH /0/odata/{Entity}({id})).
Same as update/5, but raises Creatio.Error on failure.
Updates a specific field or binary stream (PUT /0/odata/{Entity}({id})/{Field}).
Same as update_field/6, but raises Creatio.Error on failure.
Functions
Executes an OData batch request.
Same as batch/3, but raises Creatio.Error on failure.
@spec count(Creatio.Client.t() | Req.Request.t(), String.t(), keyword()) :: {:ok, integer()} | {:error, Creatio.Error.t()}
Gets the total count of an entity collection.
Supports:
- Option 1 (default):
GET /0/odata/{Entity}/$count - Option 2:
GET /0/odata/{Entity}?$count=true&$top=0(when:strategyis:top_zero)
Accepts optional :filter.
Same as count/3, but raises Creatio.Error on failure.
@spec create(Creatio.Client.t() | Req.Request.t(), String.t(), map(), keyword()) :: {:ok, map()} | {:error, Creatio.Error.t()}
Creates a new entity record (POST /0/odata/{Entity}).
Same as create/4, but raises Creatio.Error on failure.
@spec delete(Creatio.Client.t() | Req.Request.t(), String.t(), String.t(), keyword()) :: :ok | {:error, Creatio.Error.t()}
Deletes an entity record (DELETE /0/odata/{Entity}({id})).
Same as delete/4, but raises Creatio.Error on failure.
@spec delete_field( Creatio.Client.t() | Req.Request.t(), String.t(), String.t(), String.t(), keyword() ) :: :ok | {:error, Creatio.Error.t()}
Deletes a specific field of an entity (DELETE /0/odata/{Entity}({id})/{Field}).
Same as delete_field/5, but raises Creatio.Error on failure.
Executes an OData query or entity listing. Alias for list/3.
Same as execute/3, but raises Creatio.Error on failure.
@spec get(Creatio.Client.t() | Req.Request.t(), String.t(), String.t(), keyword()) :: {:ok, map()} | {:error, Creatio.Error.t()}
Retrieves a single entity by its primary ID (GET /0/odata/{Entity}({id})).
Options
:select- Fields to select.:expand- Relations to expand.
Same as get/4, but raises Creatio.Error on failure.
@spec get_field( Creatio.Client.t() | Req.Request.t(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, any()} | {:error, Creatio.Error.t()}
Retrieves a specific field value by ID (GET /0/odata/{Entity}({id})/{Field}).
Same as get_field/5, but raises Creatio.Error on failure.
@spec get_field_value( Creatio.Client.t() | Req.Request.t(), String.t(), String.t(), String.t() ) :: {:ok, binary()} | {:error, Creatio.Error.t()}
Retrieves the raw scalar or stream value of a field (GET /0/odata/{Entity}({id})/{Field}/$value).
Same as get_field_value/4, but raises Creatio.Error on failure.
@spec list( Creatio.Client.t() | Req.Request.t(), String.t() | Creatio.OData.Query.t(), keyword() | map() ) :: {:ok, list() | map()} | {:error, Creatio.Error.t()}
Queries an entity collection (GET /0/odata/{Entity}).
Accepts either a %Creatio.OData.Query{} or a keyword list of options.
Options
:select- List or comma-separated string of fields to retrieve.:filter- OData filter string.:orderby- Ordering string or list.:top- Limit integer.:skip- Offset integer.:expand- Related entities to expand.:count- Whentrue, requests@odata.countinline.:params- Map of additional query params.
Same as list/3, but raises Creatio.Error on failure.
@spec stream( Creatio.Client.t() | Req.Request.t(), String.t() | Creatio.OData.Query.t(), keyword() ) :: Enumerable.t()
Returns a lazy Stream that paginates through records of the given entity or query.
Options
:page_size- Number of records per page (default: 100).:skip- Initial offset to begin streaming from (default: 0).:select- Fields to select.:filter- Filter expression.:orderby- Ordering expression.:expand- Expanded relations.
@spec update( Creatio.Client.t() | Req.Request.t(), String.t(), String.t(), map(), keyword() ) :: :ok | {:ok, map()} | {:error, Creatio.Error.t()}
Updates an existing entity record (PATCH /0/odata/{Entity}({id})).
Same as update/5, but raises Creatio.Error on failure.
@spec update_field( Creatio.Client.t() | Req.Request.t(), String.t(), String.t(), String.t(), any(), keyword() ) :: :ok | {:error, Creatio.Error.t()}
Updates a specific field or binary stream (PUT /0/odata/{Entity}({id})/{Field}).
Same as update_field/6, but raises Creatio.Error on failure.