Creatio.OData3 (creatio v0.3.1)

Copy Markdown

Legacy OData 3 protocol client for Creatio (/0/ServiceModel/EntityDataService.svc/).

Provided for backward compatibility with legacy Creatio environments. Supports collection listing, CRUD, navigation traversal, field values, and counts.

Summary

Functions

Gets total count of an entity collection in OData 3.

Same as count/3, but raises Creatio.Error on failure.

Creates an entity via OData 3 (POST .../{Entity}Collection).

Deletes an entity via OData 3 (DELETE .../{Entity}Collection(guid'{id}')).

Gets a single entity by ID in OData 3 (GET .../{Entity}Collection(guid'{id}')).

Same as get/4, but raises Creatio.Error on failure.

Retrieves a specific field value of an entity in OData 3 (GET .../{Entity}Collection(guid'{id}')/{field_name}).

Retrieves raw scalar/stream value in OData 3 (GET .../{Entity}Collection(guid'{id}')/{field_name}/$value).

Retrieves related records via a navigation property in OData 3 (GET .../{Entity}Collection(guid'{id}')/{nav_property}).

Queries an OData 3 entity collection (GET .../{Entity}Collection).

Returns a lazy Stream that paginates through records of an OData 3 entity collection using $top and $skip.

Updates an entity via OData 3 (PATCH .../{Entity}Collection(guid'{id}')).

Functions

count(client_or_req, entity, opts \\ [])

@spec count(Creatio.Client.t() | Req.Request.t(), String.t(), keyword()) ::
  {:ok, integer()} | {:error, Creatio.Error.t()}

Gets total count of an entity collection in OData 3.

Supports both path strategy (GET .../{Entity}Collection/$count, default) and query strategy (GET .../{Entity}Collection?/$count, Postman collection format).

Options

  • :strategy - :path (default) or :query.
  • :filter - Optional filter string.

count!(client, entity, opts \\ [])

Same as count/3, but raises Creatio.Error on failure.

create(client_or_req, entity, attrs, opts \\ [])

@spec create(Creatio.Client.t() | Req.Request.t(), String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Creatio.Error.t()}

Creates an entity via OData 3 (POST .../{Entity}Collection).

create!(client, entity, attrs, opts \\ [])

Same as create/4, but raises Creatio.Error on failure.

delete(client_or_req, entity, id, opts \\ [])

@spec delete(Creatio.Client.t() | Req.Request.t(), String.t(), String.t(), keyword()) ::
  :ok | {:error, Creatio.Error.t()}

Deletes an entity via OData 3 (DELETE .../{Entity}Collection(guid'{id}')).

delete!(client, entity, id, opts \\ [])

Same as delete/4, but raises Creatio.Error on failure.

get(client_or_req, entity, id, opts \\ [])

@spec get(Creatio.Client.t() | Req.Request.t(), String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Creatio.Error.t()}

Gets a single entity by ID in OData 3 (GET .../{Entity}Collection(guid'{id}')).

get!(client, entity, id, opts \\ [])

Same as get/4, but raises Creatio.Error on failure.

get_field(client_or_req, entity, id, field_name, opts \\ [])

@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 of an entity in OData 3 (GET .../{Entity}Collection(guid'{id}')/{field_name}).

get_field!(client, entity, id, field_name, opts \\ [])

Same as get_field/5, but raises Creatio.Error on failure.

get_field_value(client_or_req, entity, id, field_name)

@spec get_field_value(
  Creatio.Client.t() | Req.Request.t(),
  String.t(),
  String.t(),
  String.t()
) ::
  {:ok, binary()} | {:error, Creatio.Error.t()}

Retrieves raw scalar/stream value in OData 3 (GET .../{Entity}Collection(guid'{id}')/{field_name}/$value).

get_field_value!(client, entity, id, field_name)

Same as get_field_value/4, but raises Creatio.Error on failure.

get_navigation(client_or_req, entity, id, nav_property, opts \\ [])

@spec get_navigation(
  Creatio.Client.t() | Req.Request.t(),
  String.t(),
  String.t(),
  String.t(),
  keyword()
) :: {:ok, any()} | {:error, Creatio.Error.t()}

Retrieves related records via a navigation property in OData 3 (GET .../{Entity}Collection(guid'{id}')/{nav_property}).

get_navigation!(client, entity, id, nav_property, opts \\ [])

Same as get_navigation/5, but raises Creatio.Error on failure.

list(client_or_req, entity_or_query, opts \\ [])

@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 OData 3 entity collection (GET .../{Entity}Collection).

Options

  • :select - List or string of fields to retrieve.
  • :filter - OData filter string.
  • :orderby - Ordering expression or keyword list.
  • :top - Maximum records to retrieve.
  • :skip - Number of records to skip.
  • :expand - Related entities to expand.
  • :count - When true, requests inline count via $inlinecount=allpages.

list!(client_or_req, entity_or_query, opts \\ [])

Same as list/3, but raises Creatio.Error on failure.

stream(client_or_req, entity_or_query, opts \\ [])

Returns a lazy Stream that paginates through records of an OData 3 entity collection using $top and $skip.

Options

  • :page_size - Records per request (default 100).
  • :skip - Initial offset to begin streaming from (default: 0).
  • :select - List or string of fields to retrieve.
  • :filter - Filter expression.
  • :orderby - Ordering expression.
  • :expand - Relations to expand.

stream!(client_or_req, entity_or_query, opts \\ [])

Same as stream/3.

update(client_or_req, entity, id, attrs, opts \\ [])

@spec update(
  Creatio.Client.t() | Req.Request.t(),
  String.t(),
  String.t(),
  map(),
  keyword()
) ::
  :ok | {:ok, map()} | {:error, Creatio.Error.t()}

Updates an entity via OData 3 (PATCH .../{Entity}Collection(guid'{id}')).

update!(client, entity, id, attrs, opts \\ [])

Same as update/5, but raises Creatio.Error on failure.