//native
type Render = {
apiKey: string
}
/**
* Retrieve notification settings
* Retrieve notification settings for the owner with the provided ID.
Note that you provide an owner ID to this endpoint, not the ID for a particular resource.
*/
export async function main(auth: Render, ownerId: string) {
const url = new URL(`https://api.render.com/v1/notification-settings/owners/${ownerId}`)
const response = await fetch(url, {
method: 'GET',
headers: {
Authorization: 'Bearer ' + auth.apiKey
},
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