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
Specs
add(Todoist.WriteRequest.t, binary, Keyword.t) :: Todoist.WriteRequest.t
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"}}]
Specs
archive(Todoist.WriteRequest.t, list, Keyword.t) :: Todoist.WriteRequest.t
archive(Todoist.WriteRequest.t, integer | binary | atom, Keyword.t) :: Todoist.WriteRequest.t
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"}}]
Specs
delete(Todoist.WriteRequest.t, list, Keyword.t) :: Todoist.WriteRequest.t
delete(Todoist.WriteRequest.t, integer | binary | atom, Keyword.t) :: Todoist.WriteRequest.t
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"}}]
Specs
unarchive(Todoist.WriteRequest.t, list, Keyword.t) :: Todoist.WriteRequest.t
unarchive(Todoist.WriteRequest.t, integer | binary | atom, Keyword.t) :: Todoist.WriteRequest.t
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"}}]
Specs
update(Todoist.WriteRequest.t, binary | integer, Keyword.t) :: Todoist.WriteRequest.t
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"}}]
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.