}
end
+ def show_operation do
+ %Operation{
+ tags: ["chat"],
+ summary: "Create a chat",
+ operationId: "ChatController.show",
+ parameters: [
+ Operation.parameter(
+ :id,
+ :path,
+ :string,
+ "The id of the chat",
+ required: true,
+ example: "1234"
+ )
+ ],
+ responses: %{
+ 200 =>
+ Operation.response(
+ "The existing chat",
+ "application/json",
+ Chat
+ )
+ },
+ security: [
+ %{
+ "oAuth" => ["read"]
+ }
+ ]
+ }
+ end
+
def create_operation do
%Operation{
tags: ["chat"],
}
end
+ def delete_message_operation do
+ %Operation{
+ tags: ["chat"],
+ summary: "delete_message",
+ operationId: "ChatController.delete_message",
+ parameters: [
+ Operation.parameter(:id, :path, :string, "The ID of the Chat"),
+ Operation.parameter(:message_id, :path, :string, "The ID of the message")
+ ],
+ responses: %{
+ 200 =>
+ Operation.response(
+ "The deleted ChatMessage",
+ "application/json",
+ ChatMessage
+ )
+ },
+ security: [
+ %{
+ "oAuth" => ["write"]
+ }
+ ]
+ }
+ end
+
def chats_response do
%Schema{
title: "ChatsResponse",
description: "POST body for creating an chat message",
type: :object,
properties: %{
- content: %Schema{type: :string, description: "The content of your message"}
+ content: %Schema{type: :string, description: "The content of your message"},
+ media_id: %Schema{type: :string, description: "The id of an upload"}
},
required: [:content],
example: %{
- "content" => "Hey wanna buy feet pics?"
+ "content" => "Hey wanna buy feet pics?",
+ "media_id" => "134234"
}
}
end