Edits history of script submission #20327 for ' Update ownership configuration for a project (sentry)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    /**
     * Update ownership configuration for a project
     * Updates ownership configurations for a project. Note that only the
    attributes submitted are modified.
     */
    export async function main(auth: RT.Sentry, project_id_or_slug: string, body: Body) {
    	const url = new URL(
    		`https://${auth.region}.sentry.io/api/0/projects/${auth.organizationSlug}/${project_id_or_slug}/ownership/`
    	)
    
    	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.
     */
    
    export interface Body {
    	/**
    	 * Raw input for ownership configuration. See the [Ownership Rules Documentation](/product/issues/ownership-rules/) to learn more.
    	 */
    	raw?: string
    	/**
    	 * A boolean determining who to assign ownership to when an ownership rule has no match. If set to `True`, all project members are made owners. Otherwise, no owners are set.
    	 */
    	fallthrough?: boolean
    	/**
    	 * Auto-assignment settings. The available options are:
    	 * - Auto Assign to Issue Owner
    	 * - Auto Assign to Suspect Commits
    	 * - Turn off Auto-Assignment
    	 */
    	autoAssignment?: string
    	/**
    	 * Set to `True` to sync issue owners with CODEOWNERS updates in a release.
    	 */
    	codeownersAutoSync?: boolean
    	[k: string]: unknown
    }
    

    Submitted by hugo697 235 days ago