Task Parent#
pyticktick.models.v2.parameters.task_parent
#
Parameters for setting and unsetting parent tasks via the V2 API.
Unofficial API
These models are part of the unofficial TickTick API. They were created by reverse engineering the API. They may be incomplete or inaccurate.
Classes:
| Name | Description |
|---|---|
PostBatchTaskParentV2 |
Model for setting and unsetting parent tasks via the V2 API. |
SetTaskParentV2 |
Model for setting a parent task via the V2 API. |
UnSetTaskParentV2 |
Model for unsetting a parent task via the V2 API. |
PostBatchTaskParentV2
#
Bases: RootModel[list[SetTaskParentV2 | UnSetTaskParentV2]]
Model for setting and unsetting parent tasks via the V2 API.
This model is used to set and unset parent tasks via the V2 API. This is not
currently documented or supported in the official API docs. This is used as the
payload in the POST /batch/taskParent endpoint. It can contain a list of both
SetTaskParentV2 and UnSetTaskParentV2 models. The API will process the list
and set or unset the parent tasks as needed.
SetTaskParentV2
pydantic-model
#
Bases: BaseModelV2
Model for setting a parent task via the V2 API.
This model is used to set a parent task via the V2 API. This is not currently
documented or supported in the official API docs. This is used as the payload in the
POST /batch/taskParent endpoint.
Show JSON schema:
{
"additionalProperties": false,
"description": "Model for setting a parent task via the V2 API.\n\nThis model is used to set a parent task via the V2 API. This is not currently\ndocumented or supported in the official API docs. This is used as the payload in the\n`POST /batch/taskParent` endpoint.",
"properties": {
"parent_id": {
"description": "ID of the task to set as the parent",
"title": "Parent Id",
"type": "string"
},
"project_id": {
"description": "ID of the project for both tasks",
"title": "Project Id",
"type": "string"
},
"task_id": {
"description": "ID of the task to set the parent for",
"title": "Task Id",
"type": "string"
}
},
"required": [
"parent_id",
"project_id",
"task_id"
],
"title": "SetTaskParentV2",
"type": "object"
}
Fields:
-
parent_id(str) -
project_id(str) -
task_id(str)
Validators:
empty_str_to_none
pydantic-validator
#
empty_str_to_none(v: Any) -> Any
Convert empty strings to None.
TickTick API responses sometimes conflates None and empty strings for
optional fields. This validator ensures that empty strings are converted to
None, which then allows for more consistent handling of the data within the
library.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
v
|
Any
|
The value to validate. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Any |
Any
|
The input value if it is not an empty string, otherwise |
Source code in src/pyticktick/models/v2/models.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
override_forbid_extra_message_injector
pydantic-validator
#
override_forbid_extra_message_injector(
data: Any,
handler: ModelWrapValidatorHandler[BaseModelV2],
) -> BaseModelV2
Provide a better error message for extra fields.
The TickTick V2 API is unofficial and may change without notice. As such, the
models may not always be up to date with the API. This validator catches the
extra_forbidden errors and provides a more informative error message,
including a link to the documentation on how to override the extra_forbidden
behavior if needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Any
|
The input data to validate. |
required |
handler
|
ModelWrapValidatorHandler[BaseModelV2]
|
The handler to call the next validator in the chain. |
required |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If the pydantic model fails validation for any reason. |
Returns:
| Name | Type | Description |
|---|---|---|
BaseModelV2 |
BaseModelV2
|
The validated model instance. |
Source code in src/pyticktick/models/v2/models.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | |
UnSetTaskParentV2
pydantic-model
#
Bases: BaseModelV2
Model for unsetting a parent task via the V2 API.
This model is used to unset a parent task via the V2 API. This is not currently
documented or supported in the official API docs. This is used as the payload in the
POST /batch/taskParent endpoint.
Show JSON schema:
{
"additionalProperties": false,
"description": "Model for unsetting a parent task via the V2 API.\n\nThis model is used to unset a parent task via the V2 API. This is not currently\ndocumented or supported in the official API docs. This is used as the payload in the\n`POST /batch/taskParent` endpoint.",
"properties": {
"old_parent_id": {
"description": "ID of the task to unset as the parent",
"title": "Old Parent Id",
"type": "string"
},
"project_id": {
"description": "ID of the project for both tasks",
"title": "Project Id",
"type": "string"
},
"task_id": {
"description": "ID of the task to unset the parent for",
"title": "Task Id",
"type": "string"
}
},
"required": [
"old_parent_id",
"project_id",
"task_id"
],
"title": "UnSetTaskParentV2",
"type": "object"
}
Fields:
-
old_parent_id(str) -
project_id(str) -
task_id(str)
Validators:
empty_str_to_none
pydantic-validator
#
empty_str_to_none(v: Any) -> Any
Convert empty strings to None.
TickTick API responses sometimes conflates None and empty strings for
optional fields. This validator ensures that empty strings are converted to
None, which then allows for more consistent handling of the data within the
library.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
v
|
Any
|
The value to validate. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Any |
Any
|
The input value if it is not an empty string, otherwise |
Source code in src/pyticktick/models/v2/models.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
override_forbid_extra_message_injector
pydantic-validator
#
override_forbid_extra_message_injector(
data: Any,
handler: ModelWrapValidatorHandler[BaseModelV2],
) -> BaseModelV2
Provide a better error message for extra fields.
The TickTick V2 API is unofficial and may change without notice. As such, the
models may not always be up to date with the API. This validator catches the
extra_forbidden errors and provides a more informative error message,
including a link to the documentation on how to override the extra_forbidden
behavior if needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Any
|
The input data to validate. |
required |
handler
|
ModelWrapValidatorHandler[BaseModelV2]
|
The handler to call the next validator in the chain. |
required |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If the pydantic model fails validation for any reason. |
Returns:
| Name | Type | Description |
|---|---|---|
BaseModelV2 |
BaseModelV2
|
The validated model instance. |
Source code in src/pyticktick/models/v2/models.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | |