mirror of
https://github.com/actions/runner.git
synced 2025-12-29 12:57:29 +08:00
GitHub Actions Runner
This commit is contained in:
108
src/Sdk/DTPipelines/Pipelines/JobResources.cs
Normal file
108
src/Sdk/DTPipelines/Pipelines/JobResources.cs
Normal file
@@ -0,0 +1,108 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.Serialization;
|
||||
using GitHub.DistributedTask.WebApi;
|
||||
|
||||
namespace GitHub.DistributedTask.Pipelines
|
||||
{
|
||||
[DataContract]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public sealed class JobResources
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the collection of containers associated with the current job
|
||||
/// </summary>
|
||||
public List<ContainerResource> Containers
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_containers == null)
|
||||
{
|
||||
m_containers = new List<ContainerResource>();
|
||||
}
|
||||
return m_containers;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the collection of endpoints associated with the current job
|
||||
/// </summary>
|
||||
public List<ServiceEndpoint> Endpoints
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_endpoints == null)
|
||||
{
|
||||
m_endpoints = new List<ServiceEndpoint>();
|
||||
}
|
||||
return m_endpoints;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the collection of repositories associated with the current job
|
||||
/// </summary>
|
||||
public List<RepositoryResource> Repositories
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_repositories == null)
|
||||
{
|
||||
m_repositories = new List<RepositoryResource>();
|
||||
}
|
||||
return m_repositories;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the collection of secure files associated with the current job
|
||||
/// </summary>
|
||||
public List<SecureFile> SecureFiles
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_secureFiles == null)
|
||||
{
|
||||
m_secureFiles = new List<SecureFile>();
|
||||
}
|
||||
return m_secureFiles;
|
||||
}
|
||||
}
|
||||
|
||||
[OnSerializing]
|
||||
private void OnSerializing(StreamingContext context)
|
||||
{
|
||||
if (m_containers?.Count == 0)
|
||||
{
|
||||
m_containers = null;
|
||||
}
|
||||
|
||||
if (m_endpoints?.Count == 0)
|
||||
{
|
||||
m_endpoints = null;
|
||||
}
|
||||
|
||||
if (m_repositories?.Count == 0)
|
||||
{
|
||||
m_repositories = null;
|
||||
}
|
||||
|
||||
if (m_secureFiles?.Count == 0)
|
||||
{
|
||||
m_secureFiles = null;
|
||||
}
|
||||
}
|
||||
|
||||
[DataMember(Name = "Containers", EmitDefaultValue = false)]
|
||||
private List<ContainerResource> m_containers;
|
||||
|
||||
[DataMember(Name = "Endpoints", EmitDefaultValue = false)]
|
||||
private List<ServiceEndpoint> m_endpoints;
|
||||
|
||||
[DataMember(Name = "Repositories", EmitDefaultValue = false)]
|
||||
private List<RepositoryResource> m_repositories;
|
||||
|
||||
[DataMember(Name = "SecureFiles", EmitDefaultValue = false)]
|
||||
private List<SecureFile> m_secureFiles;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user