postIntegrationsGithubFork method
Forks a granted repository.
Forks a granted repository. GitHub's fork is ASYNCHRONOUS: it answers 202 with the target repo and populates it in the background, and it answers the same 202 when the fork already exists. So this reports what GitHub said rather than waiting — a call that blocked until the clone finished would time out on a large repository and tell the caller nothing it does not already know.
Parameters:
- GithubForkReq githubForkReq (required):
Implementation
Future<GithubForkOut?> postIntegrationsGithubFork(GithubForkReq githubForkReq,) async {
final response = await postIntegrationsGithubForkWithHttpInfo(githubForkReq,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'GithubForkOut',) as GithubForkOut;
}
return null;
}