{
  "protocol": "chatLocal",
  "imports": [
    {
      "path": "github.com/keybase/client/go/protocol/chat1",
      "type": "idl",
      "import_as": "chat1"
    },
    {
      "path": "common.avdl",
      "type": "idl"
    }
  ],
  "types": [
    {
      "type": "record",
      "name": "MessageText",
      "fields": [
        {
          "type": "string",
          "name": "body"
        }
      ]
    },
    {
      "type": "record",
      "name": "MessageConversationMetadata",
      "fields": [
        {
          "type": "string",
          "name": "conversationTitle"
        }
      ]
    },
    {
      "type": "record",
      "name": "MessageEdit",
      "fields": [
        {
          "type": "chat1.MessageID",
          "name": "messageID"
        },
        {
          "type": "string",
          "name": "body"
        }
      ]
    },
    {
      "type": "record",
      "name": "MessageDelete",
      "fields": [
        {
          "type": "chat1.MessageID",
          "name": "messageID"
        }
      ]
    },
    {
      "type": "record",
      "name": "MessageAttachment",
      "fields": [
        {
          "type": "string",
          "name": "path"
        }
      ]
    },
    {
      "type": "record",
      "name": "MessageBody",
      "fields": [
        {
          "type": "chat1.MessageType",
          "name": "type"
        },
        {
          "type": [
            null,
            "MessageText"
          ],
          "name": "text"
        },
        {
          "type": [
            null,
            "MessageAttachment"
          ],
          "name": "attachment"
        },
        {
          "type": [
            null,
            "MessageEdit"
          ],
          "name": "edit"
        },
        {
          "type": [
            null,
            "MessageDelete"
          ],
          "name": "delete"
        },
        {
          "type": [
            null,
            "MessageConversationMetadata"
          ],
          "name": "conversationMetadata"
        }
      ]
    },
    {
      "type": "record",
      "name": "MessagePlaintext",
      "fields": [
        {
          "type": "chat1.MessageClientHeader",
          "name": "clientHeader"
        },
        {
          "type": {
            "type": "array",
            "items": "MessageBody"
          },
          "name": "messageBodies"
        }
      ]
    },
    {
      "type": "record",
      "name": "Message",
      "fields": [
        {
          "type": "chat1.MessageServerHeader",
          "name": "serverHeader"
        },
        {
          "type": "MessagePlaintext",
          "name": "messagePlaintext"
        },
        {
          "type": "boolean",
          "name": "isNew"
        }
      ]
    },
    {
      "type": "record",
      "name": "ThreadView",
      "fields": [
        {
          "type": {
            "type": "array",
            "items": "Message"
          },
          "name": "messages"
        },
        {
          "type": [
            null,
            "chat1.Pagination"
          ],
          "name": "pagination"
        }
      ]
    },
    {
      "type": "record",
      "name": "MessageSelector",
      "fields": [
        {
          "type": {
            "type": "array",
            "items": "chat1.MessageType"
          },
          "name": "MessageTypes"
        },
        {
          "type": [
            null,
            "Time"
          ],
          "name": "After"
        },
        {
          "type": [
            null,
            "Time"
          ],
          "name": "Before"
        },
        {
          "type": "boolean",
          "name": "onlyNew"
        },
        {
          "type": "int",
          "name": "limitPerConversation"
        },
        {
          "type": "int",
          "name": "limitOfConversations"
        },
        {
          "type": {
            "type": "array",
            "items": "chat1.ConversationID"
          },
          "name": "conversations"
        },
        {
          "type": "boolean",
          "name": "markAsRead"
        }
      ]
    },
    {
      "type": "record",
      "name": "ConversationMessagesLocal",
      "fields": [
        {
          "type": "chat1.ConversationID",
          "name": "id"
        },
        {
          "type": {
            "type": "array",
            "items": "Message"
          },
          "name": "messages"
        }
      ]
    }
  ],
  "messages": {
    "getInboxLocal": {
      "request": [
        {
          "name": "pagination",
          "type": [
            null,
            "chat1.Pagination"
          ]
        }
      ],
      "response": "chat1.InboxView"
    },
    "getThreadLocal": {
      "request": [
        {
          "name": "conversationID",
          "type": "chat1.ConversationID"
        },
        {
          "name": "markAsRead",
          "type": "boolean"
        },
        {
          "name": "pagination",
          "type": [
            null,
            "chat1.Pagination"
          ]
        }
      ],
      "response": "ThreadView"
    },
    "postLocal": {
      "request": [
        {
          "name": "conversationID",
          "type": "chat1.ConversationID"
        },
        {
          "name": "messagePlaintext",
          "type": "MessagePlaintext"
        }
      ],
      "response": null
    },
    "newConversationLocal": {
      "request": [
        {
          "name": "conversationTriple",
          "type": "chat1.ConversationIDTriple"
        }
      ],
      "response": "chat1.ConversationID"
    },
    "getOrCreateTextConversationLocal": {
      "request": [
        {
          "name": "tlfName",
          "type": "string"
        },
        {
          "name": "topicName",
          "type": "string"
        },
        {
          "name": "topicType",
          "type": "chat1.TopicType"
        }
      ],
      "response": "chat1.ConversationID"
    },
    "getMessagesLocal": {
      "request": [
        {
          "name": "selector",
          "type": "MessageSelector"
        }
      ],
      "response": {
        "type": "array",
        "items": "ConversationMessagesLocal"
      }
    },
    "completeAndCanonicalizeTlfName": {
      "request": [
        {
          "name": "tlfName",
          "type": "string"
        }
      ],
      "response": "CanonicalTlfName"
    }
  },
  "namespace": "keybase.1"
}