Update runner to handle Dotcom/runner-admin based registration flow (#2487)

This commit is contained in:
Tatyana Kostromskaya
2023-03-21 16:05:32 +01:00
committed by GitHub
parent 440c81b770
commit bb7b1e8259
8 changed files with 455 additions and 19 deletions

View File

@@ -0,0 +1,50 @@
using GitHub.Services.WebApi;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using System.Linq;
namespace GitHub.DistributedTask.WebApi
{
public class ListRunnersResponse
{
public ListRunnersResponse()
{
}
public ListRunnersResponse(ListRunnersResponse responseToBeCloned)
{
this.TotalCount = responseToBeCloned.TotalCount;
this.Runners = responseToBeCloned.Runners;
}
[JsonProperty("total_count")]
public int TotalCount
{
get;
set;
}
[JsonProperty("runners")]
public List<Runner> Runners
{
get;
set;
}
public ListRunnersResponse Clone()
{
return new ListRunnersResponse(this);
}
public List<TaskAgent> ToTaskAgents()
{
List<TaskAgent> taskAgents = new List<TaskAgent>();
return Runners.Select(runner => new TaskAgent() { Name = runner.Name }).ToList();
}
}
}