api_docs: Move get-events-from-queue fixture to fixtures.json.

Note that this is one of the few fixtures that isn't tested against
a running server. But it still makes sense to move it to fixtures.json so
that it is rendered with indenting and a space after every `:` by
the api_code_example extension.
This commit is contained in:
Eeshan Garg 2018-03-02 17:21:56 -03:30 committed by Tim Abbott
parent 13664f1289
commit 393b9eec99
2 changed files with 62 additions and 65 deletions

View File

@ -317,5 +317,66 @@
"msg":"",
"result":"success",
"uri":"\/user_uploads\/1\/4e\/m2A3MSqFnWRLUf9SaPzQ0Up_\/zulip.txt"
},
"get-events-from-queue": {
"events":[
{
"id":0,
"message":{
"avatar_url":"https:\/\/url\/for\/othello-bots\/avatar",
"client":"website",
"content":"Something is rotten in the state of Denmark.",
"content_type":"text\/x-markdown",
"display_recipient":"Denmark",
"id":12345678,
"recipient_id":12314,
"sender_email":"othello-bot@example.com",
"sender_full_name":"Othello Bot",
"sender_id":13215,
"sender_realm_str":"example",
"sender_short_name":"othello-bot",
"subject":"Castle",
"subject_links":[
],
"timestamp":1375978403,
"type":"stream"
},
"type":"message"
},
{
"id":1,
"message":{
"avatar_url":"https:\/\/url\/for\/othello-bots\/avatar",
"client":"website",
"content":"I come not, friends, to steal away your hearts.",
"content_type":"text\/x-markdown",
"display_recipient":[
{
"email":"hamlet@example.com",
"full_name":"Hamlet of Denmark",
"id":31572,
"short_name":"hamlet"
}
],
"id":12345679,
"recipient_id":18391,
"sender_email":"othello-bot@example.com",
"sender_full_name":"Othello Bot",
"sender_id":13215,
"sender_realm_str":"example",
"sender_short_name":"othello-bot",
"subject":"",
"subject_links":[
],
"timestamp":1375978404,
"type":"private"
},
"type":"message"
}
],
"msg":"",
"result":"success"
}
}

View File

@ -119,68 +119,4 @@ You may also pass in the following keyword arguments to `call_on_each_event`:
A typical successful JSON response may look like:
```
{
'result':'success',
'msg':'',
'events':[
{
'type':'message',
'id':0,
'message':{
'content_type':'text/x-markdown',
'avatar_url':'https://url/for/othello-bots/avatar',
'timestamp':1375978403,
'display_recipient':'Denmark',
'sender_id':13215,
'sender_full_name':'Othello Bot',
'sender_email':'othello-bot@example.com',
'sender_short_name':'othello-bot',
'sender_realm_str':'example',
'content':'Something is rotten in the state of Denmark.',
'recipient_id':12314,
'client':'website',
'subject_links':[
],
'subject':'Castle',
'type':'stream',
'id':12345678,
}
},
{
'type':'message',
'id':1,
'message':{
'content_type':'text/x-markdown',
'avatar_url':'https://url/for/othello-bots/avatar',
'timestamp':1375978404,
'display_recipient':[
{
'full_name':'Hamlet of Denmark',
'email':'hamlet@example.com',
'short_name':'hamlet',
'id':31572
}
],
'sender_id':13215,
'sender_full_name':'Othello Bot',
'sender_email':'othello-bot@example.com',
'sender_short_name':'othello-bot',
'sender_realm_str':'example',
'content':'I come not, friends, to steal away your hearts.',
'recipient_id':18391,
'client':'website',
'subject_links':[
],
'subject':'',
'type':'private',
'id':12345679,
}
}
]
}
```
{generate_code_example|get-events-from-queue|fixture}