using System; using System.ComponentModel; using System.Runtime.Serialization; using Newtonsoft.Json; namespace GitHub.DistributedTask.Pipelines { [EditorBrowsable(EditorBrowsableState.Never)] public static class RepositoryPropertyNames { public static readonly String Id = "id"; public static readonly String Type = "type"; public static readonly String Url = "url"; public static readonly String Version = "version"; } /// /// Provides a data contract for a repository resource referenced by a pipeline. /// [DataContract] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class RepositoryResource : Resource { /// /// Initializes a new RepositoryReference instance with default values. /// public RepositoryResource() { } private RepositoryResource(RepositoryResource referenceToCopy) : base(referenceToCopy) { } /// /// Gets or sets a unique identifier for this repository. /// public String Id { get { return this.Properties.Get(RepositoryPropertyNames.Id); } set { this.Properties.Set(RepositoryPropertyNames.Id, value); } } /// /// Gets or sets the type of repository. /// public String Type { get { return this.Properties.Get(RepositoryPropertyNames.Type); } set { this.Properties.Set(RepositoryPropertyNames.Type, value); } } /// /// Gets or sets the url of the repository. /// public Uri Url { get { return this.Properties.Get(RepositoryPropertyNames.Url); } set { this.Properties.Set(RepositoryPropertyNames.Url, value); } } /// /// Gets or sets the version of the repository. /// public String Version { get { return this.Properties.Get(RepositoryPropertyNames.Version); } set { this.Properties.Set(RepositoryPropertyNames.Version, value); } } /// /// Creates a clone of the current repository instance. /// /// A new RepositoryReference instance which is a copy of the current instance public RepositoryResource Clone() { return new RepositoryResource(this); } } }