Deputy.My (Deputy v0.2.1)
View SourceFunctions for interacting with endpoints related to the authenticated user.
Summary
Functions
Get all the authenticated user's addresses including emergency contacts.
Get the authenticated user's colleagues.
Complete a task.
Get the authenticated user's address.
Get the authenticated user's leave requests.
Get a specific location.
Get locations where the authenticated user can work.
Get information about the authenticated user.
Get the authenticated user's memos (newsfeed).
Get the authenticated user's notifications.
Get the authenticated user's rosters.
Get setup information for the authenticated user.
Get the authenticated user's tasks.
Get details for a specific timesheet.
Get the authenticated user's timesheets.
Get the authenticated user's training.
Get the authenticated user's unavailability.
Update the authenticated user's address.
Functions
Get all the authenticated user's addresses including emergency contacts.
Examples
iex> client = Deputy.new(base_url: "https://test.deputy.com", api_key: "test-key")
iex> Deputy.My.all_contact_addresses(client)
{:ok, [%{"Street1" => "123 Main St", "City" => "New York"}]}
Get the authenticated user's colleagues.
Examples
iex> client = Deputy.new(base_url: "https://test.deputy.com", api_key: "test-key")
iex> Deputy.My.colleagues(client)
{:ok, [%{"Id" => 2, "FirstName" => "Jane", "LastName" => "Smith"}]}
Complete a task.
Parameters
client
: A Deputy client.id
: The ID of the task to complete.
Examples
iex> client = Deputy.new(base_url: "https://test.deputy.com", api_key: "test-key")
iex> Deputy.My.complete_task(client, 1)
{:ok, %{"success" => true}}
Get the authenticated user's address.
Examples
iex> client = Deputy.new(base_url: "https://test.deputy.com", api_key: "test-key")
iex> Deputy.My.contact_address(client)
{:ok, %{"Street1" => "123 Main St", "City" => "New York"}}
Get the authenticated user's leave requests.
Examples
iex> client = Deputy.new(base_url: "https://test.deputy.com", api_key: "test-key")
iex> Deputy.My.leave(client)
{:ok, [%{"Id" => 1, "DateStart" => "2023-01-01", "DateEnd" => "2023-01-05"}]}
Get a specific location.
Parameters
client
: A Deputy client.id
: The ID of the location.
Examples
iex> client = Deputy.new(base_url: "https://test.deputy.com", api_key: "test-key")
iex> Deputy.My.location(client, 1)
{:ok, %{"Id" => 1, "Name" => "Main Office"}}
Get locations where the authenticated user can work.
Examples
iex> client = Deputy.new(base_url: "https://test.deputy.com", api_key: "test-key")
iex> Deputy.My.locations(client)
{:ok, [%{"Id" => 1, "Name" => "Main Office"}]}
Get information about the authenticated user.
Examples
iex> client = Deputy.new(base_url: "https://test.deputy.com", api_key: "test-key")
iex> Deputy.My.me(client)
{:ok, %{"Id" => 1, "FirstName" => "John", "LastName" => "Doe"}}
Get the authenticated user's memos (newsfeed).
Examples
iex> client = Deputy.new(base_url: "https://test.deputy.com", api_key: "test-key")
iex> Deputy.My.memos(client)
{:ok, [%{"Id" => 1, "Content" => "Welcome to Deputy"}]}
Get the authenticated user's notifications.
Examples
iex> client = Deputy.new(base_url: "https://test.deputy.com", api_key: "test-key")
iex> Deputy.My.notifications(client)
{:ok, [%{"Id" => 1, "Message" => "You have a new roster"}]}
Get the authenticated user's rosters.
Examples
iex> client = Deputy.new(base_url: "https://test.deputy.com", api_key: "test-key")
iex> Deputy.My.rosters(client)
{:ok, [%{"Id" => 1, "StartTime" => "2023-01-01T09:00:00"}]}
Get setup information for the authenticated user.
Examples
iex> client = Deputy.new(base_url: "https://test.deputy.com", api_key: "test-key")
iex> Deputy.My.setup(client)
{:ok, %{"locations" => [%{"Id" => 1, "Name" => "Main Office"}]}}
Get the authenticated user's tasks.
Examples
iex> client = Deputy.new(base_url: "https://test.deputy.com", api_key: "test-key")
iex> Deputy.My.tasks(client)
{:ok, [%{"Id" => 1, "TaskName" => "Complete training"}]}
Get details for a specific timesheet.
Parameters
client
: A Deputy client.id
: The ID of the timesheet.
Examples
iex> client = Deputy.new(base_url: "https://test.deputy.com", api_key: "test-key")
iex> Deputy.My.timesheet_detail(client, 1)
{:ok, %{"Id" => 1, "StartTime" => "2023-01-01T09:00:00"}}
Get the authenticated user's timesheets.
Examples
iex> client = Deputy.new(base_url: "https://test.deputy.com", api_key: "test-key")
iex> Deputy.My.timesheets(client)
{:ok, [%{"Id" => 1, "StartTime" => "2023-01-01T09:00:00"}]}
Get the authenticated user's training.
Examples
iex> client = Deputy.new(base_url: "https://test.deputy.com", api_key: "test-key")
iex> Deputy.My.training(client)
{:ok, [%{"Id" => 1, "Name" => "Safety Training"}]}
Update the authenticated user's address.
Parameters
client
: A Deputy client.attrs
: A map containing the address details.
Address parameters
ContactName
: Name for the contact.UnitNo
: Unit number.Street1
: Street address.City
: City.State
: State code.Postcode
: Postal code.Country
: Country ID.Notes
: Optional notes.
Examples
iex> client = Deputy.new(base_url: "https://test.deputy.com", api_key: "test-key")
iex> attrs = %{
...> ContactName: "John Doe",
...> UnitNo: "2",
...> Street1: "123 Main St",
...> City: "New York",
...> State: "NY",
...> Postcode: "10001",
...> Country: 1
...> }
iex> Deputy.My.update_contact_address(client, attrs)
{:ok, %{"success" => true}}