todoist v0.0.2 Todoist.Project

Summary

Functions

Adds a new command structure to Request

Adds an archive command structure to Request

Adds an delete command structure to Request

Adds an unarchive command structure to Request

Adds an update command structure to Request

Adds an update_orders_indent command strcuture to Request

Functions

add(request, name, options \\ [])

Adds a new command structure to Request.

See: https://developer.todoist.com/?shell#add-a-project

Options:

  • :uuid Unique string ID for the command: It will be automatically generated if not passed.

  • :temp_id Temporary resource ID. Only specified for commands that create new resource (“item_add” command). More details about this below.

  • :color The color of the project (a number between 0 and 11, or between 0 and 21 for premium users).

  • :indent The indent of the item (a number between 1 and 4, where 1 is top-level).

  • :item_order Project’s order in the project list (a number, where the smallest value should place the project at the top).

Examples

request = %WriteRequest{} |> add("my_new_project")
request.commands
[%{type: "project_add", uuid: ..., args: %{name: "my_new_project"}}]
archive(request, ids, options \\ [])

Adds an archive command structure to Request

See: https://developer.todoist.com/#archive-a-project

Options:

  • :uuid Unique string ID for the command: It will be automatically generated if not passed.

Examples

request = %WriteRequest |> archive(["temp_id"])
request.commands
[%{type: "project_archive", uuid: ..., args: %{ids: ["temp_id"}}]
delete(request, ids, options \\ [])

Adds an delete command structure to Request

See: https://developer.todoist.com/#delete-projects

Options:

  • :uuid Unique string ID for the command: It will be automatically generated if not passed.

Examples

request = %WriteRequest |> delete(["temp_id"])
request.commands
[%{type: "project_delete", uuid: ..., args: %{ids: ["temp_id"}}]
unarchive(request, ids, options \\ [])

Specs

Adds an unarchive command structure to Request

See: https://developer.todoist.com/#unarchive-a-project

Options:

  • :uuid Unique string ID for the command: It will be automatically generated if not passed.

Examples

request = %WriteRequest |> unarchive(["temp_id"])
request.commands
[%{type: "project_unarchive", uuid: ..., args: %{ids: ["temp_id"}}]
update(request, id, options \\ [])

Specs

Adds an update command structure to Request.

See: https://developer.todoist.com/?shell#update-a-project

Options:

  • :uuid Unique string ID for the command: It will be automatically generated if not passed.

  • :temp_id Temporary resource ID. Only specified for commands that create new resource (“item_add” command). More details about this below.

  • :name The name of the project (a string value).

  • :color The color of the project (a number between 0 and 11, or between 0 and 21 for premium users).

  • :indent The indent of the item (a number between 1 and 4, where 1 is top-level).

  • :item_order Project’s order in the project list (a number, where the smallest value should place the project at the top).

  • :collapsed Whether the project’s sub-projects are collapsed. (where 1 is true and 0 is false)

Examples

request = %WriteRequest |> update("id", name: "new title")
request.commands
[%{type: "project_update", uuid: ..., args: %{id: "id", name: "new_title"}}]
update_orders_indents(request, order_info, options \\ [])

Specs

update_orders_indents(Todoist.WriteRequest.t, map, Keyword.t) :: Todoist.WriteRequest.t

Adds an update_orders_indent command strcuture to Request

See: https://developer.todoist.com/?shell#update-multiple-ordersindents

Options:

  • :uuid Unique string ID for the command: It will be automatically generated if not passed.