public async Task CanDeletePreReceiveEnvironment() { var newPreReceiveEnvironment = new NewPreReceiveEnvironment(Helper.MakeNameWithTimestamp("pre-receive"), "https://example.com/foo.zip"); var preReceiveEnvironment = await _preReceiveEnvironmentsClient.Create(newPreReceiveEnvironment); EnterpriseHelper.WaitForPreReceiveEnvironmentToComplete(_githubEnterprise.Connection, preReceiveEnvironment); await _preReceiveEnvironmentsClient.Delete(preReceiveEnvironment.Id); await Assert.ThrowsAsync <NotFoundException>(async() => await _preReceiveEnvironmentsClient.Get(preReceiveEnvironment.Id)); }
/// <summary> /// Deletes an existing <see cref="PreReceiveEnvironment"/>. /// </summary> /// <remarks> /// See the <a href="https://developer.github.com/v3/enterprise-admin/pre_receive_environments/#delete-a-pre-receive-environment">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 IObservable <Unit> Delete(long environmentId) { return(_client.Delete(environmentId).ToObservable()); }