postIntegrationsGithubReposByRepoPagesBuilds method

Future<GithubPagesBuildOut?> postIntegrationsGithubReposByRepoPagesBuilds(
  1. String repo
)

Requests a Pages rebuild and returns the queued build's status.

Requests a Pages rebuild and returns the queued build's status. The build is queued AT GITHUB, not completed here, so the answer is 202 Accepted and its status is the one GitHub reported at queue time. 404 when the repository has no Pages site, or when the org's installation was not granted it.

Parameters:

  • String repo (required): Repo is the repository's short name within the org's installation, with no owner prefix (the owner is server-derived from the grant). A trailing ".git" is stripped.

Implementation

Future<GithubPagesBuildOut?> postIntegrationsGithubReposByRepoPagesBuilds(String repo,) async {
  final response = await postIntegrationsGithubReposByRepoPagesBuildsWithHttpInfo(repo,);
  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), 'GithubPagesBuildOut',) as GithubPagesBuildOut;

  }
  return null;
}