//native
/**
* Create an external team
* Link a team from an external provider to a Sentry team.
*/
export async function main(auth: RT.Sentry, team_id_or_slug: string, body: Body) {
const url = new URL(
`https://${auth.region}.sentry.io/api/0/teams/${auth.organizationSlug}/${team_id_or_slug}/external-teams/`
)
const response = await fetch(url, {
method: 'POST',
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 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 associated user ID for provider.
*/
external_id?: string
[k: string]: unknown
}
Submitted by hugo697 235 days ago