I'm attempting to script branch permissions for repos in Bitbucket Cloud, as there's no way to apply permissions per Project/Team. I'm having trouble with the JSON payload. There is an example request here, but the example request is confusing and frustratingly can't be copied/pasted, even. I am making the call with Powershell, and intended to have the JSON payload defined in it's own JSON file that I'll pass into the call.
https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/branch-restrictions
For example, I'm not sure what href or name to input here-
links: {
self: {
href: string (uri)
name: string
}
}I've tried a bunch of different ways, but always receive a 400 error with no actual message indicating what isn't correct. The call itself is making it (I can GET branch permissions that I've set up in the UI), so I'm assuming my JSON just isn't formatted correctly or is missing something. Does anyone have any examples of JSON they are using to successfully set branch permissions?