Removing unsupported getEmailMetadata method and adding modify method (#1590)

This commit is contained in:
alwestmo-openai 2024-12-02 16:34:23 -05:00 committed by GitHub
parent 52f70832e0
commit 0d524a1b12
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -164,12 +164,15 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"openapi: 3.1.0\n", "openapi: 3.1.0\n",
"\n",
"info:\n", "info:\n",
" title: Gmail Email API\n", " title: Gmail Email API\n",
" version: 1.0.0\n", " version: 1.0.0\n",
" description: API to read, write, and send emails in a Gmail account.\n", " description: API to read, write, and send emails in a Gmail account.\n",
"\n",
"servers:\n", "servers:\n",
" - url: https://gmail.googleapis.com\n", " - url: https://gmail.googleapis.com\n",
"\n",
"paths:\n", "paths:\n",
" /gmail/v1/users/{userId}/messages:\n", " /gmail/v1/users/{userId}/messages:\n",
" get:\n", " get:\n",
@ -197,6 +200,7 @@
" in: query\n", " in: query\n",
" schema:\n", " schema:\n",
" type: integer\n", " type: integer\n",
" format: int32\n",
" description: Maximum number of messages to return.\n", " description: Maximum number of messages to return.\n",
" responses:\n", " responses:\n",
" '200':\n", " '200':\n",
@ -215,6 +219,7 @@
" description: Not Found\n", " description: Not Found\n",
" '500':\n", " '500':\n",
" description: Internal Server Error\n", " description: Internal Server Error\n",
"\n",
" /gmail/v1/users/{userId}/messages/send:\n", " /gmail/v1/users/{userId}/messages/send:\n",
" post:\n", " post:\n",
" summary: Send Email\n", " summary: Send Email\n",
@ -248,6 +253,7 @@
" description: Forbidden\n", " description: Forbidden\n",
" '500':\n", " '500':\n",
" description: Internal Server Error\n", " description: Internal Server Error\n",
"\n",
" /gmail/v1/users/{userId}/messages/{id}:\n", " /gmail/v1/users/{userId}/messages/{id}:\n",
" get:\n", " get:\n",
" summary: Read Email\n", " summary: Read Email\n",
@ -283,11 +289,12 @@
" description: Not Found\n", " description: Not Found\n",
" '500':\n", " '500':\n",
" description: Internal Server Error\n", " description: Internal Server Error\n",
" /gmail/v1/users/{userId}/messages/{id}/metadata:\n", "\n",
" get:\n", " /gmail/v1/users/{userId}/messages/{id}/modify:\n",
" summary: Get Email Metadata\n", " post:\n",
" description: Gets the metadata of an email, including subject line.\n", " summary: Modify Label\n",
" operationId: getEmailMetadata\n", " description: Modify labels of an email.\n",
" operationId: modifyLabels\n",
" parameters:\n", " parameters:\n",
" - name: userId\n", " - name: userId\n",
" in: path\n", " in: path\n",
@ -300,24 +307,29 @@
" required: true\n", " required: true\n",
" schema:\n", " schema:\n",
" type: string\n", " type: string\n",
" description: The ID of the email to retrieve metadata for.\n", " description: The ID of the email to change labels.\n",
" requestBody:\n",
" required: true\n",
" content:\n",
" application/json:\n",
" schema:\n",
" $ref: '#/components/schemas/LabelModification'\n",
" responses:\n", " responses:\n",
" '200':\n", " '200':\n",
" description: Successful response\n", " description: Labels modified successfully\n",
" content:\n", " content:\n",
" application/json:\n", " application/json:\n",
" schema:\n", " schema:\n",
" $ref: '#/components/schemas/MessageMetadata'\n", " $ref: '#/components/schemas/Message'\n",
" '400':\n", " '400':\n",
" description: Bad Request\n", " description: Bad Request\n",
" '401':\n", " '401':\n",
" description: Unauthorized\n", " description: Unauthorized\n",
" '403':\n", " '403':\n",
" description: Forbidden\n", " description: Forbidden\n",
" '404':\n",
" description: Not Found\n",
" '500':\n", " '500':\n",
" description: Internal Server Error\n", " description: Internal Server Error\n",
"\n",
" /gmail/v1/users/{userId}/drafts:\n", " /gmail/v1/users/{userId}/drafts:\n",
" post:\n", " post:\n",
" summary: Create Draft\n", " summary: Create Draft\n",
@ -351,6 +363,41 @@
" description: Forbidden\n", " description: Forbidden\n",
" '500':\n", " '500':\n",
" description: Internal Server Error\n", " description: Internal Server Error\n",
"\n",
" /gmail/v1/users/{userId}/drafts/send:\n",
" post:\n",
" summary: Send Draft\n",
" description: Sends an existing email draft.\n",
" operationId: sendDraft\n",
" parameters:\n",
" - name: userId\n",
" in: path\n",
" required: true\n",
" schema:\n",
" type: string\n",
" description: The user's email address. Use \"me\" to indicate the authenticated user.\n",
" requestBody:\n",
" required: true\n",
" content:\n",
" application/json:\n",
" schema:\n",
" $ref: '#/components/schemas/SendDraftRequest'\n",
" responses:\n",
" '200':\n",
" description: Draft sent successfully\n",
" content:\n",
" application/json:\n",
" schema:\n",
" $ref: '#/components/schemas/Message'\n",
" '400':\n",
" description: Bad Request\n",
" '401':\n",
" description: Unauthorized\n",
" '403':\n",
" description: Forbidden\n",
" '500':\n",
" description: Internal Server Error\n",
"\n",
"components:\n", "components:\n",
" schemas:\n", " schemas:\n",
" MessageList:\n", " MessageList:\n",
@ -362,6 +409,7 @@
" $ref: '#/components/schemas/Message'\n", " $ref: '#/components/schemas/Message'\n",
" nextPageToken:\n", " nextPageToken:\n",
" type: string\n", " type: string\n",
"\n",
" Message:\n", " Message:\n",
" type: object\n", " type: object\n",
" properties:\n", " properties:\n",
@ -373,12 +421,21 @@
" type: array\n", " type: array\n",
" items:\n", " items:\n",
" type: string\n", " type: string\n",
" addLabelIds:\n",
" type: array\n",
" items:\n",
" type: string\n",
" removeLabelIds:\n",
" type: array\n",
" items:\n",
" type: string\n",
" snippet:\n", " snippet:\n",
" type: string\n", " type: string\n",
" raw:\n", " raw:\n",
" type: string\n", " type: string\n",
" format: byte\n", " format: byte\n",
" description: The entire email message in an RFC 2822 formatted and base64url encoded string.\n", " description: The entire email message in an RFC 2822 formatted and base64url encoded string.\n",
"\n",
" FullMessage:\n", " FullMessage:\n",
" type: object\n", " type: object\n",
" properties:\n", " properties:\n",
@ -416,28 +473,31 @@
" properties:\n", " properties:\n",
" data:\n", " data:\n",
" type: string\n", " type: string\n",
" MessageMetadata:\n", "\n",
" LabelModification:\n",
" type: object\n", " type: object\n",
" properties:\n", " properties:\n",
" id:\n", " addLabelIds:\n",
" type: string\n",
" threadId:\n",
" type: string\n",
" labelIds:\n",
" type: array\n", " type: array\n",
" items:\n", " items:\n",
" type: string\n", " type: string\n",
" snippet:\n", " removeLabelIds:\n",
" type: string\n",
" headers:\n",
" type: array\n", " type: array\n",
" items:\n", " items:\n",
" type: object\n", " type: string\n",
" properties:\n", "\n",
" name:\n", " Label:\n",
" type: string\n", " type: object\n",
" value:\n", " properties:\n",
" type: string\n", " addLabelIds:\n",
" type: array\n",
" items:\n",
" type: string\n",
" removeLabelIds:\n",
" type: array\n",
" items:\n",
" type: string\n",
"\n",
" EmailDraft:\n", " EmailDraft:\n",
" type: object\n", " type: object\n",
" properties:\n", " properties:\n",
@ -463,13 +523,24 @@
" enum: [text/plain, text/html]\n", " enum: [text/plain, text/html]\n",
" content:\n", " content:\n",
" type: string\n", " type: string\n",
"\n",
" Draft:\n", " Draft:\n",
" type: object\n", " type: object\n",
" properties:\n", " properties:\n",
" id:\n", " id:\n",
" type: string\n", " type: string\n",
" message:\n", " message:\n",
" $ref: '#/components/schemas/Message'" " $ref: '#/components/schemas/Message'\n",
"\n",
" SendDraftRequest:\n",
" type: object\n",
" properties:\n",
" draftId:\n",
" type: string\n",
" description: The ID of the draft to send.\n",
" userId:\n",
" type: string\n",
" description: The user's email address. Use \"me\" to indicate the authenticated user."
] ]
}, },
{ {