postIntegrationsGithubReposByRepoPages method
Future<GithubPagesView?>
postIntegrationsGithubReposByRepoPages(
- String repo,
- GithubPagesEnableReq githubPagesEnableReq
Creates the repo's Pages site and answers 201 Created with it.
Creates the repo's Pages site and answers 201 Created with it. With buildType "workflow" the site builds via GitHub Actions; otherwise it builds from a branch source, defaulting to the repo's own default branch when none is given. Only "/" and "/docs" are legal source paths (GitHub's rule).
Parameters:
-
String repo (required): Repo is the repository, from the :repo path segment.
-
GithubPagesEnableReq githubPagesEnableReq (required):
Implementation
Future<GithubPagesView?> postIntegrationsGithubReposByRepoPages(String repo, GithubPagesEnableReq githubPagesEnableReq,) async {
final response = await postIntegrationsGithubReposByRepoPagesWithHttpInfo(repo, githubPagesEnableReq,);
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), 'GithubPagesView',) as GithubPagesView;
}
return null;
}