-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathJobDeleteCommand.cs
More file actions
29 lines (25 loc) · 833 Bytes
/
Copy pathJobDeleteCommand.cs
File metadata and controls
29 lines (25 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
namespace JenkinsNET.Internal.Commands
{
internal class JobDeleteCommand : JenkinsHttpCommand
{
public JobDeleteCommand(JenkinsClient client, string jobName) : base(client)
{
if (string.IsNullOrEmpty(jobName))
throw new ArgumentException("'jobName' cannot be empty!");
Path = $"job/{jobName}/doDelete";
OnWrite = request => {
request.Method = "POST";
request.ContentLength = 0;
request.AllowAutoRedirect = false;
};
#if NET_ASYNC
OnWriteAsync = async (request, token) => {
request.Method = "POST";
request.ContentLength = 0;
request.AllowAutoRedirect = false;
};
#endif
}
}
}