|
164 | 164 | "outputs": [], |
165 | 165 | "source": [ |
166 | 166 | "openapi: 3.1.0\n", |
| 167 | + "\n", |
167 | 168 | "info:\n", |
168 | 169 | " title: Gmail Email API\n", |
169 | 170 | " version: 1.0.0\n", |
170 | 171 | " description: API to read, write, and send emails in a Gmail account.\n", |
| 172 | + "\n", |
171 | 173 | "servers:\n", |
172 | 174 | " - url: https://gmail.googleapis.com\n", |
| 175 | + "\n", |
173 | 176 | "paths:\n", |
174 | 177 | " /gmail/v1/users/{userId}/messages:\n", |
175 | 178 | " get:\n", |
|
197 | 200 | " in: query\n", |
198 | 201 | " schema:\n", |
199 | 202 | " type: integer\n", |
| 203 | + " format: int32\n", |
200 | 204 | " description: Maximum number of messages to return.\n", |
201 | 205 | " responses:\n", |
202 | 206 | " '200':\n", |
|
215 | 219 | " description: Not Found\n", |
216 | 220 | " '500':\n", |
217 | 221 | " description: Internal Server Error\n", |
| 222 | + "\n", |
218 | 223 | " /gmail/v1/users/{userId}/messages/send:\n", |
219 | 224 | " post:\n", |
220 | 225 | " summary: Send Email\n", |
|
248 | 253 | " description: Forbidden\n", |
249 | 254 | " '500':\n", |
250 | 255 | " description: Internal Server Error\n", |
| 256 | + "\n", |
251 | 257 | " /gmail/v1/users/{userId}/messages/{id}:\n", |
252 | 258 | " get:\n", |
253 | 259 | " summary: Read Email\n", |
|
283 | 289 | " description: Not Found\n", |
284 | 290 | " '500':\n", |
285 | 291 | " description: Internal Server Error\n", |
286 | | - " /gmail/v1/users/{userId}/messages/{id}/metadata:\n", |
287 | | - " get:\n", |
288 | | - " summary: Get Email Metadata\n", |
289 | | - " description: Gets the metadata of an email, including subject line.\n", |
290 | | - " operationId: getEmailMetadata\n", |
| 292 | + "\n", |
| 293 | + " /gmail/v1/users/{userId}/messages/{id}/modify:\n", |
| 294 | + " post:\n", |
| 295 | + " summary: Modify Label\n", |
| 296 | + " description: Modify labels of an email.\n", |
| 297 | + " operationId: modifyLabels\n", |
291 | 298 | " parameters:\n", |
292 | 299 | " - name: userId\n", |
293 | 300 | " in: path\n", |
|
300 | 307 | " required: true\n", |
301 | 308 | " schema:\n", |
302 | 309 | " type: string\n", |
303 | | - " description: The ID of the email to retrieve metadata for.\n", |
| 310 | + " description: The ID of the email to change labels.\n", |
| 311 | + " requestBody:\n", |
| 312 | + " required: true\n", |
| 313 | + " content:\n", |
| 314 | + " application/json:\n", |
| 315 | + " schema:\n", |
| 316 | + " $ref: '#/components/schemas/LabelModification'\n", |
304 | 317 | " responses:\n", |
305 | 318 | " '200':\n", |
306 | | - " description: Successful response\n", |
| 319 | + " description: Labels modified successfully\n", |
307 | 320 | " content:\n", |
308 | 321 | " application/json:\n", |
309 | 322 | " schema:\n", |
310 | | - " $ref: '#/components/schemas/MessageMetadata'\n", |
| 323 | + " $ref: '#/components/schemas/Message'\n", |
311 | 324 | " '400':\n", |
312 | 325 | " description: Bad Request\n", |
313 | 326 | " '401':\n", |
314 | 327 | " description: Unauthorized\n", |
315 | 328 | " '403':\n", |
316 | 329 | " description: Forbidden\n", |
317 | | - " '404':\n", |
318 | | - " description: Not Found\n", |
319 | 330 | " '500':\n", |
320 | 331 | " description: Internal Server Error\n", |
| 332 | + "\n", |
321 | 333 | " /gmail/v1/users/{userId}/drafts:\n", |
322 | 334 | " post:\n", |
323 | 335 | " summary: Create Draft\n", |
|
351 | 363 | " description: Forbidden\n", |
352 | 364 | " '500':\n", |
353 | 365 | " description: Internal Server Error\n", |
| 366 | + "\n", |
| 367 | + " /gmail/v1/users/{userId}/drafts/send:\n", |
| 368 | + " post:\n", |
| 369 | + " summary: Send Draft\n", |
| 370 | + " description: Sends an existing email draft.\n", |
| 371 | + " operationId: sendDraft\n", |
| 372 | + " parameters:\n", |
| 373 | + " - name: userId\n", |
| 374 | + " in: path\n", |
| 375 | + " required: true\n", |
| 376 | + " schema:\n", |
| 377 | + " type: string\n", |
| 378 | + " description: The user's email address. Use \"me\" to indicate the authenticated user.\n", |
| 379 | + " requestBody:\n", |
| 380 | + " required: true\n", |
| 381 | + " content:\n", |
| 382 | + " application/json:\n", |
| 383 | + " schema:\n", |
| 384 | + " $ref: '#/components/schemas/SendDraftRequest'\n", |
| 385 | + " responses:\n", |
| 386 | + " '200':\n", |
| 387 | + " description: Draft sent successfully\n", |
| 388 | + " content:\n", |
| 389 | + " application/json:\n", |
| 390 | + " schema:\n", |
| 391 | + " $ref: '#/components/schemas/Message'\n", |
| 392 | + " '400':\n", |
| 393 | + " description: Bad Request\n", |
| 394 | + " '401':\n", |
| 395 | + " description: Unauthorized\n", |
| 396 | + " '403':\n", |
| 397 | + " description: Forbidden\n", |
| 398 | + " '500':\n", |
| 399 | + " description: Internal Server Error\n", |
| 400 | + "\n", |
354 | 401 | "components:\n", |
355 | 402 | " schemas:\n", |
356 | 403 | " MessageList:\n", |
|
362 | 409 | " $ref: '#/components/schemas/Message'\n", |
363 | 410 | " nextPageToken:\n", |
364 | 411 | " type: string\n", |
| 412 | + "\n", |
365 | 413 | " Message:\n", |
366 | 414 | " type: object\n", |
367 | 415 | " properties:\n", |
|
373 | 421 | " type: array\n", |
374 | 422 | " items:\n", |
375 | 423 | " type: string\n", |
| 424 | + " addLabelIds:\n", |
| 425 | + " type: array\n", |
| 426 | + " items:\n", |
| 427 | + " type: string\n", |
| 428 | + " removeLabelIds:\n", |
| 429 | + " type: array\n", |
| 430 | + " items:\n", |
| 431 | + " type: string\n", |
376 | 432 | " snippet:\n", |
377 | 433 | " type: string\n", |
378 | 434 | " raw:\n", |
379 | 435 | " type: string\n", |
380 | 436 | " format: byte\n", |
381 | 437 | " description: The entire email message in an RFC 2822 formatted and base64url encoded string.\n", |
| 438 | + "\n", |
382 | 439 | " FullMessage:\n", |
383 | 440 | " type: object\n", |
384 | 441 | " properties:\n", |
|
416 | 473 | " properties:\n", |
417 | 474 | " data:\n", |
418 | 475 | " type: string\n", |
419 | | - " MessageMetadata:\n", |
| 476 | + "\n", |
| 477 | + " LabelModification:\n", |
420 | 478 | " type: object\n", |
421 | 479 | " properties:\n", |
422 | | - " id:\n", |
423 | | - " type: string\n", |
424 | | - " threadId:\n", |
425 | | - " type: string\n", |
426 | | - " labelIds:\n", |
| 480 | + " addLabelIds:\n", |
427 | 481 | " type: array\n", |
428 | 482 | " items:\n", |
429 | 483 | " type: string\n", |
430 | | - " snippet:\n", |
431 | | - " type: string\n", |
432 | | - " headers:\n", |
| 484 | + " removeLabelIds:\n", |
| 485 | + " type: array\n", |
| 486 | + " items:\n", |
| 487 | + " type: string\n", |
| 488 | + "\n", |
| 489 | + " Label:\n", |
| 490 | + " type: object\n", |
| 491 | + " properties:\n", |
| 492 | + " addLabelIds:\n", |
| 493 | + " type: array\n", |
| 494 | + " items:\n", |
| 495 | + " type: string\n", |
| 496 | + " removeLabelIds:\n", |
433 | 497 | " type: array\n", |
434 | 498 | " items:\n", |
435 | | - " type: object\n", |
436 | | - " properties:\n", |
437 | | - " name:\n", |
438 | | - " type: string\n", |
439 | | - " value:\n", |
440 | | - " type: string\n", |
| 499 | + " type: string\n", |
| 500 | + "\n", |
441 | 501 | " EmailDraft:\n", |
442 | 502 | " type: object\n", |
443 | 503 | " properties:\n", |
|
463 | 523 | " enum: [text/plain, text/html]\n", |
464 | 524 | " content:\n", |
465 | 525 | " type: string\n", |
| 526 | + "\n", |
466 | 527 | " Draft:\n", |
467 | 528 | " type: object\n", |
468 | 529 | " properties:\n", |
469 | 530 | " id:\n", |
470 | 531 | " type: string\n", |
471 | 532 | " message:\n", |
472 | | - " $ref: '#/components/schemas/Message'" |
| 533 | + " $ref: '#/components/schemas/Message'\n", |
| 534 | + "\n", |
| 535 | + " SendDraftRequest:\n", |
| 536 | + " type: object\n", |
| 537 | + " properties:\n", |
| 538 | + " draftId:\n", |
| 539 | + " type: string\n", |
| 540 | + " description: The ID of the draft to send.\n", |
| 541 | + " userId:\n", |
| 542 | + " type: string\n", |
| 543 | + " description: The user's email address. Use \"me\" to indicate the authenticated user." |
473 | 544 | ] |
474 | 545 | }, |
475 | 546 | { |
|
0 commit comments