//native
type Linode = {
token: string;
};
/**
* Mark an event as seen
* Marks all Events up to and including this Event by ID as seen.
>
---
- __CLI__.
```
linode-cli events mark-seen 123
```
[Learn more...](https://techdocs.akamai.com/cloud-computing/docs/getting-started-with-the-linode-cli)
- __OAuth scopes__.
```
events:read_only
```
[Learn more...](https://techdocs.akamai.com/linode-api/reference/get-started#oauth)
*/
export async function main(
auth: Linode,
apiVersion: "v4" | "v4beta",
eventId: string,
) {
const url = new URL(
`https://api.linode.com/${apiVersion}/account/events/${eventId}/seen`,
);
const response = await fetch(url, {
method: "POST",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 235 days ago