ExScim.Groups.Mapper.Adapter behaviour (ex_scim v0.2.0)

Copy Markdown View Source

Group resource mapper behaviour.

Summary

Types

A domain group struct or map.

A SCIM group resource as a JSON-decoded map.

Callbacks

Builds the complete SCIM meta object for a group. Receives the struct and options like :location and :resource_type.

Converts a SCIM JSON map into a domain group struct.

Extracts the creation timestamp from a group struct. Used for SCIM meta.created.

Extracts the last-modified timestamp from a group struct. Used for SCIM meta.lastModified.

Computes an ETag version string from a group struct. Used for SCIM meta.version.

Converts a domain group struct into a SCIM JSON map.

Types

group_struct()

@type group_struct() :: struct() | map()

A domain group struct or map.

scim_data()

@type scim_data() :: map()

A SCIM group resource as a JSON-decoded map.

Callbacks

format_meta(group_struct, keyword)

(optional)
@callback format_meta(
  group_struct(),
  keyword()
) :: map()

Builds the complete SCIM meta object for a group. Receives the struct and options like :location and :resource_type.

from_scim(scim_data, t)

@callback from_scim(scim_data(), ExScim.Scope.t()) ::
  {:ok, group_struct()} | {:error, atom() | term()}

Converts a SCIM JSON map into a domain group struct.

get_meta_created(group_struct)

(optional)
@callback get_meta_created(group_struct()) :: DateTime.t() | nil

Extracts the creation timestamp from a group struct. Used for SCIM meta.created.

get_meta_last_modified(group_struct)

(optional)
@callback get_meta_last_modified(group_struct()) :: DateTime.t() | nil

Extracts the last-modified timestamp from a group struct. Used for SCIM meta.lastModified.

get_meta_version(group_struct)

(optional)
@callback get_meta_version(group_struct()) :: String.t() | nil

Computes an ETag version string from a group struct. Used for SCIM meta.version.

to_scim(group_struct, t, keyword)

@callback to_scim(group_struct(), ExScim.Scope.t(), keyword()) ::
  {:ok, scim_data()} | {:error, atom() | term()}

Converts a domain group struct into a SCIM JSON map.