0

how to get child teams by parent team id using pygithub

I can't find any API Objects corresponding the following request

GET /teams/:team_id/teams
Jeff
  • 33
  • 4

1 Answers1

0

Not supported yet, see https://github.com/PyGithub/PyGithub/issues/1054#issuecomment-468543429

Nested Teams is still in beta, we don't current use the custom media type of hellcat-preview anywhere, so our API responses won't include them.

And from github docs https://developer.github.com/v3/teams/#list-child-teams :

At this time, the hellcat-preview media type is required to use this endpoint.

GET /teams/:team_id/teams

Community
  • 1
  • 1
duyue
  • 759
  • 5
  • 12
  • could you provide more details or example that using endpoint"GET /teams/:team_id/teams" – Jeff Apr 15 '19 at 10:30
  • @Jeff it's not supported by PyGithub for now, but we can hack it: ``status, headers, output = g._Github__requester.requestJson('GET', '/teams/{}/teams'.format(team_id), headers={'Accept': 'application/vnd.github.hellcat-preview+json'})`` – duyue Apr 15 '19 at 10:56
  • That’s helpful, Thank you support @duyue – Jeff Apr 15 '19 at 15:30