Task Parent#
pyticktick.models.v2.responses.task_parent
#
Response for a batch task parent POST
request 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 |
---|---|
BatchTaskParentRespV2 |
Model for the response of a batch task parent request via the V2 API. |
BatchTaskParentRespValueV2 |
Model for the nested values of a batch task parent response via the V2 API. |
BatchTaskParentRespV2
pydantic-model
#
Bases: BaseModelV2
Model for the response of a batch task parent request via the V2 API.
The id2etag
and id2error
fields return the objectId
field as the key like
the BatchRespV2
model. Unlike the BatchRespV2
model, the values provided are
more complex and informative than just an ETag
.
Show JSON schema:
{
"$defs": {
"BatchTaskParentRespValueV2": {
"additionalProperties": false,
"description": "Model for the nested values of a batch task parent response via the V2 API.",
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"parentId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Parentid"
},
"childIds": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Childids"
},
"etag": {
"pattern": "^[a-z0-9]{8}$",
"title": "Etag",
"type": "string"
}
},
"required": [
"id",
"etag"
],
"title": "BatchTaskParentRespValueV2",
"type": "object"
}
},
"additionalProperties": false,
"description": "Model for the response of a batch task parent request via the V2 API.\n\nThe `id2etag` and `id2error` fields return the `objectId` field as the key like\nthe `BatchRespV2` model. Unlike the `BatchRespV2` model, the values provided are\nmore complex and informative than just an `ETag`.",
"properties": {
"id2error": {
"additionalProperties": {
"type": "string"
},
"description": "Mapping of tasks that failed to be updated",
"title": "Id2Error",
"type": "object"
},
"id2etag": {
"additionalProperties": {
"$ref": "#/$defs/BatchTaskParentRespValueV2"
},
"description": "Mapping of tasks that were successfully updated",
"title": "Id2Etag",
"type": "object"
}
},
"required": [
"id2error",
"id2etag"
],
"title": "BatchTaskParentRespV2",
"type": "object"
}
Fields:
-
id2error
(dict[ObjectId, str]
) -
id2etag
(dict[ObjectId, BatchTaskParentRespValueV2]
)
Validators:
id2etag
pydantic-field
#
id2etag: dict[ObjectId, BatchTaskParentRespValueV2]
Mapping of tasks that were successfully updated
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
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
BatchTaskParentRespValueV2
pydantic-model
#
Bases: BaseModelV2
Model for the nested values of a batch task parent response via the V2 API.
Show JSON schema:
{
"additionalProperties": false,
"description": "Model for the nested values of a batch task parent response via the V2 API.",
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"parentId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Parentid"
},
"childIds": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Childids"
},
"etag": {
"pattern": "^[a-z0-9]{8}$",
"title": "Etag",
"type": "string"
}
},
"required": [
"id",
"etag"
],
"title": "BatchTaskParentRespValueV2",
"type": "object"
}
Fields:
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
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|