Humaans.PublicHolidayCalendarDays (Humaans v0.6.0)

Copy Markdown View Source

This module provides functions for managing public holiday calendar day resources in the Humaans API. Note that the API does not support deletion.

Summary

Functions

Creates a new public_holiday_calendar_day.

Lists all public_holiday_calendar_days.

Retrieves a specific public_holiday_calendar_day by ID.

Updates a specific public_holiday_calendar_day by ID.

Types

list_response()

@type list_response() ::
  {:ok,
   [
     %Humaans.Resources.PublicHolidayCalendarDay{
       created_at: term(),
       id: term(),
       public_holiday_calendar_id: term(),
       public_holiday_id: term(),
       updated_at: term()
     }
   ]}
  | {:error, Humaans.Error.t()}

response()

@type response() ::
  {:ok,
   %Humaans.Resources.PublicHolidayCalendarDay{
     created_at: term(),
     id: term(),
     public_holiday_calendar_id: term(),
     public_holiday_id: term(),
     updated_at: term()
   }}
  | {:error, Humaans.Error.t()}

Functions

create(client, params)

@spec create(client :: map(), params :: map() | keyword()) ::
  {:ok, Humaans.Resources.PublicHolidayCalendarDay.t()}
  | {:error, Humaans.Error.t()}

Creates a new public_holiday_calendar_day.

Parameters

  • client - Client created with Humaans.new/1
  • params - Map of attributes for the new public_holiday_calendar_day

Examples

client = Humaans.new(access_token: "your_access_token")
params = %{publicHolidayCalendarId: "cal_abc", publicHolidayId: "ph_abc"}
{:ok, public_holiday_calendar_day} = Humaans.PublicHolidayCalendarDays.create(client, params)

list(client, params \\ %{})

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

Lists all public_holiday_calendar_days.

Returns a list of public_holiday_calendar_days 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, public_holiday_calendar_days} = Humaans.PublicHolidayCalendarDays.list(client)
{:ok, public_holiday_calendar_days} = Humaans.PublicHolidayCalendarDays.list(client, %{})

retrieve(client, id)

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

Retrieves a specific public_holiday_calendar_day by ID.

Parameters

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

Examples

client = Humaans.new(access_token: "your_access_token")
{:ok, public_holiday_calendar_day} = Humaans.PublicHolidayCalendarDays.retrieve(client, "public_holiday_calendar_day_id")

update(client, id, params)

@spec update(client :: map(), id :: String.t(), params :: map() | keyword()) ::
  {:ok, Humaans.Resources.PublicHolidayCalendarDay.t()}
  | {:error, Humaans.Error.t()}

Updates a specific public_holiday_calendar_day by ID.

Parameters

  • client - Client created with Humaans.new/1
  • id - String ID of the public_holiday_calendar_day to update
  • params - Map of attributes to update

Examples

client = Humaans.new(access_token: "your_access_token")
params = %{publicHolidayId: "ph_def"}
{:ok, public_holiday_calendar_day} = Humaans.PublicHolidayCalendarDays.update(client, "public_holiday_calendar_day_id", params)