Skip to content

Commit

Permalink
Add metamessage by user route
Browse files Browse the repository at this point in the history
  • Loading branch information
VVoruganti committed Oct 10, 2024
1 parent 198adde commit 2fe0614
Show file tree
Hide file tree
Showing 2 changed files with 143 additions and 20 deletions.
158 changes: 138 additions & 20 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,7 @@
},
"/apps/{app_id}/users/{user_id}/sessions/{session_id}/metamessages": {
"post": {
"tags": ["messages"],
"tags": ["metamessages"],
"summary": "Create Metamessage",
"description": "Adds a message to a session\n\nArgs:\n app_id (uuid.UUID): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n session_id (int): The ID of the Session to add the message to\n metamessage (schemas.MeteamessageCreate): The metamessage creation object\n\nReturns:\n schemas.Metamessage: The Metamessage object of the added metamessage\n\nRaises:\n HTTPException: If the session is not found",
"operationId": "create_metamessage_apps__app_id__users__user_id__sessions__session_id__metamessages_post",
Expand Down Expand Up @@ -1678,7 +1678,7 @@
}
},
"get": {
"tags": ["messages"],
"tags": ["metamessages"],
"summary": "Get Metamessages",
"description": "Get all messages for a session\n\nArgs:\n app_id (uuid.UUID): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n session_id (int): The ID of the Session to retrieve\n reverse (bool): Whether to reverse the order of the metamessages\n\nReturns:\n list[schemas.Message]: List of Message objects\n\nRaises:\n HTTPException: If the session is not found",
"operationId": "get_metamessages_apps__app_id__users__user_id__sessions__session_id__metamessages_get",
Expand Down Expand Up @@ -1839,7 +1839,7 @@
},
"/apps/{app_id}/users/{user_id}/sessions/{session_id}/metamessages/{metamessage_id}": {
"get": {
"tags": ["messages"],
"tags": ["metamessages"],
"summary": "Get Metamessage",
"description": "Get a specific Metamessage by ID\n\nArgs:\n app_id (uuid.UUID): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n session_id (int): The ID of the Session to retrieve\n\nReturns:\n schemas.Session: The Session object of the requested Session\n\nRaises:\n HTTPException: If the session is not found",
"operationId": "get_metamessage_apps__app_id__users__user_id__sessions__session_id__metamessages__metamessage_id__get",
Expand Down Expand Up @@ -1925,7 +1925,7 @@
}
},
"put": {
"tags": ["messages"],
"tags": ["metamessages"],
"summary": "Update Metamessage",
"description": "Update's the metadata of a metamessage",
"operationId": "update_metamessage_apps__app_id__users__user_id__sessions__session_id__metamessages__metamessage_id__put",
Expand Down Expand Up @@ -2011,6 +2011,140 @@
}
}
},
"/apps/{app_id}/users/{user_id}/metamessages": {
"get": {
"tags": ["metamessages"],
"summary": "Get Metamessages By User",
"description": "Paginate through the user metamessages for a user\n\nArgs:\n app_id (uuid.UUID): The ID of the app representing the client application using honcho\n user_id (str): The User ID representing the user, managed by the user\n reverse (bool): Whether to reverse the order of the metamessages\n\nReturns:\n list[schemas.Message]: List of Message objects\n\nRaises:\n HTTPException: If the session is not found",
"operationId": "get_metamessages_by_user_apps__app_id__users__user_id__metamessages_get",
"security": [
{
"HTTPBearer": []
},
{}
],
"parameters": [
{
"name": "app_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "App Id"
}
},
{
"name": "user_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "User Id"
}
},
{
"name": "metamessage_type",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Metamessage Type"
}
},
{
"name": "reverse",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"title": "Reverse"
}
},
{
"name": "filter",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Filter"
}
},
{
"name": "page",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"description": "Page number",
"default": 1,
"title": "Page"
},
"description": "Page number"
},
{
"name": "size",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"maximum": 100,
"minimum": 1,
"description": "Page size",
"default": 50,
"title": "Size"
},
"description": "Page size"
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Page_Metamessage_"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/apps/{app_id}/users/{user_id}/collections": {
"get": {
"tags": ["collections"],
Expand Down Expand Up @@ -3037,21 +3171,6 @@
}
],
"title": "Queries"
},
"collections": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
],
"title": "Collections",
"default": "honcho"
}
},
"type": "object",
Expand Down Expand Up @@ -3923,4 +4042,3 @@
}
}
}

5 changes: 5 additions & 0 deletions openapi.stainless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ resources:
get_or_create: get /apps/{app_id}/users/get_or_create/{name}
update: put /apps/{app_id}/users/{user_id}
subresources:
metamessages:
methods:
list: get /apps/{app_id}/users/{user_id}/metamessages
models:
page_metamessage: Page_Metamessage_
sessions:
methods:
list: get /apps/{app_id}/users/{user_id}/sessions
Expand Down

0 comments on commit 2fe0614

Please sign in to comment.