/// <summary> /// Triggers a new download of the <see cref="PreReceiveEnvironment"/>'s tarball from the environment's <see cref="PreReceiveEnvironment.ImageUrl"/>. /// When the download is finished, the newly downloaded tarball will overwrite the existing environment. /// </summary> /// <remarks> /// See the <a href="https://developer.github.com/v3/enterprise-admin/pre_receive_environments/#trigger-a-pre-receive-environment-download">API documentation</a> for more information. /// </remarks> /// <param name="environmentId">The id of the pre-receive environment</param> /// <exception cref="NotFoundException">Thrown when the specified <paramref name="environmentId"/> does not exist.</exception> /// <exception cref="ApiException">Thrown when a general API error occurs.</exception> public Task <PreReceiveEnvironmentDownload> TriggerDownload(long environmentId) { var endpoint = ApiUrls.AdminPreReceiveEnvironmentDownload(environmentId); return(ApiConnection.Post <PreReceiveEnvironmentDownload>(endpoint, new object(), AcceptHeaders.PreReceiveEnvironmentsPreview)); }