{
    "type": "object",
    "properties": {
        "id": {
            "type": "integer"
        },
        "number": {
            "type": "integer"
        },
        "threads": {
            "type": "integer"
        },
        "type": {
            "type": "string"
        },
        "folderId": {
            "type": "integer"
        },
        "status": {
            "type": "string"
        },
        "state": {
            "type": "string"
        },
        "subject": {
            "type": "string"
        },
        "preview": {
            "type": "string"
        },
        "mailboxId": {
            "type": "integer"
        },
        "createdBy": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "type": {
                    "type": "string"
                },
                "first": {
                    "type": "string"
                },
                "last": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "photoUrl": {
                    "type": "string"
                }
            },
            "required": [
                "id",
                "type",
                "first",
                "last",
                "email"
            ]
        },
        "createdAt": {
            "type": "string"
        },
        "closedBy": {
            "type": "integer"
        },
        "closedByUser": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "type": {
                    "type": "string"
                },
                "first": {
                    "type": "string"
                },
                "last": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                }
            },
            "required": [
                "id",
                "type",
                "first",
                "last",
                "email"
            ]
        },
        "userUpdatedAt": {
            "type": "string"
        },
        "customerWaitingSince": {
            "type": "object",
            "properties": {
                "time": {
                    "type": "string"
                },
                "friendly": {
                    "type": "string"
                }
            },
            "required": [
                "time",
                "friendly"
            ]
        },
        "source": {
            "type": "object",
            "properties": {
                "type": {
                    "type": "string"
                },
                "via": {
                    "type": "string"
                }
            },
            "required": [
                "type",
                "via"
            ]
        },
        "tags": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "color": {
                        "type": "string"
                    },
                    "tag": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "color",
                    "tag"
                ]
            }
        },
        "cc": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "bcc": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "primaryCustomer": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "type": {
                    "type": "string"
                },
                "first": {
                    "type": "string"
                },
                "last": {
                    "type": "string"
                },
                "photoUrl": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                }
            },
            "required": [
                "id",
                "type",
                "first",
                "last",
                "photoUrl",
                "email"
            ]
        },
        "customFields": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "value": {
                        "type": "string"
                    },
                    "text": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "value",
                    "text"
                ]
            }
        },
        "_embedded": {
            "type": "object",
            "properties": {
                "threads": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "type": {
                                "type": "string"
                            },
                            "status": {
                                "type": "string"
                            },
                            "state": {
                                "type": "string"
                            },
                            "action": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string"
                                    },
                                    "associatedEntities": {
                                        "type": "object",
                                        "properties": {
                                            "user": {
                                                "type": "integer"
                                            }
                                        }
                                    }
                                },
                                "required": [
                                    "type",
                                    "associatedEntities"
                                ]
                            },
                            "body": {
                                "type": "string"
                            },
                            "source": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string"
                                    },
                                    "via": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "type",
                                    "via"
                                ]
                            },
                            "customer": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "integer"
                                    },
                                    "first": {
                                        "type": "string"
                                    },
                                    "last": {
                                        "type": "string"
                                    },
                                    "photoUrl": {
                                        "type": "string"
                                    },
                                    "email": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "id",
                                    "first",
                                    "last",
                                    "photoUrl",
                                    "email"
                                ]
                            },
                            "createdBy": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "integer"
                                    },
                                    "type": {
                                        "type": "string"
                                    },
                                    "first": {
                                        "type": "string"
                                    },
                                    "last": {
                                        "type": "string"
                                    },
                                    "email": {
                                        "type": "string"
                                    },
                                    "photoUrl": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "id",
                                    "type",
                                    "first",
                                    "last",
                                    "email"
                                ]
                            },
                            "assignedTo": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "integer"
                                    },
                                    "first": {
                                        "type": "string"
                                    },
                                    "last": {
                                        "type": "string"
                                    },
                                    "email": {
                                        "type": "string"
                                    },
                                    "type": {
                                        "type": "string"
                                    },
                                    "photoUrl": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "id",
                                    "first",
                                    "last",
                                    "email"
                                ]
                            },
                            "to": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            },
                            "createdAt": {
                                "type": "string"
                            },
                            "_embedded": {
                                "type": "object",
                                "properties": {
                                    "attachments": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "filename": {
                                                    "type": "string"
                                                },
                                                "mimeType": {
                                                    "type": "string"
                                                },
                                                "width": {
                                                    "type": "integer"
                                                },
                                                "height": {
                                                    "type": "integer"
                                                },
                                                "size": {
                                                    "type": "integer"
                                                },
                                                "state": {
                                                    "type": "string"
                                                },
                                                "_links": {
                                                    "type": "object",
                                                    "properties": {
                                                        "self": {
                                                            "type": "object",
                                                            "properties": {
                                                                "href": {
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": [
                                                                "href"
                                                            ]
                                                        },
                                                        "data": {
                                                            "type": "object",
                                                            "properties": {
                                                                "href": {
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": [
                                                                "href"
                                                            ]
                                                        },
                                                        "web": {
                                                            "type": "object",
                                                            "properties": {
                                                                "href": {
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": [
                                                                "href"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "self",
                                                        "data",
                                                        "web"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "filename",
                                                "mimeType",
                                                "width",
                                                "height",
                                                "size",
                                                "state",
                                                "_links"
                                            ]
                                        }
                                    }
                                },
                                "required": [
                                    "attachments"
                                ]
                            },
                            "_links": {
                                "type": "object",
                                "properties": {
                                    "assignedTo": {
                                        "type": "object",
                                        "properties": {
                                            "href": {
                                                "type": "string"
                                            }
                                        },
                                        "required": [
                                            "href"
                                        ]
                                    },
                                    "createdByUser": {
                                        "type": "object",
                                        "properties": {
                                            "href": {
                                                "type": "string"
                                            }
                                        },
                                        "required": [
                                            "href"
                                        ]
                                    },
                                    "customer": {
                                        "type": "object",
                                        "properties": {
                                            "href": {
                                                "type": "string"
                                            }
                                        },
                                        "required": [
                                            "href"
                                        ]
                                    },
                                    "createdByCustomer": {
                                        "type": "object",
                                        "properties": {
                                            "href": {
                                                "type": "string"
                                            }
                                        },
                                        "required": [
                                            "href"
                                        ]
                                    }
                                }
                            },
                            "savedReplyId": {
                                "type": "integer"
                            }
                        },
                        "required": [
                            "id",
                            "type",
                            "action",
                            "source",
                            "createdBy",
                            "to",
                            "cc",
                            "bcc",
                            "createdAt",
                            "_embedded",
                            "_links"
                        ]
                    }
                }
            },
            "required": [
                "threads"
            ]
        },
        "_links": {
            "type": "object",
            "properties": {
                "self": {
                    "type": "object",
                    "properties": {
                        "href": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "href"
                    ]
                },
                "mailbox": {
                    "type": "object",
                    "properties": {
                        "href": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "href"
                    ]
                },
                "primaryCustomer": {
                    "type": "object",
                    "properties": {
                        "href": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "href"
                    ]
                },
                "closedBy": {
                    "type": "object",
                    "properties": {
                        "href": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "href"
                    ]
                },
                "threads": {
                    "type": "object",
                    "properties": {
                        "href": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "href"
                    ]
                },
                "web": {
                    "type": "object",
                    "properties": {
                        "href": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "href"
                    ]
                },
                "createdByCustomer": {
                    "type": "object",
                    "properties": {
                        "href": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "href"
                    ]
                }
            },
            "required": [
                "self",
                "mailbox",
                "primaryCustomer",
                "closedBy",
                "threads",
                "web"
            ]
        }
    },
    "required": [
        "id",
        "number",
        "threads",
        "type",
        "folderId",
        "status",
        "state",
        "preview",
        "mailboxId",
        "createdBy",
        "createdAt",
        "closedBy",
        "closedByUser",
        "userUpdatedAt",
        "customerWaitingSince",
        "source",
        "tags",
        "cc",
        "bcc",
        "primaryCustomer",
        "customFields",
        "_embedded",
        "_links"
    ],
    "version": 1
}
