{
    "additionalProperties": false,
    "definitions": {
        "date-filter": {
            "additionalProperties": false,
            "properties": {
                "from": {
                    "_format": "date-time",
                    "title": "From filter",
                    "type": "string"
                },
                "to": {
                    "_format": "date-time",
                    "title": "To filter",
                    "type": "string"
                }
            },
            "type": "object"
        }
    },
    "dependencies": {
        "page": [
            "limit"
        ]
    },
    "description": "Returns filtered logs",
    "examples": [
        {
            "email": "test@test.com",
            "filter": {
                "delivered_at": {
                    "to": "2020-04-07T13:33:44+02:00"
                },
                "dropped_at": {},
                "hard_bounced_at": {
                    "from": "2020-04-07T13:33:44+02:00",
                    "to": "2020-06-07T13:33:44+02:00"
                },
                "spam_complained_at": {
                    "from": "2020-04-07T13:33:44+02:00"
                }
            },
            "limit": 3,
            "mail_template_ids": [
                1,
                2,
                3
            ],
            "page": 1
        }
    ],
    "properties": {
        "email": {
            "_format": "email",
            "type": "string"
        },
        "filter": {
            "additionalProperties": false,
            "description": "Apply filter on logs results",
            "properties": {
                "clicked_at": {
                    "$ref": "#/definitions/date-filter",
                    "title": "Clicked at filter"
                },
                "delivered_at": {
                    "$ref": "#/definitions/date-filter",
                    "title": "Delivered at filter"
                },
                "dropped_at": {
                    "$ref": "#/definitions/date-filter",
                    "title": "Dropped at filter"
                },
                "hard_bounced_at": {
                    "$ref": "#/definitions/date-filter",
                    "title": "Hard bounced at filter"
                },
                "opened_at": {
                    "$ref": "#/definitions/date-filter",
                    "title": "Opened at filter"
                },
                "sent_at": {
                    "$ref": "#/definitions/date-filter",
                    "title": "Sent at filter"
                },
                "spam_complained_at": {
                    "$ref": "#/definitions/date-filter",
                    "title": "Spam complained at filter"
                }
            },
            "title": "Advanced logs filter",
            "type": "object"
        },
        "limit": {
            "type": "integer"
        },
        "mail_template_ids": {
            "items": {
                "type": "integer"
            },
            "title": "Mail template ids",
            "type": "array"
        },
        "page": {
            "type": "integer"
        }
    },
    "required": [
        "email"
    ],
    "title": "Logs",
    "type": "object"
}