encoded.py 1.48 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
"""
    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",
            "example": "mission_plan",
            "enum": [
                "mission_plan_encoded",
                "observation_encoded",
                "platform_status_encoded",
            ],
        },
        "data": {
            "type": "string",
            "description": "Base64 encoded string",
25
            "contentEncoding": "base64",
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
            "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",
            "example": "",  # TODO: Add example
        },
        "is_binary": {
            "type": "boolean",
            "description": "Base64 encrypted binary data",
            "example": True,
        },
    },
    "required": ["data", "is_binary"],
}