Humaans.OKRs (Humaans v0.6.0)

Copy Markdown View Source

This module provides functions for listing and retrieving OKR resources in the Humaans API. OKRs are read-only via the API.

Summary

Functions

Lists all ok_rs.

Retrieves a specific okr by ID.

Types

list_response()

@type list_response() ::
  {:ok,
   [
     %Humaans.Resources.OKR{
       company_id: term(),
       created_at: term(),
       description: term(),
       id: term(),
       person_id: term(),
       progress: term(),
       status: term(),
       title: term(),
       updated_at: term()
     }
   ]}
  | {:error, Humaans.Error.t()}

response()

@type response() ::
  {:ok,
   %Humaans.Resources.OKR{
     company_id: term(),
     created_at: term(),
     description: term(),
     id: term(),
     person_id: term(),
     progress: term(),
     status: term(),
     title: term(),
     updated_at: term()
   }}
  | {:error, Humaans.Error.t()}

Functions

list(client, params \\ %{})

@spec list(client :: map(), params :: map() | keyword() | [{String.t(), term()}]) ::
  {:ok, [Humaans.Resources.OKR.t()]} | {:error, Humaans.Error.t()}

Lists all ok_rs.

Returns a list of ok_rs matching the optional filter params.

Parameters

  • client - Client created with Humaans.new/1
  • params - Optional map of filter parameters (default: %{})

Examples

client = Humaans.new(access_token: "your_access_token")
{:ok, ok_rs} = Humaans.OKRs.list(client)
{:ok, ok_rs} = Humaans.OKRs.list(client, %{})

retrieve(client, id)

@spec retrieve(client :: map(), id :: String.t()) ::
  {:ok, Humaans.Resources.OKR.t()} | {:error, Humaans.Error.t()}

Retrieves a specific okr by ID.

Parameters

  • client - Client created with Humaans.new/1
  • id - String ID of the okr to retrieve

Examples

client = Humaans.new(access_token: "your_access_token")
{:ok, okr} = Humaans.OKRs.retrieve(client, "okr_id")