encoded.py 1.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
"""
    schemas: Encoded (compiled) type messages that are applicable to compiled
    platform statuses and observations (from the platform), and compiled
    mission plans (to the platform). This encoded schema is applicable to the
    different message types: mission_plan_encoded, observation_encoded, and
    platform_status_encoded.
"""

encoded_schema = {
    "type": "object",
    "properties": {
        "message_type": {
            "type": "string",
            "description": "Type of message",
        },
        "data": {
            "type": "string",
18
            "description": "encoded string. E.g. Base64 encoded",
19 20 21 22 23 24 25 26 27 28 29
            "example": "SDQke4uwyP/YQQAgAhA2AND/nu8nvQAAAAAAAAAACtejPa5HHUGkcB"
            + "AAAAIAAAAQAAAAAAAAAA9P2cP166ab+9cg==",
        },
        "file_name": {
            "type": "string",
            "description": "Name of file",
            "example": "ah1-0238126349247372.bin",
        },
        "mime_type": {
            "type": "string",
            "description": "MIME type",
30
            "example": "application/gzip",
31 32 33
        },
        "is_binary": {
            "type": "boolean",
34 35 36 37
            "description": (
                "True if the data field contains binary format data encoded as base64."
                + " False if the data field contains ascii content such as NMEA."
            ),
38 39 40 41 42
            "example": True,
        },
    },
    "required": ["data", "is_binary"],
}