using System; using System.Collections.Generic; using System.ComponentModel; using System.Runtime.Serialization; using Newtonsoft.Json; namespace GitHub.DistributedTask.Pipelines { [EditorBrowsable(EditorBrowsableState.Never)] public static class ContainerPropertyNames { public const String Env = "env"; public const String Image = "image"; public const String Options = "options"; public const String Volumes = "volumes"; public const String Ports = "ports"; } [DataContract] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class ContainerResource : Resource { [JsonConstructor] public ContainerResource() { } private ContainerResource(ContainerResource referenceToCopy) : base(referenceToCopy) { } /// /// Gets or sets the environment which is provided to the container. /// public IDictionary Environment { get { return this.Properties.Get>(ContainerPropertyNames.Env); } set { this.Properties.Set(ContainerPropertyNames.Env, value); } } /// /// Gets or sets the container image name. /// public String Image { get { return this.Properties.Get(ContainerPropertyNames.Image); } set { this.Properties.Set(ContainerPropertyNames.Image, value); } } /// /// Gets or sets the options used for the container instance. /// public String Options { get { return this.Properties.Get(ContainerPropertyNames.Options); } set { this.Properties.Set(ContainerPropertyNames.Options, value); } } /// /// Gets or sets the volumes which are mounted into the container. /// public IList Volumes { get { return this.Properties.Get>(ContainerPropertyNames.Volumes); } set { this.Properties.Set(ContainerPropertyNames.Volumes, value); } } /// /// Gets or sets the ports which are exposed on the container. /// public IList Ports { get { return this.Properties.Get>(ContainerPropertyNames.Ports); } set { this.Properties.Set(ContainerPropertyNames.Ports, value); } } public ContainerResource Clone() { return new ContainerResource(this); } } }