ExScimClient.Me (ex_scim_client v0.2.1)

Copy Markdown View Source

Operations on the authenticated user's own resource (/Me endpoint).

Examples

iex> client = ExScimClient.Client.new("https://example.com/scim/v2", "token")
iex> {:ok, _me} = ExScimClient.Me.get(client)

Summary

Functions

Retrieves the authenticated user's resource.

Partially updates the authenticated user's resource using patch operations.

Updates the authenticated user's resource by replacing all attributes.

Functions

get(client, opts \\ [])

@spec get(
  ExScimClient.Client.t(),
  keyword()
) :: {:ok, map()} | {:error, term()}

Retrieves the authenticated user's resource.

Parameters

  • client - ExScimClient.Client struct
  • opts - Options keyword list
    • :attributes - List of attributes to include
    • :excluded_attributes - List of attributes to exclude

Examples

iex> client = ExScimClient.Client.new("https://example.com/scim/v2", "token")
iex> {:ok, _me} = ExScimClient.Me.get(client)
iex> {:ok, _me} = ExScimClient.Me.get(client, attributes: ["userName", "displayName"])

patch(client, operations)

@spec patch(ExScimClient.Client.t(), list()) :: {:ok, map()} | {:error, term()}

Partially updates the authenticated user's resource using patch operations.

Parameters

Examples

iex> client = ExScimClient.Client.new("https://example.com/scim/v2", "token")
iex> operations = [%{"op" => "replace", "path" => "displayName", "value" => "New Name"}]
iex> {:ok, _response} = ExScimClient.Me.patch(client, operations)

update(client, user_data)

@spec update(ExScimClient.Client.t(), map()) :: {:ok, map()} | {:error, term()}

Updates the authenticated user's resource by replacing all attributes.

Parameters

Examples

iex> client = ExScimClient.Client.new("https://example.com/scim/v2", "token")
iex> user_data = %{displayName: "Updated Name"}
iex> {:ok, _response} = ExScimClient.Me.update(client, user_data)