googleapis / googleapis/google-api-nodejs-client
GMail users.messages.list ignores labels when sent as an array
- Dominant language
- TypeScript
- Stars
- 12.2k
- Forks
- 2k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 24
Description
#### Environment details
- OS: mac
- Node.js version: v14.17.0
- npm version: 6.14.13
- `googleapis` version: ^100.0.0
#### Steps to reproduce
```ts
const optionsA = {
userId: 'me',
}
const optionsB = {
userId: 'me',
labelIds: ['SENT']
}
const optionsC = {
userId: 'me',
labelIds: 'SENT'
}
gmailClient.users.messages.list(optionsA); // --> returns messages
gmailClient.users.messages.list(optionsB); // --> returns the same messages as optionsA
gmailClient.users.messages.list(optionsC); // --> returns messages with the label 'SENT'
```
The params for list state that labelIds is an array:
```ts
export interface Params$Resource$Users$Messages$List extends StandardParameters {
/**
* Only return messages with labels that match all of the specified label IDs.
*/
labelIds?: string[];
}
```
Not sure if this is a documentation + TS Definition issue or something deeper
Contributor guide
Assessment
This issue has not been assessed yet.