//native
/**
* Update an external user
* Update a user in an external provider that is currently linked to a Sentry user.
*/
export async function main(auth: RT.Sentry, external_user_id: string, body: Body) {
const url = new URL(
`https://${auth.region}.sentry.io/api/0/organizations/${auth.organizationSlug}/external-users/${external_user_id}/`
)
const response = await fetch(url, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer ' + auth.token
},
body: JSON.stringify(body)
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
/* eslint-disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
/**
* Allows parameters to be defined in snake case, but passed as camel case.
*
* Errors are output in camel case.
*/
export interface Body {
/**
* The user ID in Sentry.
*/
user_id: number
/**
* The associated name for the provider.
*/
external_name: string
/**
* The provider of the external actor.
*
* * `github`
* * `github_enterprise`
* * `jira_server`
* * `slack`
* * `gitlab`
* * `msteams`
* * `custom_scm`
*/
provider:
| 'github'
| 'github_enterprise'
| 'jira_server'
| 'slack'
| 'gitlab'
| 'msteams'
| 'custom_scm'
/**
* The Integration ID.
*/
integration_id: number
/**
* The external actor ID.
*/
id: number
/**
* The associated user ID for provider.
*/
external_id?: string
[k: string]: unknown
}
Submitted by hugo697 235 days ago